org.geotools.validation.xml
Class ArgHelper.GeometryMapping

Object
  extended by ArgHelper.GeometryMapping
All Implemented Interfaces:
ArgHelper.Mapping
Enclosing class:
ArgHelper

protected static class ArgHelper.GeometryMapping
extends Object
implements ArgHelper.Mapping

GeometryMapping purpose.

Represents the workings for a Geometry Mapping

Author:
dzwiers, Refractions Research, Inc., $Author: dmzwiers $ (last modification)

Constructor Summary
protected ArgHelper.GeometryMapping()
           
 
Method Summary
 String encode(Object obj)
          Implementation of encode.
 String getElementName()
          Implementation of getElementName.
 Object getInstance(Element value)
          Implementation of getInstance.
 Object getInstance(String value)
          getInstance purpose.
 String getType()
          Implementation of getType.
 boolean isClass(Class c)
           
 boolean isClassInstance(Object c)
          Implementation of isClassInstance.
 String toString(Object obj)
           
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArgHelper.GeometryMapping

protected ArgHelper.GeometryMapping()
Method Detail

getType

public String getType()
Implementation of getType.

Specified by:
getType in interface ArgHelper.Mapping
Returns:
the type name
See Also:
ArgHelper.Mapping.getType()

getElementName

public String getElementName()
Implementation of getElementName.

Specified by:
getElementName in interface ArgHelper.Mapping
Returns:
the element name
See Also:
ArgHelper.Mapping.getElementName()

getInstance

public Object getInstance(Element value)
Implementation of getInstance.

Specified by:
getInstance in interface ArgHelper.Mapping
Parameters:
value - Element the element to parse into a Geometry.
Returns:
Geometry an instance of Geometry if one can be created, null otherwise.
See Also:
ArgHelper.Mapping.getInstance(org.w3c.dom.Element)

getInstance

public Object getInstance(String value)
Description copied from interface: ArgHelper.Mapping
getInstance purpose.

Creates an instance of the appropriate type for this Mapping. This is where type-dependant magic occurs

Specified by:
getInstance in interface ArgHelper.Mapping
Parameters:
value - The Element to interpret.
Returns:
The particular argument type expected.

isClassInstance

public boolean isClassInstance(Object c)
Implementation of isClassInstance.

Specified by:
isClassInstance in interface ArgHelper.Mapping
Parameters:
c - The Object to test
Returns:
true when both of type Geometry
See Also:
ArgHelper.Mapping.isClassInstance(java.lang.Object)

isClass

public boolean isClass(Class c)
Specified by:
isClass in interface ArgHelper.Mapping

encode

public String encode(Object obj)
              throws ValidationException
Implementation of encode.

Specified by:
encode in interface ArgHelper.Mapping
Parameters:
obj - An object to encode as a geometry.
Returns:
String the XML encoding
Throws:
ValidationException - when obj is not of type geometry
See Also:
ArgHelper.Mapping.encode(java.lang.Object)

toString

public String toString(Object obj)
Specified by:
toString in interface ArgHelper.Mapping


Copyright © 1996-2009 Geotools. All Rights Reserved.