org.geotools.xml.xsi
Class XSISimpleTypes.XSISimpleType

java.lang.Object
  extended byorg.geotools.xml.xsi.XSISimpleTypes.XSISimpleType
All Implemented Interfaces:
SimpleType, Type
Direct Known Subclasses:
XSISimpleTypes.AnyType, XSISimpleTypes.AnyURI, XSISimpleTypes.Base64Binary, XSISimpleTypes.Boolean, XSISimpleTypes.Byte, XSISimpleTypes.Date, XSISimpleTypes.DateTime, XSISimpleTypes.Decimal, XSISimpleTypes.Double, XSISimpleTypes.Duration, XSISimpleTypes.ENTITIES, XSISimpleTypes.ENTITY, XSISimpleTypes.Float, XSISimpleTypes.gDay, XSISimpleTypes.gMonth, XSISimpleTypes.gMonthDay, XSISimpleTypes.gYear, XSISimpleTypes.gYearMonth, XSISimpleTypes.HexBinary, XSISimpleTypes.ID, XSISimpleTypes.IDREF, XSISimpleTypes.IDREFS, XSISimpleTypes.Int, XSISimpleTypes.Integer, XSISimpleTypes.Language, XSISimpleTypes.Long, XSISimpleTypes.Name, XSISimpleTypes.NCName, XSISimpleTypes.NegativeInteger, XSISimpleTypes.NMTOKEN, XSISimpleTypes.NMTOKENS, XSISimpleTypes.NonNegativeInteger, XSISimpleTypes.NonPositiveInteger, XSISimpleTypes.NormalizedString, XSISimpleTypes.NOTATION, XSISimpleTypes.PositiveInteger, XSISimpleTypes.QName, XSISimpleTypes.Short, XSISimpleTypes.String, XSISimpleTypes.Time, XSISimpleTypes.Token, XSISimpleTypes.UnsignedByte, XSISimpleTypes.UnsignedInt, XSISimpleTypes.UnsignedLong, XSISimpleTypes.UnsignedShort
Enclosing class:
XSISimpleTypes

protected abstract static class XSISimpleTypes.XSISimpleType
extends java.lang.Object
implements SimpleType

A generic implementation of a SimpleType for use by the xsi Schema.

Author:
dzwiers

Field Summary
 
Fields inherited from interface org.geotools.xml.schema.SimpleType
ALL, LIST, NONE, RESTRICTION, UNION
 
Constructor Summary
protected XSISimpleTypes.XSISimpleType()
           
 
Method Summary
 boolean canCreateAttributes(Attribute attribute, java.lang.Object value, java.util.Map hints)
          DOCUMENT ME!
 boolean canEncode(Element element, java.lang.Object value, java.util.Map hints)
          Can I write this object out as element specified?
 void encode(Element element, java.lang.Object value, PrintHandler output, java.util.Map hints)
          Encode value as element on the provided output.
 Element findChildElement(java.lang.String name)
          Convinience method used to search this type's children for the requested element by localName.
 Element findChildElement(XSISimpleTypes.String name)
           
 int getChildType()
          Returns an int of either List, Union or Restriction
 Facet[] getFacets()
          The list of facets for this Restriction ...
 int getFinal()
           This specifies a mask which represents how this XML Schema SimpleType may be extended/restricted ... through Schema declared derivations.
 java.lang.String getId()
           The Schema ID for this simpleType definition.
static SimpleType getInstance()
           This method is intended to return an instance of the implemented type.
 java.net.URI getNamespace()
           This is used for validation of an XML document, and represents the targetNamespace of that this type resides in.
 Type getParent()
           
 SimpleType[] getParents()
          A simple simpleType when either a List or Restriction ...
 AttributeValue toAttribute(Attribute attribute, java.lang.Object value, java.util.Map hints)
           returns the value as a string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.geotools.xml.schema.Type
getInstanceType, getName, getValue
 

Constructor Detail

XSISimpleTypes.XSISimpleType

protected XSISimpleTypes.XSISimpleType()
Method Detail

findChildElement

