| org.geotools.xml.ComplexBinding
All known Subclasses: org.geotools.xml.AbstractComplexBinding,
ComplexBinding | public interface ComplexBinding extends Binding(Code) | | A strategy for parsing elements in an instance document which are of
complex type.
Complex types contain child elements, and attributes. A complex strategy
has the ability to
author: Justin Deoliveira,Refractions Research Inc.,jdeolive@refractions.net |
Method Summary | |
Element | encode(Object object, Document document, Element value) Performs the encoding of the object into its xml representation.
Complex objects are encoded as elements in a document. | List | getProperties(Object object) Returns a list of properties of the specified object.
The return list contains a set of
QName ,
Object tuples,
each as a two element object array.
This method should only be implemented in the case where the encoder
can not determine what the properties of the object are from the schema.
An example would be an object which corresponds to an element in the
schema which has a the type xs:anyType . | Object | getProperty(Object object, QName name) Returns a property of a particular object which corresponds to the
specified name.
This method should just return null in the event that the object being
encoded is an leaf in its object model.
For multi-values properties ( maxOccurs > 0 ), this method may return an
instance of
java.util.Collection ,
java.util.Iterator , or
an array.
Parameters: object - The object being encoded. Parameters: name - The name of the property to obtain. | void | initializeChildContext(ElementInstance childInstance, Node node, MutablePicoContainer context) Initializes the context for a child element.
This method is called on the leading edge of a child element. | Object | parse(ElementInstance instance, Node node, Object value) Parses a complex element from an instance document into an object
representation.
This method is called when the trailing edge of the associated element is
reached.
Parameters: instance - The element being parsed. Parameters: node - The node in the parse tree representing the element beingparsed. Parameters: value - The result of the parse from another strategy in the typehierarchy. |
encode | Element encode(Object object, Document document, Element value) throws Exception(Code) | | Performs the encoding of the object into its xml representation.
Complex objects are encoded as elements in a document. The value
parameter is the encoded element, created by the parent binding. For the
first binding in the execution chain this is just an empty element ( no
children or attributes ). The binding has the choice to return value
or to create a new element to return.
This method may choose to create child elements and attributes for the element.
Or as an alternative return the object values for these contructs in
ComplexBinding.getProperty(Object,QName) .
Parameters: object - The object being encoded. Parameters: document - The document containing the encoded element. Parameters: value - The object as encoded by the parent binding. The element for the objcet being encoded, or null |
getProperties | List getProperties(Object object) throws Exception(Code) | | Returns a list of properties of the specified object.
The return list contains a set of
QName ,
Object tuples,
each as a two element object array.
This method should only be implemented in the case where the encoder
can not determine what the properties of the object are from the schema.
An example would be an object which corresponds to an element in the
schema which has a the type xs:anyType . Since the content
of this type can be anything the schema has no way to determine what
the properties are. So in this case this method must specify the
properties manually as a set of name, object tuples.
In the case of a multi-valued property, this method must return a tuple
for each instance of the property, and not a list, iterator, or array
containing all of the instances.
Parameters: object - the object being encoded. A list of the properties for the object. |
getProperty | Object getProperty(Object object, QName name) throws Exception(Code) | | Returns a property of a particular object which corresponds to the
specified name.
This method should just return null in the event that the object being
encoded is an leaf in its object model.
For multi-values properties ( maxOccurs > 0 ), this method may return an
instance of
java.util.Collection ,
java.util.Iterator , or
an array.
Parameters: object - The object being encoded. Parameters: name - The name of the property to obtain. The value of the property, or null . |
initializeChildContext | void initializeChildContext(ElementInstance childInstance, Node node, MutablePicoContainer context)(Code) | | Initializes the context for a child element.
This method is called on the leading edge of a child element. It is used
to create context for the binding of a child element. It is important to
note that each time this method is called, the node parse
tree will contain different, ie child nodes for those previous elements
parsed.
Parameters: childinstance - The child element instance Parameters: node - The parse node for the parent element. Parameters: context - the context in which the child element will be parsed. |
parse | Object parse(ElementInstance instance, Node node, Object value) throws Exception(Code) | | Parses a complex element from an instance document into an object
representation.
This method is called when the trailing edge of the associated element is
reached.
Parameters: instance - The element being parsed. Parameters: node - The node in the parse tree representing the element beingparsed. Parameters: value - The result of the parse from another strategy in the typehierarchy. Could be null if this is the first strategy being executed. The parsed object, or null if the component could not be parsed. throws: Exception - Strategy objects should not attempt to handle any exceptions. |
|
|