public class BuilderConfiguration extends 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 |
|---|---|
void |
addAnnotationBuilder(AnnotationBuilder annotationBuilder)
adds a custom annotation builder.
|
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.
|
void |
forceUseJava50()
Add support to set java version programmatically.
|
boolean |
generateExtraCollectionMethods()
Returns true if extra methods for collection fields should be generated.
|
boolean |
generateExtraDocumentationMethods()
Returns true if extra methods for accessing XML schema documentation should be generated;
default to 'false'.
|
AnnotationBuilder[] |
getAnnotationBuilders()
returns all applied annotation builders.
|
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.
|
Properties |
getDefault()
Returns the default configuration file.
|
JavaNaming |
getJavaNaming()
To get the
JavaNaming implementation to be used. |
String |
getJClassPrinterFactories()
Returns a String representing the list of
JClassPrinterFactory instances configured in
the Castor XML code generator property file. |
int |
getMaximumNumberOfConstants()
Returns the maximum number of static constant definitions that are acceptable within one class
file; default is 1000.
|
String |
getProperty(String name,
String defValue)
Returns a property from the default configuration file.
|
boolean |
isAutomaticConflictResolution()
indicates whether automatic class name conflict resolution during XML code generation should
take place or not.
|
protected void |
load()
Called by
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.
|
String |
lookupPackageByLocation(String schemaLocation)
Converts a schema location into a Java package.
|
String |
lookupPackageByNamespace(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(String mappings)
processes the given String which contains namespace-to-package mappings.
|
void |
setClassDescFieldNames(boolean classDescFieldNames)
Sets the 'classDescFieldNames' property.
|
void |
setDefaultProperties(Properties properties)
Overrides the current set of properties with the given properties.
|
void |
setEqualsMethod(boolean equals)
Sets the 'equalsmethod' property.
|
void |
setJavaNaming(JavaNaming javaNaming)
To set the
JavaNaming implementation to be used. |
void |
setLocationPackageMapping(String schemaLocation,
String packageName)
Sets the schemaLocation to package mapping.
|
void |
setNamespacePackageMapping(String ns,
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 |
useCycleBreaker()
Returns true if the class
CycleBreaker should be used during code generation; defaults
to 'true'. |
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 |
useJava5Enums()
Indicates what kind of enumeration should be created for <xs:simpleType> enumerations.
|
boolean |
useOldFieldNaming() |
boolean |
usePrimitiveWrapper()
Returns true if primitive types have to be used as Objects (eg.
|
public BuilderConfiguration()
public final Properties getDefault()
public final String getProperty(String name, String defValue)
getDefault().name - The property namedefValue - The property's default valuepublic final 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 final 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 final void setEqualsMethod(boolean equals)
equals - The value we want to use.public final 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 final 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 final void setClassDescFieldNames(boolean classDescFieldNames)
classDescFieldNames - the value we want to uespublic final boolean usePrimitiveWrapper()
float by
java.lang.Float).public final void setPrimitiveWrapper(boolean wrapper)
wrapper - the value we want to use.public final boolean useEnumeratedTypeInterface()
public final boolean useJava50()
public final boolean useJava5Enums()
public final void forceUseJava50()
public final boolean generateExtraDocumentationMethods()
public final boolean useCycleBreaker()
CycleBreaker should be used during code generation; defaults
to 'true'.CycleBreaker should be used during code generationpublic final int getMaximumNumberOfConstants()
public final void setUseEnumeratedTypeInterface(boolean flag)
flag - the value we want to usepublic boolean mappingSchemaElement2Java()
public boolean mappingSchemaType2Java()
public final void setDefaultProperties(Properties properties)
properties - the Properties filepublic final void setNamespacePackageMapping(String ns, String packageName)
ns - the namespace URI to mappackageName - the package namepublic final void setLocationPackageMapping(String schemaLocation, String packageName)
schemaLocation - the schemaLocation to mappackageName - the package name to map topublic final String getJClassPrinterFactories()
JClassPrinterFactory instances configured in
the Castor XML code generator property file.JClassPrinterFactory instances as configured, as string.protected final 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 final String lookupPackageByNamespace(String nsURL)
nsURL - the XML namespace URL to convert into a Java package namepublic final String lookupPackageByLocation(String schemaLocation)
schemaLocation - the Schema location to use to look up the Java packageprotected final void processNamespacePackageMappings(String mappings)
mappings - the namespace-to-package mappingspublic boolean isAutomaticConflictResolution()
public String getAutomaticConflictResolutionTypeSuffix()
public void setJavaNaming(JavaNaming javaNaming)
JavaNaming implementation to be used.javaNaming - JavaNaming implementation to be usedpublic JavaNaming getJavaNaming()
JavaNaming implementation to be used.public void addAnnotationBuilder(AnnotationBuilder annotationBuilder)
annotationBuilder - the builderpublic AnnotationBuilder[] getAnnotationBuilders()
public static Properties loadProperties(String resourceName, String fileName)
resourceName - Name of the source.fileName - Name of the configuration file.Properties instance holding the actual XML code generator configuration.public boolean useOldFieldNaming()
Copyright © 2016. All rights reserved.