Used to configure Compass instances.
An instance of it allows the application to specify settings and mapping
files to be used when creating Compass.
There are several options to configure a Compass instance,
programmatically using the CompassConfiguration class, using
the xml configuration file (compass.cfg.xml), or a combination of both.
Usually the application will create a single
CompassConfiguration, use it to configure and than build a
Compass instance, and than instantiate
CompassSessions in threads servicing client requests.
The CompassConfiguration is meant only as an
initialization-time object. Compass is immutable and do not
affect the CompassConfiguration that created it.
author: kimchy See Also:org.compass.core.Compass
Read a mapping from an application resource, using a convention. The
class foo.bar.Foo is mapped by the file
foo/bar/Foo.cpm.xml (in the case of Xml binding).
Parameters: searchableClass - the mapped class
Read all mapping and meta-data documents from a directory tree. Assume
that any file named *.cpm.xml or *.cmd.xml
is a mapping document.
Parameters: dir - a directory
Uses a class that implements the
InputStreamMappingResolver for auto
generation of mapping definitions.
Parameters: mappingResolver - The mapping resolver
Read mappings from an application resource trying different classloaders.
This method will try to load the resource first from the thread context
classloader and then from the classloader that loaded Compass.
Parameters: path - The path of the resource
Build compass with the configurations set. Creates a copy of all the
current settings and mappings, configures a
Compass instance and
starts it.
Note that the CompassConfiguration class can be used to
create more Compass objects after the method has been called.
the Compass
Use the mappings and properties specified in the given application
resource.
Parameters: resource - The compass configuration resource path CompassConfiguration for method chaining
Use the mappings and properties specified in the given document.
Parameters: url - URL from which you wish to load the configuration A configuration configured via the file throws: ConfigurationException -
Use the mappings and properties specified in the given application file.
Parameters: configFile - File from which you wish to load theconfiguration A configuration configured via the file throws: ConfigurationException -
Returns the class loader that will be used to load classes and resources. If directly
set, will return it. If not, will return the therad local context class loader.
Registers a
Converter under the given name. The name can then be used in the mapping
definitions as a logical name to the converter.
Parameters: converterName - the converter name the converter will be registered under Parameters: converter - The converter to use The configuration
Sets a specific setting in the compass configuration settings.
Parameters: setting - The setting name Parameters: value - The setting value CompassConfiguration for method chaining
Tries to add a class and returns a boolean indicator if it was added or not.
Parameters: searchableClass - The searchable class to add true if the class was added, false otherwise throws: ConfigurationException -