| java.lang.Object org.exolab.castor.util.Configuration org.exolab.castor.util.LocalConfiguration
LocalConfiguration | final public class LocalConfiguration extends Configuration (Code) | | Provides default configuration for Castor components from the
castor.properties configuration file. All Castor features
rely on the central configuration file.
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.
author: Keith Visco author: Assaf Arkin version: $Revision: 6980 $ $Date: 2006-04-25 15:08:23 -0600 (Tue, 25 Apr 2006) $ |
Method Summary | |
public boolean | debug() Returns true if the current configuration has enabled debugging. | public static synchronized LocalConfiguration | getInstance() Returns an instance of the LocalConfiguration, if a previous
configuration has already been loaded for local resource,
it will be returned. | public boolean | getLenientIdValidation() Indicates whether id/href validation should be lenient. | public boolean | getLenientSequenceOrder() Indicates whether validation for sequence order should be lenient. | public OutputFormat | getOutputFormat() Returns the default OutputFormat for use with a Serializer. | public Parser | getParser() Return an XML document parser implementing the feature list
specified in the configuration file. | public Parser | getParser(String features) Returns an XML document parser implementing the requested
set of features. | public NodeType | getPrimitiveNodeType() Returns the NodeType to use for Java primitives. | public synchronized Properties | getProperties() Returns the current properties from the configuration file(s). | public RegExpEvaluator | getRegExpEvaluator() | public Serializer | getSerializer() Returns a default serializer for producing an XML document.
The caller can specify an alternative output format, may reuse
this serializer across several streams, and may serialize both
DOM and SAX events. | public DocumentHandler | getSerializer(OutputStream output) Returns a default serializer for producing an XML document to
the designated output stream using the default serialization
format. | public DocumentHandler | getSerializer(Writer output) Returns a default serializer for producing an XML document to
the designated output stream using the default serialization
format. | public XMLNaming | getXMLNaming() | public XMLNaming | getXMLNaming(ClassLoader classLoader) | public XMLReader | getXMLReader() Returns an XML document parser implementing the requested
set of features. | public XMLReader | getXMLReader(String features) Returns an XML document parser implementing the requested
set of features. | protected void | load() Calls
LocalConfiguration.getDefault() to load the configuration the
first time and then looks for a local configuration to
merge in with the defaults. | public void | loadProperties(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. | public boolean | marshallingValidation() Returns true if the default configuration specified validation in
the marshalling framework. | public boolean | strictElements() Access to the property specifying whether to apply strictness to elements when
unmarshalling. |
LocalConfiguration | public LocalConfiguration()(Code) | | Creates a new instance of LocalConfiguration
|
debug | public boolean debug()(Code) | | Returns true if the current configuration has enabled debugging.
true if the current configuration has enabled debugging,otherwise false. |
getInstance | public static synchronized LocalConfiguration getInstance()(Code) | | Returns an instance of the LocalConfiguration, if a previous
configuration has already been loaded for local resource,
it will be returned.
the LocalConfiguration |
getLenientIdValidation | public boolean getLenientIdValidation()(Code) | | Indicates whether id/href validation should be lenient.
True if id/href validation should be lenient. |
getLenientSequenceOrder | public boolean getLenientSequenceOrder()(Code) | | Indicates whether validation for sequence order should be lenient.
True if sequence order validation should be lenient. |
getOutputFormat | public OutputFormat getOutputFormat()(Code) | | Returns the default OutputFormat for use with a Serializer.
the default OutputFormat |
getParser | public Parser getParser()(Code) | | Return an XML document parser implementing the feature list
specified in the configuration file.
A suitable XML parser |
getParser | public Parser getParser(String features)(Code) | | Returns an XML document parser implementing the requested
set of features. The feature list is a comma separated list
of features that parser may or may not support. No errors are
generated for unsupported features. If the feature list is not
null, it overrides the default feature list specified in the
configuration file, including validation and Namespaces.
Parameters: features - The requested feature list, null for thedefaults A suitable XML parser |
getPrimitiveNodeType | public NodeType getPrimitiveNodeType()(Code) | | Returns the NodeType to use for Java primitives.
A null value will be returned if no NodeType was specified,
indicating the default NodeType should be used.
the NodeType assigned to Java primitives, or nullif no NodeType was specified. |
getProperties | public synchronized Properties getProperties()(Code) | | Returns the current properties from the configuration file(s).
The Properties returned may be empty, but never null.
The current set of configuration properties. |
getRegExpEvaluator | public RegExpEvaluator getRegExpEvaluator()(Code) | | Returns a new instance of the specified Regular Expression
Evaluator, or null if no validator was specified
the regular expression evaluator, |
getSerializer | public Serializer getSerializer()(Code) | | Returns a default serializer for producing an XML document.
The caller can specify an alternative output format, may reuse
this serializer across several streams, and may serialize both
DOM and SAX events. If such control is not required, it is
recommended to call one of the other two methods.
A suitable serializer |
getSerializer | public DocumentHandler getSerializer(OutputStream output) throws IOException(Code) | | Returns a default serializer for producing an XML document to
the designated output stream using the default serialization
format.
Parameters: output - The output stream A suitable serializer |
getSerializer | public DocumentHandler getSerializer(Writer output) throws IOException(Code) | | Returns a default serializer for producing an XML document to
the designated output stream using the default serialization
format.
Parameters: output - The output stream A suitable serializer |
getXMLNaming | public XMLNaming getXMLNaming()(Code) | | Returns the naming conventions to use for the XML framework
the naming conventions to use for the XML framework |
getXMLNaming | public XMLNaming getXMLNaming(ClassLoader classLoader)(Code) | | Returns the naming conventions to use for the XML framework
the naming conventions to use for the XML framework |
getXMLReader | public XMLReader getXMLReader()(Code) | | Returns an XML document parser implementing the requested
set of features. The feature list is a comma separated list
of features that parser may or may not support. No errors are
generated for unsupported features. If the feature list is not
null, it overrides the default feature list specified in the
configuration file, including validation and Namespaces.
A suitable XML parser |
getXMLReader | public XMLReader getXMLReader(String features)(Code) | | Returns an XML document parser implementing the requested
set of features. The feature list is a comma separated list
of features that parser may or may not support. No errors are
generated for unsupported features. If the feature list is not
null, it overrides the default feature list specified in the
configuration file, including validation and Namespaces.
A suitable XML parser |
load | protected void load()(Code) | | Calls
LocalConfiguration.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.
|
loadProperties | public void loadProperties(String fileOrResourceName) throws FileNotFoundException(Code) | | 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.
|
marshallingValidation | public boolean marshallingValidation()(Code) | | Returns true if the default configuration specified validation in
the marshalling framework.
|
strictElements | public boolean strictElements()(Code) | | Access to the property specifying whether to apply strictness to elements when
unmarshalling. Default is true which means that elements appearing in the
XML Documnt which cannot be mapped to a class cause a SAXException to be thrown.
If set to false, these 'unknown' elements are ignored
true if element processing should be "strict". |
|
|