org.exolab.castor.util
public abstract class Configuration extends Object
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.
Version: $Revision: 1.2 $ $Date: 2003/05/01 07:06:45 $
Nested Class Summary | |
---|---|
static class | Configuration.ConfigValues
Inner class to hold values of the configuration |
static class | Configuration.Features |
static class | Configuration.Property
Names of properties used in the configuration file. |
Field Summary | |
---|---|
static String | ON_VALUE |
static String | TRUE_VALUE |
Constructor Summary | |
---|---|
Configuration()
Protected default constructor |
Method Summary | |
---|---|
boolean | debug()
Returns true if the configuration specifies debugging.
|
static Properties | getDefault()
Returns the default configuration file. |
static boolean | getDefaultDebug()
Returns true if the default configuration specified debugging.
|
static boolean | getDefaultMarshallingValidation()
Returns true if the default configuration specifies validation in
the marshalling framework.
|
static OutputFormat | getDefaultOutputFormat()
Returns the default OutputFormat for use with a Serializer.
|
static Parser | getDefaultParser()
Return an XML document parser implementing the feature list
specified in the default configuration file.
|
static Parser | getDefaultParser(String features)
Returns an XML document parser implementing the requested
set of features. |
static NodeType | getDefaultPrimitiveNodeType()
Returns the NodeType to use for Java primitives.
|
static String | getDefaultProperty(String name, String defValue)
Returns a property from the default configuration file.
|
static RegExpEvaluator | getDefaultRegExpEvaluator()
Returns a new instance of the specified Regular Expression
Evaluator, or null if no validator was specified
|
static Serializer | getDefaultSerializer()
Returns a default serializer for producing an XML document.
|
static DocumentHandler | getDefaultSerializer(OutputStream output)
Returns a default serializer for producing an XML document to
the designated output stream using the default serialization
format.
|
static DocumentHandler | getDefaultSerializer(Writer output)
Returns a default serializer for producing an XML document to
the designated output stream using the default serialization
format.
|
static boolean | getDefaultStrictElements()
Access to the property specifying whether to apply strictness to elements when
unmarshalling. |
static XMLNaming | getDefaultXMLNaming()
Returns the default naming conventions to use for the XML framework
|
abstract OutputFormat | getOutputFormat()
Returns the currently configured OutputFormat for use with a Serializer.
|
Parser | getParser()
Return an XML parser implementing the feature list specified
in the configuration file.
|
NodeType | getPrimitiveNodeType()
Returns the currently configured NodeType to use for Java
primitives. |
Properties | getProperties()
Returns the current properties from the configuration file(s).
|
String | getProperty(String name, String defValue)
Returns a property from the current configuration.
|
RegExpEvaluator | getRegExpEvaluator()
Returns a new instance of the specified Regular Expression
Evaluator, or null if no validator was specified
|
abstract Serializer | getSerializer()
Returns a serializer for producing an XML instance document.
|
abstract DocumentHandler | getSerializer(OutputStream output)
Returns a serializer for producing an XML document to
the designated output stream using the default serialization
format.
|
abstract DocumentHandler | getSerializer(Writer output)
Returns a serializer for producing an XML instance document to
the designated output stream using the default serialization
format.
|
XMLNaming | getXMLNaming()
Returns the currently configured naming conventions to use
for the XML framework
Design note: This method should be overloaded by any
sub-classes.
|
protected static void | loadDefaults()
Called by {@link #getDefault} to load the configuration the
first time. |
static Properties | loadProperties(String resourceName, String fileName)
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 current configuration (user-supplied or default)
specifies validation in the marshalling framework.
|
boolean | strictElements()
Access to the property specifying whether to apply strictness to elements when
unmarshalling. |
See Also: getDefaultDebug
UNKNOWN: true if the configuration specifies debugging.
Returns: the default configuration properties
See Also: getProperties
UNKNOWN: true if the configuration specifies debugging.
Returns: true if by default validation should be performed during the marshalling and unmarshalling process, otherwise false.
See Also: marshallingValidation
Returns: the default OutputFormat
Returns: a suitable XML parser
See Also: getParser
Parameters: features The requested feature list, null for the defaults
Returns: A suitable XML parser
Returns: the NodeType assigned to Java primitives, or null if no NodeType was specified.
See Also: getPrimitiveNodeType
Parameters: name The property name default The property's default value
Returns: The property's value
See Also: getProperty
Returns: the regular expression evaluator,
See Also: getRegExpEvaluator
Parameters: output The output stream
Returns: A suitable serializer
See Also: getSerializer
Parameters: output the output stream
Returns: A suitable serializer
Parameters: output the Writer to write data to.
Returns: A suitable serializer
Returns: true if element processing should be "strict".
See Also: strictElements
Returns: the default naming conventions to use for the XML framework
Returns: the currently configured OutputFormat.
See Also: getDefaultOutputFormat
Returns: a suitable XML parser
See Also: getDefaultParser
Returns: the NodeType assigned to Java primitives, or null if no NodeType was specified.
See Also: getDefaultPrimitiveNodeType
Returns: the current set of configuration properties.
See Also: getDefault
Parameters: name The property name default The property's default value
Returns: The property's value
See Also: getDefaultProperty getProperties
Returns: the regular expression evaluator,
See Also: getDefaultRegExpEvaluator
Parameters: output The output stream
Returns: A suitable serializer
See Also: getDefaultSerializer
Parameters: output the output stream
Returns: A suitable serializer
Parameters: output the Writer to write data to.
Returns: A suitable serializer
Returns: the currently configured naming conventions to use for the XML framework
See Also: getDefaultXMLNaming
Returns: true if by default validation should be performed during the marshalling and unmarshalling process, otherwise false.
See Also: getDefaultMarshallingValidation
Returns: true if element processing should be "strict".
See Also: getDefaultStrictElements