org.x2jb.bind.spi.provider
Interface BindingDefinition


public interface BindingDefinition

Defines mapping of methods and interfaces to XML elements and attributes. All binding definition implementations of this interface don't need to implement standard object methods like equals(), hashCode(), toString() and clone(). These methods are implemented inside X2JB framework and provided implementation (if any) will be ignored.

Every binding definition implementation have to:

Author:
Richard Opalka
See Also:
BindingException, BindingFactory

Method Summary
 java.lang.String getDefaultValue()
          Default value to be used when node is missing in XML document.
 java.lang.String getNodeName()
          Local name of the node to which mapping applies.
 java.lang.String getNodeNamespace()
          Namespace of the node to which mapping applies - default is null representing no namespace.
 java.lang.String getTypeHandler()
          Handler class name to be used during the binding process or null forcing built-in handler to be used.
 boolean isElementNode()
          Returns true if current node should be element node, false if it should be attribute.
 boolean isNodeMandatory()
          Returns true if node must be present in XML document, false otherwise - default is true.
 boolean isNodeUnique()
          If current node (with specified optional namespace and local name) should be the only one in the context node this method will return.
 

Method Detail

getNodeName

java.lang.String getNodeName()
Local name of the node to which mapping applies.

Returns:
Local name of the node

getNodeNamespace

java.lang.String getNodeNamespace()
Namespace of the node to which mapping applies - default is null representing no namespace.

Returns:
Namespace of the node

isElementNode

boolean isElementNode()
Returns true if current node should be element node, false if it should be attribute. node - default is true.

Returns:
Returns true if current node should be element node, false otherwise

isNodeMandatory

boolean isNodeMandatory()
Returns true if node must be present in XML document, false otherwise - default is true.

Returns:
Returns true if node must be present in XML document, false otherwise

isNodeUnique

boolean isNodeUnique()
If current node (with specified optional namespace and local name) should be the only one in the context node this method will return. true, otherwise it will return false - default is true

Returns:
Returns true if current node should be the only one in the context node, false otherwise

getTypeHandler

java.lang.String getTypeHandler()
Handler class name to be used during the binding process or null forcing built-in handler to be used.

Returns:
Handler class name or null forcing built-in handler to be used
See Also:
AttributeHandler, ElementHandler

getDefaultValue

java.lang.String getDefaultValue()
Default value to be used when node is missing in XML document. Default value is null representing no default value. This default value will be set only in case isNodeMandatory() returns false otherwise BindingException will be thrown.

Returns:
default value to be set if node is not present.