public class BuilderConfiguration
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
BuilderConfiguration.Property
Names of properties used in the configuration file.
|
| Constructor and Description |
|---|
BuilderConfiguration()
Creates a default BuilderConfiguration.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
boundPropertiesEnabled()
Returns true if bound properties are enabled.
|
boolean |
classDescFieldNames()
Returns true if we generate a 'public static final String' for the name
of each attribute and element described by the class descriptor
|
boolean |
equalsMethod()
Returns true if we generate an 'equals' method for each generated class.
|
boolean |
generateExtraCollectionMethods()
Returns true if extra methods for collection fields should be generated.
|
java.util.Properties |
getDefault()
Returns the default configuration file.
|
java.lang.String |
getProperty(java.lang.String name,
java.lang.String defValue)
Returns a property from the default configuration file.
|
protected void |
load()
Called by
getDefault() to load the configuration the first time. |
java.lang.String |
lookupPackageByLocation(java.lang.String schemaLocation)
Converts a schema location into a Java package.
|
java.lang.String |
lookupPackageByNamespace(java.lang.String nsURL)
Gets a Java package to an XML namespace URL
|
boolean |
mappingSchemaElement2Java()
Tests the org.exolab.castor.builder.javaclassmapping property for the
'element' value.
|
boolean |
mappingSchemaType2Java()
Tests the org.exolab.castor.builder.javaclassmapping property for the 'type' value.
|
protected void |
processNamespacePackageMappings(java.lang.String mappings)
processes the given String which contains namespace-to-package mappings
|
void |
setClassDescFieldNames(boolean classDescFieldNames)
Sets the 'classDescFieldNames' property
|
void |
setDefaultProperties(java.util.Properties properties)
Overrides the current set of properties with the given properties.
|
void |
setEqualsMethod(boolean equals)
Sets the 'equalsmethod' property.
|
void |
setLocationPackageMapping(java.lang.String schemaLocation,
java.lang.String packageName)
Sets the schemaLocation to package mapping.
|
void |
setNamespacePackageMapping(java.lang.String ns,
java.lang.String packageName)
Sets the namespace to package mapping.
|
void |
setPrimitiveWrapper(boolean wrapper)
Sets the 'primitivetowrapper' property
|
void |
setUseEnumeratedTypeInterface(boolean flag)
Sets the 'enumTypeAccessInterface' property
|
boolean |
useEnumeratedTypeInterface()
Returns true if we generate the implements EnumeratedTypeAccess interface
for enumerated type classes.
|
boolean |
useJava50()
Returns true if we generate the implements EnumeratedTypeAccess interface
for enumerated type classes.
|
boolean |
usePrimitiveWrapper()
Returns true if primitive types have to be used as Objects (eg.
|
public BuilderConfiguration()
public java.util.Properties getDefault()
public java.lang.String getProperty(java.lang.String name,
java.lang.String defValue)
getDefault().name - The property namedefValue - The property's default valuepublic boolean boundPropertiesEnabled()
Enabling bound properties is controlled via the org.exolab.castor.builder.boundproperties item in the castorbuilder.properties file. The value is either 'true' or 'false'.
public boolean equalsMethod()
Enabling this property is controlled via the org.exolab.castor.builder.equalsmethod item in the castorbuilder.properties file. The value is either 'true' or 'false'.
public void setEqualsMethod(boolean equals)
equals - The value we want to use.public boolean classDescFieldNames()
Enabling this property is controlled via the org.exolab.castor.builder.classdescfieldnames item in the castorbuilder.properties file. The value is either 'true' or 'false'.
public boolean generateExtraCollectionMethods()
Enabling extra collection methods is controlled via the org.exolab.castor.builder.extraCollectionMethods property in the castorbuilder.properties file. The value is either 'true' or 'false'.
public void setClassDescFieldNames(boolean classDescFieldNames)
classDescFieldNames - the value we want to uespublic boolean usePrimitiveWrapper()
public void setPrimitiveWrapper(boolean wrapper)
wrapper - the value we want to use.public boolean useEnumeratedTypeInterface()
public boolean useJava50()
public void setUseEnumeratedTypeInterface(boolean flag)
flag - the value we want to usepublic boolean mappingSchemaElement2Java()
public boolean mappingSchemaType2Java()
public void setDefaultProperties(java.util.Properties properties)
properties - the Properties filepublic void setNamespacePackageMapping(java.lang.String ns,
java.lang.String packageName)
ns - the namespace URI to mappackageName - the package namepublic void setLocationPackageMapping(java.lang.String schemaLocation,
java.lang.String packageName)
schemaLocation - the schemaLocation to mappackageName - the package name to map toprotected void load()
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.public java.lang.String lookupPackageByNamespace(java.lang.String nsURL)
nsURL - the XML namespace URL to convert into a Java package namepublic java.lang.String lookupPackageByLocation(java.lang.String schemaLocation)
schemaLocation - the Schema location to use to look up the Java packageprotected void processNamespacePackageMappings(java.lang.String mappings)
mappings - the namespace-to-package mappingsIntalio Inc. (C) 1999-2006. All rights reserved http://www.intalio.com