public final class LocalConfiguration extends Configuration
The configuration file is loaded from the Java lib directory, the classpath and the Castor JAR. Properties set in the classpath file takes precedence over properties set in the Java library configuration file and properties set in the Castor JAR, allowing for each customization. All three files are named castor.properties.
For example, to change the parser in use, specify that all documents should be printed with identantion or turn debugging on, create a new configuration file in the current directory, instead of modifying the global one.
Configuration.ConfigValues, Configuration.Features, Configuration.PropertyON_VALUE, TRUE_VALUE| Constructor and Description |
|---|
LocalConfiguration()
Creates a new instance of LocalConfiguration
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
debug()
Returns true if the current configuration has enabled debugging.
|
static LocalConfiguration |
getInstance()
Returns an instance of the LocalConfiguration, if a previous
configuration has already been loaded for local resource,
it will be returned.
|
OutputFormat |
getOutputFormat()
Returns the default OutputFormat for use with a Serializer.
|
org.xml.sax.Parser |
getParser()
Return an XML document parser implementing the feature list
specified in the configuration file.
|
org.xml.sax.Parser |
getParser(java.lang.String features)
Returns an XML document parser implementing the requested
set of features.
|
NodeType |
getPrimitiveNodeType()
Returns the NodeType to use for Java primitives.
|
java.util.Properties |
getProperties()
Returns the current properties from the configuration file(s).
|
RegExpEvaluator |
getRegExpEvaluator()
Returns a new instance of the specified Regular Expression
Evaluator, or null if no validator was specified
|
Serializer |
getSerializer()
Returns a default serializer for producing an XML document.
|
org.xml.sax.DocumentHandler |
getSerializer(java.io.OutputStream output)
Returns a default serializer for producing an XML document to
the designated output stream using the default serialization
format.
|
org.xml.sax.DocumentHandler |
getSerializer(java.io.Writer output)
Returns a default serializer for producing an XML document to
the designated output stream using the default serialization
format.
|
XMLNaming |
getXMLNaming()
Returns the naming conventions to use for the XML framework
|
XMLNaming |
getXMLNaming(java.lang.ClassLoader classLoader)
Returns the naming conventions to use for the XML framework
|
org.xml.sax.XMLReader |
getXMLReader()
Returns an XML document parser implementing the requested
set of features.
|
org.xml.sax.XMLReader |
getXMLReader(java.lang.String features)
Returns an XML document parser implementing the requested
set of features.
|
protected void |
load()
Calls
Configuration.getDefault() to load the configuration the
first time and then looks for a local configuration to
merge in with the defaults. |
void |
loadProperties(java.lang.String fileOrResourceName)
Load the configuration will not complain about inability to load
configuration file from one of the default directories, but if
it cannot find the JAR's configuration file, will throw a
run time exception.
|
boolean |
marshallingValidation()
Returns true if the default configuration specified validation in
the marshalling framework.
|
boolean |
strictElements()
Access to the property specifying whether to apply strictness to elements when
unmarshalling.
|
getDefault, getDefaultDebug, getDefaultMarshallingValidation, getDefaultOutputFormat, getDefaultParser, getDefaultParser, getDefaultPrimitiveNodeType, getDefaultProperty, getDefaultRegExpEvaluator, getDefaultSerializer, getDefaultSerializer, getDefaultSerializer, getDefaultStrictElements, getDefaultXMLNaming, getDefaultXMLReader, getDefaultXMLReader, getProperty, getSerializerFactory, loadDefaults, loadProperties, setFeaturesOnXmlReaderpublic LocalConfiguration()
public static LocalConfiguration getInstance()
public boolean debug()
debug in class ConfigurationConfiguration.getDefaultDebug()public boolean strictElements()
strictElements in class ConfigurationConfiguration.getDefaultStrictElements()public boolean marshallingValidation()
marshallingValidation in class ConfigurationConfiguration.getDefaultMarshallingValidation()public java.util.Properties getProperties()
getProperties in class ConfigurationConfiguration.getDefault()public XMLNaming getXMLNaming()
getXMLNaming in class ConfigurationConfiguration.getDefaultXMLNaming()public XMLNaming getXMLNaming(java.lang.ClassLoader classLoader)
public org.xml.sax.Parser getParser()
getParser in class ConfigurationConfiguration.getDefaultParser()public org.xml.sax.Parser getParser(java.lang.String features)
features - The requested feature list, null for the
defaultspublic org.xml.sax.XMLReader getXMLReader()
getXMLReader in class Configurationpublic org.xml.sax.XMLReader getXMLReader(java.lang.String features)
public NodeType getPrimitiveNodeType()
getPrimitiveNodeType in class ConfigurationConfiguration.getDefaultPrimitiveNodeType()public RegExpEvaluator getRegExpEvaluator()
getRegExpEvaluator in class ConfigurationConfiguration.getDefaultRegExpEvaluator()public Serializer getSerializer()
getSerializer in class ConfigurationConfiguration.getDefaultSerializer()public OutputFormat getOutputFormat()
getOutputFormat in class ConfigurationConfiguration.getDefaultOutputFormat()public org.xml.sax.DocumentHandler getSerializer(java.io.OutputStream output)
throws java.io.IOException
getSerializer in class Configurationoutput - The output streamjava.io.IOExceptionpublic org.xml.sax.DocumentHandler getSerializer(java.io.Writer output)
throws java.io.IOException
getSerializer in class Configurationoutput - The output streamjava.io.IOExceptionprotected void load()
Configuration.getDefault() to load the configuration the
first time and then looks for a local configuration to
merge in with the defaults. Will not complain about inability
to load local configuration file from one of the default
directories, but if it cannot find the JAR's configuration file,
will throw a run time exception.public void loadProperties(java.lang.String fileOrResourceName)
throws java.io.FileNotFoundException
java.io.FileNotFoundExceptionIntalio Inc. (C) 1999-2006. All rights reserved http://www.intalio.com