Classes | Public Member Functions | Protected Member Functions

org.exolab.castor.builder.BuilderConfiguration Class Reference

Inheritance diagram for org.exolab.castor.builder.BuilderConfiguration:
org.exolab.castor.builder.SourceGenerator

List of all members.

Classes

class  Property

Public Member Functions

 BuilderConfiguration ()
synchronized Properties getDefault ()
String getProperty (String name, String defValue)
boolean boundPropertiesEnabled ()
boolean equalsMethod ()
void setEqualsMethod (boolean equals)
boolean classDescFieldNames ()
boolean generateExtraCollectionMethods ()
void setClassDescFieldNames (boolean classDescFieldNames)
boolean usePrimitiveWrapper ()
void setPrimitiveWrapper (boolean wrapper)
boolean useEnumeratedTypeInterface ()
void setUseEnumeratedTypeInterface (boolean flag)
boolean mappingSchemaElement2Java ()
boolean mappingSchemaType2Java ()
void setDefaultProperties (Properties properties)
void setNamespacePackageMapping (String ns, String packageName)
void setLocationPackageMapping (String schemaLocation, String packageName)
String lookupPackageByNamespace (String nsURL)
String lookupPackageByLocation (String schemaLocation)

Protected Member Functions

synchronized void load ()
void processNamespacePackageMappings (String mappings)

Detailed Description

The configuration for the SourceGenerator

Author:
Keith Visco
Arnaud Blandin
Version:
Revision:
1.5
Date:
2004/11/11 16:30:54

Constructor & Destructor Documentation

org.exolab.castor.builder.BuilderConfiguration.BuilderConfiguration (  ) 

Member Function Documentation

boolean org.exolab.castor.builder.BuilderConfiguration.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'.

Returns:
true if bound properties are enabled.

Referenced by org.exolab.castor.builder.FactoryState.FactoryState(), org.exolab.castor.builder.binding.XMLBindingComponent.hasBoundProperties(), and org.exolab.castor.builder.MemberFactory.MemberFactory().

boolean org.exolab.castor.builder.BuilderConfiguration.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'.

Returns:
true if bound properties are enabled.
boolean org.exolab.castor.builder.BuilderConfiguration.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'.

Returns:
true if bound properties are enabled.

Referenced by org.exolab.castor.builder.binding.XMLBindingComponent.hasEquals().

boolean org.exolab.castor.builder.BuilderConfiguration.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'.

Returns:
true if extra collection methods are enabled.

Referenced by org.exolab.castor.builder.MemberFactory.MemberFactory().

synchronized Properties org.exolab.castor.builder.BuilderConfiguration.getDefault (  ) 

Returns the default configuration file. Changes to the returned properties set will affect all Castor functions relying on the default configuration.

Returns:
The default configuration

References org.exolab.castor.builder.BuilderConfiguration.load().

Referenced by org.exolab.castor.builder.BuilderConfiguration.BuilderConfiguration().

String org.exolab.castor.builder.BuilderConfiguration.getProperty ( String  name,
String  defValue 
)

Returns a property from the default configuration file. Equivalent to calling getProperty on the result of getDefault.

Parameters:
name The property name
default The property's default value
Returns:
The property's value

Referenced by org.exolab.castor.builder.binding.XMLBindingComponent.getExtends(), and org.exolab.castor.builder.MemberFactory.MemberFactory().

