Package org.geotools.xml.schema.impl
Class SimpleTypeGT
Object
SimpleTypeGT
- All Implemented Interfaces:
SimpleType,Type
- Direct Known Subclasses:
ogcSimpleType,sldSimpleTypes._Service
- Author:
- dzwiers
-
Field Summary
Fields inherited from interface SimpleType
ALL, LIST, NONE, RESTRICTION, UNION -
Constructor Summary
ConstructorsConstructorDescriptionSimpleTypeGT(String id, String name, URI namespace, int type, SimpleType[] parents, Facet[] constraints, int finaL) Creates a new SimpleTypeGT object. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanCan I write this object out as element specified?voidEncode value as element on the provided output.findChildElement(String name1) Convinience method used to search this type's children for the requested element by localName.intReturns an int of either List, Union or RestrictionFacet[]The list of facets for this Restriction ...intgetFinal()This specifies a mask which represents how this XML Schema SimpleType may be extended/restricted ... through Schema declared derivations.getId()The Schema ID for this simpleType definition.This will return the intended Java Class for this element type.getName()This returns the XML Schema declaration name of this type (both complex and simple types have names ...)This is used for validation of an XML document, and represents the targetNamespace of that this type resides in.A simple simpleType when either a List or Restriction ...getValue(Element element, ElementValue[] value, Attributes attrs, Map<String, Object> hints) This method ignores the attributes from the xml nodereturns the value as a string
-
Constructor Details
-
SimpleTypeGT
public SimpleTypeGT(String id, String name, URI namespace, int type, SimpleType[] parents, Facet[] constraints, int finaL) Creates a new SimpleTypeGT object.
-
-
Method Details
-
getInstanceType
Description copied from interface:TypeThis 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.- Specified by:
getInstanceTypein interfaceType- See Also:
-
org.geotools.xml.xsi.Type#getInstanceType()
-
findChildElement
Description copied from interface:TypeConvinience method used to search this type's children for the requested element by localName.- Specified by:
findChildElementin interfaceType- Parameters:
name1- the element's localName to search for.- See Also:
-
getFinal
public int getFinal()Description copied from interface:SimpleTypeThis specifies a mask which represents how this XML Schema SimpleType may be extended/restricted ... through Schema declared derivations.- Specified by:
getFinalin interfaceSimpleType- See Also:
-
org.geotools.xml.xsi.SimpleType#getFinal()
-
getId
Description copied from interface:SimpleTypeThe Schema ID for this simpleType definition.- Specified by:
getIdin interfaceSimpleType- See Also:
-
org.geotools.xml.xsi.SimpleType#getId()
-
getName
Description copied from interface:TypeThis returns the XML Schema declaration name of this type (both complex and simple types have names ...) -
getNamespace
Description copied from interface:TypeThis is used for validation of an XML document, and represents the targetNamespace of that this type resides in.- Specified by:
getNamespacein interfaceType- See Also:
-
org.geotools.xml.xsi.Type#getLocalName()
-
getParents
Description copied from interface:SimpleTypeA simple simpleType when either a List or Restriction ... A set when a Union- Specified by:
getParentsin interfaceSimpleType- See Also:
-
org.geotools.xml.xsi.Type#getParent()
-
getValue
public Object getValue(Element element, ElementValue[] value, Attributes attrs, Map<String, Object> hints) throws OperationNotSupportedException, SAXExceptionThis method ignores the attributes from the xml node- Specified by:
getValuein interfaceType- Returns:
- Object
- Throws:
OperationNotSupportedExceptionSAXException- See Also:
-
schema.Type#getValue(java.lang.Object, org.xml.sax.Attributes)
-
getChildType
public int getChildType()Description copied from interface:SimpleTypeReturns an int of either List, Union or Restriction- Specified by:
getChildTypein interfaceSimpleType- See Also:
-
getFacets
Description copied from interface:SimpleTypeThe list of facets for this Restriction ... Null if another type (List, Union)- Specified by:
getFacetsin interfaceSimpleType- See Also:
-
toAttribute
public AttributeValue toAttribute(Attribute attribute, Object value, Map<String, Object> hints) throws OperationNotSupportedExceptionDescription copied from interface:SimpleTypereturns the value as a string- Specified by:
toAttributein interfaceSimpleType- Throws:
OperationNotSupportedException- See Also:
-
canCreateAttributes
- Specified by:
canCreateAttributesin interfaceSimpleType- See Also:
-
canEncode
Description copied from interface:TypeCan I write this object out as element specified?- Specified by:
canEncodein interfaceType- 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.value- An Object which may or may not be encodeable by this type. The value may also be null.- Returns:
- True when the encode method can interpret the given element/value pair into valid xml.
- See Also:
-
encode
public void encode(Element element, Object value, PrintHandler output, Map<String, Object> hints) throws IOException, OperationNotSupportedExceptionDescription copied from interface:TypeEncode value as element on the provided output.This is encoding because the PrintHandler does not have to go back to a stream.
- Specified by:
encodein interfaceType- Parameters:
element- The original element declaration to which we should encode.value- The Object to encode.output- This is where the output should be written to.hints- For providing additional context information to specific schemas.- Throws:
IOException- When there is an error with the Writer.OperationNotSupportedException- When this type cannot be encoded ... and wasn't checked first.- See Also:
-