org.jbind.xml.base
Interface IBindingAttributes


public interface IBindingAttributes

Attributes in the jbind namespace that can be occur in a schema document in order to control the code generation.

Many of the attributes influence the generation of methods. Some of them are GETTER, SETTER, and CREATOR. These attributes can take one the values:

  1. "none": No method is generated
  2. "normal": A method of the form "getProperty", "setProperty", "createProperty", ... is generated.
  3. "hook": In the data interface methods are generated as if it was a normal method. In the data class hook methods of the form "doGetProperty", "doSetProperty", "doCreateProperty", ... are generated that do exactly the same thing as the normal methods would do. However, by implementing them as hook methods corresponding normal methods must be implemented in the behaviour class.
These attributes are called the method variant attributes. They can appear at all elements in a schema document. If the method variant for an attribute or an element declaration is searched then the attribute can be specified directly at the declaration element or at one of its enclosing elements.


Field Summary
static java.lang.String ATTR_GROUP_SUB_PACKAGE
           
static java.lang.String ATTRIBUTE_NAME_SUFFIX_FOR_NAME_PREFIX
           
static java.lang.String ATTRIBUTE_NAME_SUFFIX_FOR_NAME_SUFFIX
           
static java.lang.String ATTRIBUTE_SUB_PACKAGE
           
static java.lang.String CHECKER
          Property variant attribute that controls the generation of methods that check if an attribute or element is present.
static java.lang.String CREATOR
          Property variant attribute that controls the generation of creator methods for elements.
static java.lang.String CREATOR_WITH_TYPE
          Property variant attribute that controls the generation of creator methods for elements that allow to overload the type of the element.
static java.lang.String ELEM_GROUP_SUB_PACKAGE
           
static java.lang.String ELEMENT_SUB_PACKAGE
           
static java.lang.String FACTORY_TYPE
          The type of the schema factory.
static java.lang.String GETTER
          Property variant attribute that controls the generation of getter methods.
static java.lang.String HAS_BEHAVIOUR
          Determines if a "behaviour" class and interface is created for a type.
static java.lang.String ITERATOR
          Property variant attribute that controls the generation of methods that iterate elements or the items of list valued attributes.
static java.lang.String NAME
          Specifies a name that is used in the generated code ("name").
static java.lang.String PACKAGE
          Determines the root package for the generated types.
static java.lang.String REFERENCE_GETTER
           
static java.lang.String REFERENCE_ITERATOR
           
static java.lang.String REFERENCED_TYPE
           
static java.lang.String REMOVER
          Property variant attribute that controls the generation of methods that remove an attribute or element.
static java.lang.String SETTER
          Property variant attribute that controls the generation of setter methods.
static java.lang.String TYPE_SUB_PACKAGE
           
static java.lang.String USE_DATA_CLASS
          Determines if the value of an attribute or a non-complex element is accessed by its data class or by its simple storage type.
 

Field Detail

PACKAGE

public static final java.lang.String PACKAGE
Determines the root package for the generated types.

This attribute can appear in the schema elements and in import elements. If an import element specifies a package then this package overwrites the package specified in the imported schema.

See Also:
Constant Field Values

HAS_BEHAVIOUR

public static final java.lang.String HAS_BEHAVIOUR
Determines if a "behaviour" class and interface is created for a type.

This attribute can appear in schema elements and in type definition elements. Anonymous inner types never have behaviour classes and interfaces.

See Also:
Constant Field Values

GETTER

public static final java.lang.String GETTER
Property variant attribute that controls the generation of getter methods. The methods are of the form "getProperty". For a description of the possible values and appearances of the attribute see IBindingAttributes.

See Also:
Constant Field Values

SETTER

public static final java.lang.String SETTER
Property variant attribute that controls the generation of setter methods. The methods are of the form "setProperty". For a description of the possible values and appearances of the attribute see IBindingAttributes.

See Also:
Constant Field Values

CREATOR

public static final java.lang.String CREATOR
Property variant attribute that controls the generation of creator methods for elements. The methods are of the form "createProperty". For a description of the possible values and appearances of the attribute see IBindingAttributes.