public Element findChildElement(XSISimpleTypes.String name)
Parameters:
name -
Returns:
See Also:
Type.findChildElement(java.lang.String)

canCreateAttributes

public boolean canCreateAttributes(Attribute attribute,
                                   java.lang.Object value,
                                   java.util.Map hints)
Description copied from interface: SimpleType
DOCUMENT ME!

Specified by:
canCreateAttributes in interface SimpleType
Parameters:
attribute - DOCUMENT ME!
value - DOCUMENT ME!
hints - DOCUMENT ME!
Returns:
See Also:
SimpleType.canCreateAttributes(org.geotools.xml.schema.Attribute, java.lang.Object, java.util.Map)

canEncode

public boolean canEncode(Element element,
                         java.lang.Object value,
                         java.util.Map hints)
Description copied from interface: Type
Can I write this object out as element specified?

Specified by:
canEncode in interface Type
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:
Type.canEncode(org.geotools.xml.schema.Element, java.lang.Object, java.util.Map)

toAttribute

public AttributeValue toAttribute(Attribute attribute,
                                  java.lang.Object value,
                                  java.util.Map hints)
Description copied from interface: SimpleType

returns the value as a string

Specified by:
toAttribute in interface SimpleType
Parameters:
attribute -
value -
hints -
Returns:
See Also:
SimpleType.toAttribute(org.geotools.xml.schema.Attribute, java.lang.Object, java.util.Map)

encode

public void encode(Element element,
                   java.lang.Object value,
                   PrintHandler output,
                   java.util.Map hints)
            throws java.io.IOException
Description copied from interface: Type
Encode value as element on the provided output.

This is encoding because the PrintHandler does not have to go back to a stream.

Specified by:
encode in interface Type
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:
java.io.IOException - When there is an error with the Writer.
See Also:
Type.encode(org.geotools.xml.schema.Element, java.lang.Object, org.geotools.xml.PrintHandler, java.util.Map)

getInstance

public static SimpleType getInstance()

This method is intended to return an instance of the implemented type.

Returns:
SimpleType
Throws:
java.lang.RuntimeException - when not overridden

getParent

public Type getParent()
See Also:
org.geotools.xml.xsi.Type#getParent()

getNamespace

public java.net.URI getNamespace()
Description copied from interface: Type

This is used for validation of an XML document, and represents the targetNamespace of that this type resides in.

Specified by:
getNamespace in interface Type
Returns:
See Also:
org.geotools.xml.xsi.Type#getNamespace()

getFinal

public int getFinal()
Description copied from interface: SimpleType

This specifies a mask which represents how this XML Schema SimpleType may be extended/restricted ... through Schema declared derivations.

Specified by:
getFinal in interface SimpleType
Returns:
See Also:
org.geotools.xml.xsi.SimpleType#getFinal()

getId

public java.lang.String getId()
Description copied from interface: SimpleType

The Schema ID for this simpleType definition.

Specified by:
getId in interface SimpleType
Returns:
See Also:
org.geotools.xml.xsi.SimpleType#getId()

getChildType

public int getChildType()
Description copied from interface: SimpleType
Returns an int of either List, Union or Restriction

Specified by:
getChildType in interface SimpleType
Returns:
See Also:
SimpleType.getChildType()

getParents

public SimpleType[] getParents()
Description copied from interface: SimpleType
A simple simpleType when either a List or Restriction ... A set when a Union

Specified by:
getParents in interface SimpleType
Returns:
See Also:
SimpleType.getParents()

getFacets

public Facet[] getFacets()
Description copied from interface: SimpleType
The list of facets for this Restriction ... Null if another type (List, Union)

Specified by:
getFacets in interface SimpleType
Returns:
See Also:
SimpleType.getFacets()

findChildElement

public Element findChildElement(java.lang.String name)
Description copied from interface: Type
Convinience method used to search this type's children for the requested element by localName.

Specified by:
findChildElement in interface Type
Parameters:
name - the element's localName to search for.
Returns:
See Also:
Type.findChildElement(java.lang.String)


Copyright © GeoTools. All Rights Reserved.