synchronized void org.exolab.castor.builder.BuilderConfiguration.load (  )  [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.getProperty(), and org.exolab.castor.builder.BuilderConfiguration.processNamespacePackageMappings().

Referenced by org.exolab.castor.builder.BuilderConfiguration.getDefault(), and org.exolab.castor.builder.SourceGenerator.SourceGenerator().

String org.exolab.castor.builder.BuilderConfiguration.lookupPackageByLocation ( String  schemaLocation  ) 

Gets a Java package to a schema location.

Referenced by org.exolab.castor.builder.binding.XMLBindingComponent.getJavaPackage().

String org.exolab.castor.builder.BuilderConfiguration.lookupPackageByNamespace ( String  nsURL  ) 
boolean org.exolab.castor.builder.BuilderConfiguration.mappingSchemaElement2Java (  ) 

Tests the org.exolab.castor.builder.javaclassmapping property for the 'element' value.

Returns:
True if the Source Generator is mapping schema elements to Java classes.

Reimplemented in org.exolab.castor.builder.SourceGenerator.

Referenced by org.exolab.castor.builder.binding.XMLBindingComponent.isAbstract().

boolean org.exolab.castor.builder.BuilderConfiguration.mappingSchemaType2Java (  ) 

Tests the org.exolab.castor.builder.javaclassmapping property for the 'type' value.

Returns:
True if the Source Generator is mapping schema types to Java classes.

Reimplemented in org.exolab.castor.builder.SourceGenerator.

Referenced by org.exolab.castor.builder.MemberFactory.createFieldInfo().

void org.exolab.castor.builder.BuilderConfiguration.processNamespacePackageMappings ( String  mappings  )  [protected]

processes the given String which contains namespace-to-package mappings

Parameters:
mappings the namespace-to-package mappings

Referenced by org.exolab.castor.builder.BuilderConfiguration.load(), and org.exolab.castor.builder.BuilderConfiguration.setDefaultProperties().

void org.exolab.castor.builder.BuilderConfiguration.setClassDescFieldNames ( boolean  classDescFieldNames  ) 

Sets the 'classDescFieldNames' property

Parameters:
boolean the value we want to ues

Referenced by alma.tools.entitybuilder.CastorBuilder.run().

void org.exolab.castor.builder.BuilderConfiguration.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.

Parameters:
properties the Properties file

References org.exolab.castor.builder.BuilderConfiguration.processNamespacePackageMappings().

void org.exolab.castor.builder.BuilderConfiguration.setEqualsMethod ( boolean  equals  ) 

Sets the 'equalsmethod' property

Parameters:
boolean the value we want to use

Referenced by alma.tools.entitybuilder.CastorBuilder.run().

void org.exolab.castor.builder.BuilderConfiguration.setLocationPackageMapping ( String  schemaLocation,
String  packageName 
)

Sets the schemaLocation to package mapping

Parameters:
schemaLocation the schemaLocation to map
packageName the package name to map to

Referenced by org.exolab.castor.builder.SourceGenerator.generateSource(), and alma.tools.entitybuilder.CastorBuilder.run().

void org.exolab.castor.builder.BuilderConfiguration.setNamespacePackageMapping ( String  ns,
String  packageName 
)

Sets the namespace to package mapping

Parameters:
ns the namespace URI to map
packageName the package name

Referenced by alma.tools.entitybuilder.CastorBuilder.run().

void org.exolab.castor.builder.BuilderConfiguration.setPrimitiveWrapper ( boolean  wrapper  ) 

Sets the 'primitivetowrapper' property

Parameters:
boolean the value we want to use.

Referenced by alma.tools.entitybuilder.CastorBuilder.run().

void org.exolab.castor.builder.BuilderConfiguration.setUseEnumeratedTypeInterface ( boolean  flag  ) 

Sets the 'enumTypeAccessInterface' property

Parameters:
boolean the value we want to use
boolean org.exolab.castor.builder.BuilderConfiguration.useEnumeratedTypeInterface (  ) 

Returns true if we generate the implements EnumeratedTypeAccess interface for enumerated type classes. The value is either 'true' or 'false'

Returns:
true if use enumerated type interface is enabled
boolean org.exolab.castor.builder.BuilderConfiguration.usePrimitiveWrapper (  ) 

Returns true if primitive types have to be used as Objects (eg. replacing float by java.lang.Float).

Referenced by org.exolab.castor.builder.TypeConversion.convertType(), and org.exolab.castor.builder.binding.XMLBindingComponent.useWrapper().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties