![]() | ![]() | ![]() | ![]() | ![]() | ![]() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() | ![]() | ![]() | ![]() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() | ![]()
|
Castor XML - Code generator properties
Documentation Author(s): Overview Customization - Lookup mechanism Detailed descriptions Source generation & Java 5.0 Bound Properties Class Creation/Mapping Setting a super class Mapping XML namespaces to Java packages Generate equals() method Maps java primitive types to wrapper object Automatic class name conflict resolution Extra collection methods OverviewPlease find below a list of properties that can be configured through the builder configuration properties, as defined in either the default or a custom XML code generator configuration file. These properties allow you to control various advanced options of the XML source generator.
Customization - Lookup mechanismBy default, the Castor XML code generator will look for such a property file in the following places:
Detailed descriptionsSource generation & Java 5.0As of Castor 1.0.2, the Castor source generator now supports the
generation of Java 5.0 compliant code. The generated code - with the
new feature enabled - will make use of the following Java 5.0-specific
artifacts:
To enable this feature (off by default), please uncomment the following property in your custom castorbuilder.properties file:
Bound PropertiesBound properties are "properties" of a class, which when
updated the class will send out a To enable bound properties, please add the following property definition to your custom builder configuration file:
When enabled, all properties will be treated as bound properties. For each class that is generated a setPropertyChangeListener method is created as follows:
Whenever a property of the class is changed, a
Class Creation/MappingThe source generator can treat the XML Schema structures such as <complexType> and element in two main ways. The first, and current default method is called the "element" method. The other is called the "type" method.
To change the "method" of class creation, please add the following property definition to your custom builder configuration file:
Setting a super classThe source generator enables the user to set a super class to all the generated classes (of course, class descriptors are not affected by this option). Pleae note that, though the binding file, it is possible to define a super class for individual classes To set the global super class, please add the following property definition to your custom builder configuration file:
Mapping XML namespaces to Java packagesAn XML Schema instance is identified by a namespace. For data-binding purposes, especially code generation it may be necessary to map namespaces to Java packages. This is needed for imported schema in order for Castor to generate the correct imports during code generation for the primary schema. To allow the mapping between namespaces and Java packages , edit the castorbuilder.properties file :
Generate equals() methodSince version: 0.9.1 The Source Generator can override the 'equals()' method for the generated objects. Note: hashcode() is not currently overriden. To generate the equals() method , edit the castorbuilder.properties file :
Maps java primitive types to wrapper objectSince version 0.9.4
It may be convenient to use java objects instead of primitives,
the Source Generator provides a way to do it. Thus the following mapping can be used:
To enable this property, edit the castor builder.properties file:
Automatic class name conflict resolutionSince version 1.1.1 With this property enabled, the XML code generator will use a new automatic class name resolution mode that has special logic implemented to automatically resolve class name conflicts. This new mode deals with various class name conflicts where previously a binding file had to be used to resolve these conflicts manually. To enable this feature (turned off by default), please add the following property definitio to your custom castorbuilder.properties file:
Extra collection methodsSpecifies whether extra (additional) methods should be created for collection-style fields. Set this to true if you want your code to be more compatible with Castor JDO (or other persistence frameworks). Adds additional getter/setter methods for the field in question, such as get/set by reference and set as copy methods. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() ![]() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() | ![]() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() | ![]() | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |