The configuration for the SourceGenerator.
addAnnotationBuilder
public void addAnnotationBuilder(AnnotationBuilder annotationBuilder)
adds a custom annotation builder.
annotationBuilder
- the builder
boundPropertiesEnabled
public final boolean boundPropertiesEnabled()
Returns true if bound properties are enabled.
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'.
- true if bound properties are enabled.
classDescFieldNames
public final 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
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'.
- true if bound properties are enabled.
equalsMethod
public final boolean equalsMethod()
Returns true if we generate an 'equals' method for each generated class.
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'.
- true if bound properties are enabled.
forceUseJava50
public final void forceUseJava50()
Add support to set java version programmatically.
generateExtraCollectionMethods
public final boolean generateExtraCollectionMethods()
Returns true if extra methods for collection fields should be generated.
Such methods include set/get methods for the actual collection in
addition to the array methods.
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'.
- true if extra collection methods are enabled.
generateExtraDocumentationMethods
public final boolean generateExtraDocumentationMethods()
Returns true if extra methods for accessing XML schema documentation should
be generated; default to 'false'.
- true if if extra methods for accessing XML schema documentation should be generated
getAnnotationBuilders
public AnnotationBuilder[] getAnnotationBuilders()
returns all applied annotation builders.
- a array of builders for type convenience
getAutomaticConflictResolutionTypeSuffix
public String getAutomaticConflictResolutionTypeSuffix()
Returns the type 'suffix' used for the type strategy during automatic class name
conflict resolution during XML code generation; default to "" unless a value is specified.
- The type suffix to be inserted between element name and type name
getDefault
public final Properties getDefault()
Returns the default configuration file. Changes to the returned
properties set will affect all Castor functions relying on the default
configuration.
- The default configuration
getJClassPrinterTypes
public final String getJClassPrinterTypes()
Returns the string identifier of the jClassPrinter to use.
- The string identifier of the jClassPrinter to use.
getJavaNaming
public JavaNaming getJavaNaming()
- JavaNaming implementation to be used
getMaximumNumberOfConstants
public final int getMaximumNumberOfConstants()
Returns the maximum number of static constant definitions that are
acceptable within one class file; default is 1000.
- the maximum number of static constant definitions acceptable within
one class file
getProperty
public final String getProperty(String name,
String defValue)
Returns a property from the default configuration file. Equivalent to
calling
getProperty on the result of
getDefault()
.
name
- The property namedefValue
- The property's default value
isAutomaticConflictResolution
public boolean isAutomaticConflictResolution()
indicates whether automatic class name conflict resolution during
XML code generation should take place or not.
- True if automatic mode should be used.
load
protected final void load()
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.
loadProperties
public 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.
lookupPackageByLocation
public final String lookupPackageByLocation(String schemaLocation)
Converts a schema location into a Java package.
schemaLocation
- the Schema location to use to look up the Java package
lookupPackageByNamespace
public final String lookupPackageByNamespace(String nsURL)
Gets a Java package to an XML namespace URL.
nsURL
- the XML namespace URL to convert into a Java package name
mappingSchemaElement2Java
public boolean mappingSchemaElement2Java()
Tests the org.exolab.castor.builder.javaclassmapping property for the
'element' value.
- True if the Source Generator is mapping schema elements to Java
classes.
mappingSchemaType2Java
public boolean mappingSchemaType2Java()
Tests the org.exolab.castor.builder.javaclassmapping property for the 'type' value.
- True if the Source Generator is mapping schema types to Java classes.
processNamespacePackageMappings
protected final void processNamespacePackageMappings(String mappings)
processes the given String which contains namespace-to-package mappings.
mappings
- the namespace-to-package mappings
setClassDescFieldNames
public final void setClassDescFieldNames(boolean classDescFieldNames)
Sets the 'classDescFieldNames' property.
classDescFieldNames
- the value we want to ues
setDefaultProperties
public final void setDefaultProperties(Properties properties)
Overrides the current set of properties with the given properties. Once
the properties are set, only a copy will be uses, so any changes to the
given properties file after the fact will go unnoticed.
properties
- the Properties file
setEqualsMethod
public final void setEqualsMethod(boolean equals)
Sets the 'equalsmethod' property.
equals
- The value we want to use.
setJavaNaming
public void setJavaNaming(JavaNaming javaNaming)
javaNaming
- JavaNaming implementation to be used
setLocationPackageMapping
public final void setLocationPackageMapping(String schemaLocation,
String packageName)
Sets the schemaLocation to package mapping.
schemaLocation
- the schemaLocation to mappackageName
- the package name to map to
setNamespacePackageMapping
public final void setNamespacePackageMapping(String ns,
String packageName)
Sets the namespace to package mapping.
ns
- the namespace URI to mappackageName
- the package name
setPrimitiveWrapper
public final void setPrimitiveWrapper(boolean wrapper)
Sets the 'primitivetowrapper' property.
wrapper
- the value we want to use.
setUseEnumeratedTypeInterface
public final void setUseEnumeratedTypeInterface(boolean flag)
Sets the 'enumTypeAccessInterface' property.
flag
- the value we want to use
useEnumeratedTypeInterface
public final boolean useEnumeratedTypeInterface()
Returns true if we generate the implements EnumeratedTypeAccess interface
for enumerated type classes. The value is either 'true' or 'false'
- true if use enumerated type interface is enabled
useJava50
public final boolean useJava50()
Returns true if we generate the implements EnumeratedTypeAccess interface
for enumerated type classes. The value is either 'true' or 'false'
- true if use enumerated type interface is enabled
useJava5Enums
public final boolean useJava5Enums()
Indicates what kind of enumeration should be created for
<xs:simpleType> enumerations.
- true if Java 5 source code should be generated.
usePrimitiveWrapper
public final boolean usePrimitiveWrapper()
Returns true if primitive types have to be used as Objects (eg.
replacing float
by java.lang.Float
).
- true if primitive types have to be used as Objects.