Classes | |
class | ConfigValues |
class | Features |
class | Property |
Public Member Functions | |
boolean | debug () |
boolean | strictElements () |
boolean | marshallingValidation () |
Properties | getProperties () |
String | getProperty (String name, String defValue) |
XMLNaming | getXMLNaming () |
Parser | getParser () |
NodeType | getPrimitiveNodeType () |
XMLReader | getXMLReader () |
RegExpEvaluator | getRegExpEvaluator () |
abstract Serializer | getSerializer () |
abstract OutputFormat | getOutputFormat () |
abstract DocumentHandler | getSerializer (OutputStream output) throws IOException |
abstract DocumentHandler | getSerializer (Writer output) throws IOException |
Static Public Member Functions | |
static boolean | getDefaultDebug () |
static boolean | getDefaultStrictElements () |
static boolean | getDefaultMarshallingValidation () |
static synchronized Properties | getDefault () |
static String | getDefaultProperty (String name, String defValue) |
static XMLNaming | getDefaultXMLNaming () |
static Parser | getDefaultParser () |
static Parser | getDefaultParser (String features) |
static NodeType | getDefaultPrimitiveNodeType () |
static XMLReader | getDefaultXMLReader () |
static XMLReader | getDefaultXMLReader (String features) |
static RegExpEvaluator | getDefaultRegExpEvaluator () |
static Serializer | getDefaultSerializer () |
static OutputFormat | getDefaultOutputFormat () |
static DocumentHandler | getDefaultSerializer (OutputStream output) throws IOException |
static DocumentHandler | getDefaultSerializer (Writer output) throws IOException |
static Properties | loadProperties (String resourceName, String fileName) |
Static Protected Member Functions | |
static void | loadDefaults () |
Package Functions | |
Configuration () | |
Static Package Attributes | |
static final String | TRUE_VALUE = "true" |
static final String | ON_VALUE = "on" |
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.
org.exolab.castor.util.Configuration.Configuration | ( | ) | [package] |
Protected default constructor
boolean org.exolab.castor.util.Configuration.debug | ( | ) |
Returns true if the configuration specifies debugging. Design note: This method should be overloaded by any sub-classes.
Reimplemented in org.exolab.castor.util.LocalConfiguration.
References org.exolab.castor.util.Configuration.getDefaultDebug().
static synchronized Properties org.exolab.castor.util.Configuration.getDefault | ( | ) | [static] |
Returns the default configuration file. Changes to the returned properties set may affect all Castor functions relying on the default configuration.
References org.exolab.castor.util.Configuration.loadDefaults().
Referenced by org.exolab.castor.util.Configuration.getDefaultDebug(), org.exolab.castor.util.Configuration.getDefaultMarshallingValidation(), org.exolab.castor.util.Configuration.getDefaultOutputFormat(), org.exolab.castor.util.Configuration.getDefaultParser(), org.exolab.castor.util.Configuration.getDefaultProperty(), org.exolab.castor.util.Configuration.getDefaultRegExpEvaluator(), org.exolab.castor.util.Configuration.getDefaultSerializer(), org.exolab.castor.util.Configuration.getDefaultStrictElements(), org.exolab.castor.util.Configuration.getDefaultXMLReader(), org.exolab.castor.util.Configuration.getProperties(), and org.exolab.castor.util.LocalConfiguration.load().
static boolean org.exolab.castor.util.Configuration.getDefaultDebug | ( | ) | [static] |
Returns true if the default configuration specified debugging.
References org.exolab.castor.util.Configuration.getDefault().
Referenced by org.exolab.castor.util.Configuration.debug().
static boolean org.exolab.castor.util.Configuration.getDefaultMarshallingValidation | ( | ) | [static] |
Returns true if the default configuration specifies validation in the marshalling framework.
References org.exolab.castor.util.Configuration.getDefault().
Referenced by org.exolab.castor.util.Configuration.marshallingValidation().
static OutputFormat org.exolab.castor.util.Configuration.getDefaultOutputFormat | ( | ) | [static] |
Returns the default OutputFormat for use with a Serializer.
References org.exolab.castor.util.Configuration.getDefault(), org.exolab.castor.util.Configuration.ON_VALUE, and org.exolab.castor.util.Configuration.TRUE_VALUE.
Referenced by org.exolab.castor.util.Configuration.getDefaultSerializer().
static Parser org.exolab.castor.util.Configuration.getDefaultParser | ( | ) | [static] |
Return an XML document parser implementing the feature list specified in the default configuration file.
Referenced by org.exolab.castor.util.Configuration.getParser().
static Parser org.exolab.castor.util.Configuration.getDefaultParser | ( | String | features | ) | [static] |
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.
features | The requested feature list, null for the defaults |
References org.exolab.castor.util.Configuration.getDefault().
static NodeType org.exolab.castor.util.Configuration.getDefaultPrimitiveNodeType | ( | ) | [static] |
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.
References org.exolab.castor.util.Configuration.getDefaultProperty().
Referenced by org.exolab.castor.util.Configuration.getPrimitiveNodeType().
static String org.exolab.castor.util.Configuration.getDefaultProperty | ( | String | name, | |
String | defValue | |||
) | [static] |
Returns a property from the default configuration file. Equivalent to calling getProperty
on the result of getDefault.
name | The property name | |
defValue | The property's default value |
References org.exolab.castor.util.Configuration.getDefault().
Referenced by org.exolab.castor.util.Configuration.getDefaultPrimitiveNodeType(), and org.exolab.castor.util.Configuration.getDefaultXMLNaming().
static RegExpEvaluator org.exolab.castor.util.Configuration.getDefaultRegExpEvaluator | ( | ) | [static] |
Returns a new instance of the specified Regular Expression Evaluator, or null if no validator was specified
References org.exolab.castor.util.Configuration.getDefault().
Referenced by org.exolab.castor.util.Configuration.getRegExpEvaluator().
static DocumentHandler org.exolab.castor.util.Configuration.getDefaultSerializer | ( | Writer | output | ) | throws IOException [static] |
Returns a default serializer for producing an XML document to the designated output stream using the default serialization format.
output | the Writer to write data to. |
References org.exolab.castor.util.Configuration.getDefaultSerializer().
static Serializer org.exolab.castor.util.Configuration.getDefaultSerializer | ( | ) | [static] |
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.
References org.exolab.castor.util.Configuration.getDefault(), and org.exolab.castor.util.Configuration.getDefaultOutputFormat().
Referenced by org.exolab.castor.util.Configuration.getDefaultSerializer().
static DocumentHandler org.exolab.castor.util.Configuration.getDefaultSerializer | ( | OutputStream | output | ) | throws IOException [static] |
Returns a default serializer for producing an XML document to the designated output stream using the default serialization format.
output | the output stream |
References org.exolab.castor.util.Configuration.getDefaultSerializer().
static boolean org.exolab.castor.util.Configuration.getDefaultStrictElements | ( | ) | [static] |
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
References org.exolab.castor.util.Configuration.getDefault().
Referenced by org.exolab.castor.util.Configuration.strictElements().
static XMLNaming org.exolab.castor.util.Configuration.getDefaultXMLNaming | ( | ) | [static] |
Returns the default naming conventions to use for the XML framework
References org.exolab.castor.util.Configuration.getDefaultProperty(), and org.exolab.castor.xml.util.DefaultNaming.setStyle().
Referenced by org.exolab.castor.util.Configuration.getXMLNaming().
static XMLReader org.exolab.castor.util.Configuration.getDefaultXMLReader | ( | ) | [static] |
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.
Referenced by org.exolab.castor.util.Configuration.getXMLReader().
static XMLReader org.exolab.castor.util.Configuration.getDefaultXMLReader | ( | String | features | ) | [static] |
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.
features | The requested feature list, null for the defaults |
References org.exolab.castor.util.Configuration.getDefault().
abstract OutputFormat org.exolab.castor.util.Configuration.getOutputFormat | ( | ) | [pure virtual] |
Returns the currently configured OutputFormat for use with a Serializer.
Design note: This method should be overloaded by any sub-classes.
Implemented in org.exolab.castor.util.LocalConfiguration.
Referenced by org.exolab.castor.xml.Marshaller.setDoctype(), org.exolab.castor.xml.Marshaller.setEncoding(), and org.exolab.castor.xml.Marshaller.setMarshalAsDocument().
Parser org.exolab.castor.util.Configuration.getParser | ( | ) |
Return an XML parser implementing the feature list specified in the configuration file.
Design note: This method should be overloaded by any sub-classes.
Reimplemented in org.exolab.castor.util.LocalConfiguration.
References org.exolab.castor.util.Configuration.getDefaultParser().
Referenced by org.exolab.castor.xml.schema.util.XMLInstance2Schema.createSchema(), org.exolab.castor.builder.SourceGenerator.generateSource(), org.exolab.castor.xml.schema.reader.ImportUnmarshaller.ImportUnmarshaller(), org.exolab.castor.xml.schema.reader.IncludeUnmarshaller.IncludeUnmarshaller(), org.exolab.castor.xml.schema.reader.RedefineUnmarshaller.RedefineUnmarshaller(), and org.exolab.castor.xml.Unmarshaller.unmarshal().
NodeType org.exolab.castor.util.Configuration.getPrimitiveNodeType | ( | ) |
Returns the currently configured NodeType to use for Java primitives. A null value will be returned if no NodeType was specified, indicating the default NodeType should be used.
Design note: This method should be overloaded by any sub-classes.
Reimplemented in org.exolab.castor.util.LocalConfiguration.
References org.exolab.castor.util.Configuration.getDefaultPrimitiveNodeType().
Properties org.exolab.castor.util.Configuration.getProperties | ( | ) |
Returns the current properties from the configuration file(s). The Properties returned may be empty, but never null.
Design note: This method should be overloaded by any sub-classes.
Reimplemented in org.exolab.castor.util.LocalConfiguration.
References org.exolab.castor.util.Configuration.getDefault().
Referenced by org.exolab.castor.util.Configuration.getProperty().
String org.exolab.castor.util.Configuration.getProperty | ( | String | name, | |
String | defValue | |||
) |
Returns a property from the current configuration. Equivalent to calling getProperty
on the result of getDefault.
name | The property name | |
defValue | The property's default value |
References org.exolab.castor.util.Configuration.getProperties().
Referenced by org.exolab.castor.util.LocalConfiguration.getPrimitiveNodeType(), org.exolab.castor.util.LocalConfiguration.getXMLNaming(), and org.exolab.castor.builder.BuilderConfiguration.load().
RegExpEvaluator org.exolab.castor.util.Configuration.getRegExpEvaluator | ( | ) |
Returns a new instance of the specified Regular Expression Evaluator, or null if no validator was specified
Reimplemented in org.exolab.castor.util.LocalConfiguration.
References org.exolab.castor.util.Configuration.getDefaultRegExpEvaluator().
abstract DocumentHandler org.exolab.castor.util.Configuration.getSerializer | ( | OutputStream | output | ) | throws IOException [pure virtual] |
Returns a serializer for producing an XML document to the designated output stream using the default serialization format.
Design note: This method should be overloaded by any sub-classes.
output | the output stream |
Implemented in org.exolab.castor.util.LocalConfiguration.
abstract Serializer org.exolab.castor.util.Configuration.getSerializer | ( | ) | [pure virtual] |
Returns a serializer for producing an XML instance document. The caller can specify an alternative output format, may reuse this serializer across several streams, and may serialize both DOM and SAX events.
Design note: This method should be overloaded by any sub-classes.
Implemented in org.exolab.castor.util.LocalConfiguration.
Referenced by org.exolab.castor.xml.Marshaller.Marshaller().
abstract DocumentHandler org.exolab.castor.util.Configuration.getSerializer | ( | Writer | output | ) | throws IOException [pure virtual] |
Returns a serializer for producing an XML instance document to the designated output stream using the default serialization format.
Design note: This method should be overloaded by any sub-classes.
output | the Writer to write data to. |
Implemented in org.exolab.castor.util.LocalConfiguration.
XMLNaming org.exolab.castor.util.Configuration.getXMLNaming | ( | ) |
Returns the currently configured naming conventions to use for the XML framework
Design note: This method should be overloaded by any sub-classes.
Reimplemented in org.exolab.castor.util.LocalConfiguration.
References org.exolab.castor.util.Configuration.getDefaultXMLNaming().
Referenced by org.exolab.castor.xml.XMLNaming.getInstance().
XMLReader org.exolab.castor.util.Configuration.getXMLReader | ( | ) |
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.
Reimplemented in org.exolab.castor.util.LocalConfiguration.
References org.exolab.castor.util.Configuration.getDefaultXMLReader().
Referenced by org.exolab.castor.xml.Unmarshaller.unmarshal().
static void org.exolab.castor.util.Configuration.loadDefaults | ( | ) | [static, protected] |
Called by getDefault to load the configuration the first time. 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.
References org.exolab.castor.util.Configuration.loadProperties().
Referenced by org.exolab.castor.util.Configuration.getDefault().
static Properties org.exolab.castor.util.Configuration.loadProperties | ( | String | resourceName, | |
String | fileName | |||
) | [static] |
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.
Referenced by org.exolab.castor.util.Configuration.loadDefaults().
boolean org.exolab.castor.util.Configuration.marshallingValidation | ( | ) |
Returns true if the current configuration (user-supplied or default) specifies validation in the marshalling framework.
Design note: This method should be overloaded by any sub-classes.
Reimplemented in org.exolab.castor.util.LocalConfiguration.
References org.exolab.castor.util.Configuration.getDefaultMarshallingValidation().
boolean org.exolab.castor.util.Configuration.strictElements | ( | ) |
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.
Design note: This method should be overloaded by any sub-classes.
Reimplemented in org.exolab.castor.util.LocalConfiguration.
References org.exolab.castor.util.Configuration.getDefaultStrictElements().
final String org.exolab.castor.util.Configuration.ON_VALUE = "on" [static, package] |
final String org.exolab.castor.util.Configuration.TRUE_VALUE = "true" [static, package] |