See Also:
Constant Field Values

CREATOR_WITH_TYPE

public static final java.lang.String CREATOR_WITH_TYPE
Property variant attribute that controls the generation of creator methods for elements that allow to overload the type of the element. The methods are of the form "createProperty". For a description of the possible values and appearances of the attribute see IBindingAttributes.

See Also:
Constant Field Values

CHECKER

public static final java.lang.String CHECKER
Property variant attribute that controls the generation of methods that check if an attribute or element is present. The methods are of the form "hasProperty". For a description of the possible values and appearances of the attribute see IBindingAttributes.

See Also:
Constant Field Values

REMOVER

public static final java.lang.String REMOVER
Property variant attribute that controls the generation of methods that remove an attribute or element. The methods are of the form "removeProperty". For a description of the possible values and appearances of the attribute see IBindingAttributes.

If an attribute is removed that has a default or fixed value then a new attribute will be created (on demand).

Remover methods for elements are only generated if the element has a maximum number of occurences that is 0 or 1. Elements that can appear several times are removed by iterating them and using the remove method of the iterator.

See Also:
Constant Field Values

ITERATOR

public static final java.lang.String ITERATOR
Property variant attribute that controls the generation of methods that iterate elements or the items of list valued attributes. The methods are of the form "iterProperty". For a description of the possible values and appearances of the attribute see IBindingAttributes.

See Also:
Constant Field Values

USE_DATA_CLASS

public static final java.lang.String USE_DATA_CLASS
Determines if the value of an attribute or a non-complex element is accessed by its data class or by its simple storage type. Complex elements are always accessed by their data class. The simple storage type is either a primitive type or a (simple) reference type like a string.

This attribute can appear in attribute or element declarations.

See Also:
Constant Field Values

REFERENCE_GETTER

public static final java.lang.String REFERENCE_GETTER
See Also:
Constant Field Values

REFERENCE_ITERATOR

public static final java.lang.String REFERENCE_ITERATOR
See Also:
Constant Field Values

REFERENCED_TYPE

public static final java.lang.String REFERENCED_TYPE
See Also:
Constant Field Values

FACTORY_TYPE

public static final java.lang.String FACTORY_TYPE
The type of the schema factory. May occurs in the schema element. When present then a type with the specified name must be present in the schema. In general the factory type should be complex type with a content model that references all top level element declarations. This will cause newXXX methods to be created

An instance of the factory type is created after the schema was read in and is set as the factory of the schema (cf. setFactory). The factory can now be used to create new elements using its newXXX methods.

The factory has a special data implementation that does not store any references to the elements it has created.

See Also:
Constant Field Values

NAME

public static final java.lang.String NAME
Specifies a name that is used in the generated code ("name"). The name attribute can appear everywhere where the XML schema name attribute is also allowed. It is used to supply (binding) names that should be different from the schema component names or to supply names for anonymous components.

See Also:
Constant Field Values

TYPE_SUB_PACKAGE

public static final java.lang.String TYPE_SUB_PACKAGE
See Also:
Constant Field Values

ATTRIBUTE_SUB_PACKAGE

public static final java.lang.String ATTRIBUTE_SUB_PACKAGE
See Also:
Constant Field Values

ELEMENT_SUB_PACKAGE

public static final java.lang.String ELEMENT_SUB_PACKAGE
See Also:
Constant Field Values

ATTR_GROUP_SUB_PACKAGE

public static final java.lang.String ATTR_GROUP_SUB_PACKAGE
See Also:
Constant Field Values

ELEM_GROUP_SUB_PACKAGE

public static final java.lang.String ELEM_GROUP_SUB_PACKAGE
See Also:
Constant Field Values

ATTRIBUTE_NAME_SUFFIX_FOR_NAME_PREFIX

public static final java.lang.String ATTRIBUTE_NAME_SUFFIX_FOR_NAME_PREFIX
See Also:
Constant Field Values

ATTRIBUTE_NAME_SUFFIX_FOR_NAME_SUFFIX

public static final java.lang.String ATTRIBUTE_NAME_SUFFIX_FOR_NAME_SUFFIX
See Also:
Constant Field Values