|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.xmlmill.config.Configurator
The Configurator is responsible for reading the
configuration properties from an (external) XML configuration file
and making these available to the application.
You need to call the Configurator only once during the
lifetime of your JVM session, as all PDXTransform
sessions will ask the requested configuration attributes from
this class.
The content of the configuration cannot be changed during the lifetime of the Configurator (in order to change the content of the configuration the config.xml file needs to be reread.
| Field Summary | |
static int |
JAXP_11
A possible JAXP version |
static int |
JAXP_12
A possible JAXP version |
static int |
JAXP_13
A possible JAXP version |
| Method Summary | |
static void |
configure()
Loads the configuration values from the default config.xml file. |
static void |
configure(java.io.File f)
Loads configuration from specified configuration file. |
static void |
configure(java.io.File f,
int i)
Loads configuration from specified configuration file. |
static void |
configure(int i)
Loads the configuration values from the default config.xml file. |
static void |
configure(java.lang.String s)
Loads configuration from specified configuration file. |
static void |
configure(java.lang.String s,
int i)
Loads configuration from specified configuration file. |
static void |
configure(java.net.URL url)
Loads configuration from specified configuration file. |
static void |
configure(java.net.URL url,
int i)
Loads configuration from specified configuration file. |
static boolean |
containsKey(java.lang.String key)
Returns true if this Configurator contains a mapping for the specified key. |
static java.lang.Object |
get(java.lang.String key)
Returns specified value with the specified key in the configuration map. |
static org.apache.commons.logging.Log |
getLogger()
Returns the logger to use. |
static boolean |
isConfigured()
Returns if the configuration has been done. |
static void |
reset()
Resets (empties)the configuration map. |
static void |
setErrorHandler(JAXPErrorHandler handler)
Defines the behavior of the errorhandler when processing the configuration file. |
static void |
setLogger(org.apache.commons.logging.Log l)
Define the loggin instance to use. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int JAXP_11
public static final int JAXP_12
public static final int JAXP_13
| Method Detail |
public static final void configure()
throws javax.xml.parsers.ParserConfigurationException,
org.xml.sax.SAXException,
XMLMillFatalError,
java.io.IOException
The default config.xml file is located in the xmlmill.jar
package at following location: com/xmlmill/conf/config.xml.
javax.xml.parsers.ParserConfigurationException - when a parser cannot be configurated.org.xml.sax.SAXException - when a SAXException occurs.XMLMillException - when a XMLMill exception occurs.java.io.IOException - when a IOException exception occurs.
public static final void configure(int i)
throws javax.xml.parsers.ParserConfigurationException,
org.xml.sax.SAXException,
XMLMillFatalError,
java.io.IOException,
XMLMillNotRecognizedException
The default config.xml file is located in the xmlmill.jar
package at following location: com/xmlmill/conf/config.xml.
The JAXPVersion can be added to define a version different from the version defined in the configuration file.
i - int representing the JAXP version implemented.javax.xml.parsers.ParserConfigurationException - when a parser cannot be configurated.org.xml.sax.SAXException - when a SAXException occurs.XMLMillException - when a XMLMill exception occurs.java.io.IOException - when a IOException exception occurs.XMLMillNotRecognizedException - when the JAXP version is unknown.JAXP_11,
JAXP_12,
JAXP_13
public static final void configure(java.lang.String s)
throws javax.xml.parsers.ParserConfigurationException,
org.xml.sax.SAXException,
XMLMillException,
java.io.IOException
s - String representing the configuration file (URL)
The URL should be fully resolved. For example: http://www.
xmlmill.com/test/config.xml or file:/c:/xmlmill/test/config.xml.javax.xml.parsers.ParserConfigurationException - when a parser cannot be configurated.org.xml.sax.SAXException - when a SAXException occurs.XMLMillException - when a XMLMill exception occurs.java.io.IOException - when a IOException exception occurs.
public static final void configure(java.lang.String s,
int i)
throws javax.xml.parsers.ParserConfigurationException,
org.xml.sax.SAXException,
XMLMillException,
java.io.IOException,
XMLMillNotRecognizedException
The JAXPVersion can be added to define a version different from the version defined in the configuration file.
s - String representing the configuration file (URL)
The URL should be fully resolved. For example: http://www.
xmlmill.com/test/config.xml or file:/c:/xmlmill/test/config.xml.i - int representing the JAXP version implemented.XMLMillNotRecognizedException - when the JAXP version is unknown.javax.xml.parsers.ParserConfigurationException - when a parser cannot be configurated.org.xml.sax.SAXException - when a SAXException occurs.XMLMillException - when a XMLMill exception occurs.java.io.IOException - when a IOException exception occurs.JAXP_11,
JAXP_12,
JAXP_13
public static final void configure(java.net.URL url)
throws javax.xml.parsers.ParserConfigurationException,
org.xml.sax.SAXException,
XMLMillException,
java.io.IOException
url - URL representing the configuration file
The URL should be fully resolved. For example: http://www.
xmlmill.com/test/config.xml or file:/c:/xmlmill/test/config.xml.javax.xml.parsers.ParserConfigurationException - when a parser cannot be configurated.org.xml.sax.SAXException - when a SAXException occurs.XMLMillException - when a XMLMill exception occurs.java.io.IOException - when a IOException exception occurs.
public static final void configure(java.net.URL url,
int i)
throws javax.xml.parsers.ParserConfigurationException,
org.xml.sax.SAXException,
XMLMillException,
java.io.IOException,
XMLMillNotRecognizedException
The JAXPVersion can be added to define a version different from the version defined in the configuration file.
url - URL representing the configuration file
The URL should be fully resolved. For example: http://www.
xmlmill.com/test/config.xml or file:/c:/xmlmill/test/config.xml.i - int representing the JAXP version implemented.XMLMillNotRecognizedException - when the JAXP version is unknown.javax.xml.parsers.ParserConfigurationException - when a parser cannot be configurated.org.xml.sax.SAXException - when a SAXException occurs.XMLMillException - when a XMLMill exception occurs.java.io.IOException - when a IOException exception occurs.JAXP_11,
JAXP_12,
JAXP_13
public static void configure(java.io.File f)
throws javax.xml.parsers.ParserConfigurationException,
org.xml.sax.SAXException,
XMLMillException,
java.io.IOException
f - File representing the configuration filejavax.xml.parsers.ParserConfigurationException - when a parser cannot be configurated.org.xml.sax.SAXException - when a SAXException occurs.XMLMillException - when a XMLMill exception occurs.java.io.IOException - when a IOException exception occurs.
public static void configure(java.io.File f,
int i)
throws javax.xml.parsers.ParserConfigurationException,
org.xml.sax.SAXException,
XMLMillException,
java.io.IOException,
XMLMillNotRecognizedException
The JAXPVersion can be added to define a version different from the version defined in the configuration file.
f - File representing the configuration filei - int representing the JAXP version implemented.XMLMillNotRecognizedException - when the JAXP version is unknown.javax.xml.parsers.ParserConfigurationException - when a parser cannot be configurated.org.xml.sax.SAXException - when a SAXException occurs.XMLMillException - when a XMLMill exception occurs.java.io.IOException - when a IOException exception occurs.JAXP_11,
JAXP_12,
JAXP_13public static final void setErrorHandler(JAXPErrorHandler handler)
*** For internal use only ***
Defines whether or not to log and stop processing when a error or warning happens processing the configuration file.
Note:
This method will become protected in the next version of XMLMill. Do not use.
handler - the errors handler.JAXPErrorHandlerpublic static final java.lang.Object get(java.lang.String key)
If the size of the configuration map is empty, the default
configuration map (located at: com/xmlmill/conf/config.xml)
will first be read.
key - with which the specified value is to be associated.public static final boolean containsKey(java.lang.String key)
key - whose presence in this Configurator is to be tested.public static final boolean isConfigured()
public static final void reset()
Note: It is important to know that the internal font-cache is NOT resetted.
public static final void setLogger(org.apache.commons.logging.Log l)
public static final org.apache.commons.logging.Log getLogger()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||