| org.geotools.xml.schema.Type
Type | public interface Type (Code) | |
This is a convinience interface to help speed up the code, allowing for any
type definition to handled in a consistent manner, independant of whether
it's nested or not.
See Also: SimpleType See Also: ComplexType author: dzwiers www.refractions.net |
Method Summary | |
public boolean | canEncode(Element element, Object value, Map hints) Can I write this object out as element specified?
Parameters: element - The element which may be used to represent the Object. | public void | encode(Element element, Object value, PrintHandler output, Map hints) Encode value as element on the provided output.
This is encoding because the PrintHandler does not have to go back to a stream.
Parameters: element - The original element declaration to which we should encode. | public Element | findChildElement(String name) Convinience method used to search this type's children for the
requested element by localName. | public Class | getInstanceType()
This will return the intended Java Class for this element type. | public String | getName() | public URI | getNamespace()
This is used for validation of an XML document, and represents the
targetNamespace of that this type resides in. | public Object | getValue(Element element, ElementValue[] value, Attributes attrs, Map hints)
This method is intended to receive the child elements in the form of
ElementValues (@see ElementValue). |
canEncode | public boolean canEncode(Element element, Object value, Map hints)(Code) | | Can I write this object out as element specified?
Parameters: element - The element which may be used to represent the Object. This is included to allow for child definitions to include addition information where appropriate. Parameters: value - An Object which may or may not be encodeable by this type. The value may also be null. True when the encode method can interpret the given element/value pair into valid xml. See Also: Type.encode(ElementObjectWriterMap) |
encode | public void encode(Element element, Object value, PrintHandler output, Map hints) throws IOException, OperationNotSupportedException(Code) | | Encode value as element on the provided output.
This is encoding because the PrintHandler does not have to go back to a stream.
Parameters: element - The original element declaration to which we should encode. Parameters: value - The Object to encode. Parameters: output - This is where the output should be written to. Parameters: hints - For providing additional context information to specific schemas. throws: IOException - When there is an error with the Writer. throws: OperationNotSupportedException - When this type cannot be encoded ... and wasn't checked first. |
findChildElement | public Element findChildElement(String name)(Code) | | Convinience method used to search this type's children for the
requested element by localName.
Parameters: name - the element's localName to search for. |
getInstanceType | public Class getInstanceType()(Code) | |
This will return the intended Java Class for this element type. For
generic complex types this will be an object array. SimpleTypes will
match as they are parsed, and custom extensions will also return the
appropriate class value.
|
getName | public String getName()(Code) | |
This returns the XML Schema declaration name of this type (both complex
and simple types have names ...)
|
getNamespace | public URI getNamespace()(Code) | |
This is used for validation of an XML document, and represents the
targetNamespace of that this type resides in.
|
getValue | public Object getValue(Element element, ElementValue[] value, Attributes attrs, Map hints) throws SAXException, OperationNotSupportedException(Code) | |
This method is intended to receive the child elements in the form of
ElementValues (@see ElementValue). Recall that this is a pairing
containing a reference to the type and the actual value (do not call
.getValue on the types). This should return the real value (interpreted
value) for this element based on it's children. Remember, this is a XML
is a tree structure, so if you don't include some children, they are gone
forever (so be careful when ignoring data).
If the element had #CData (Nested Child Text), this will appear in the first slot, with a null Element.
A SAXNotSupportedException should be thrown when the child's
[inherited, default implementation of
getValue(ElementValue[],Attributes)] method should be used.
throws: OperationNotSupportedException - See Also: ElementValue Object |
|
|