org.geotools.validation.xml
Interface ArgHelper.Mapping

All Known Implementing Classes:
ArgHelper.BooleanMapping, ArgHelper.DateMapping, ArgHelper.DoubleMapping, ArgHelper.EnvelopeMapping, ArgHelper.FilterMapping, ArgHelper.FloatMapping, ArgHelper.GeometryMapping, ArgHelper.IntegerMapping, ArgHelper.LongMapping, ArgHelper.ShortMapping, ArgHelper.StringMapping, ArgHelper.URIMapping
Enclosing class:
ArgHelper

protected static interface ArgHelper.Mapping

Mapping purpose.

Used to mask attribute specific fucntions from the user.

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

Method Summary
 String encode(Object obj)
          encode purpose.
 String getElementName()
          getElementName purpose.
 Object getInstance(Element value)
          getInstance purpose.
 Object getInstance(String value)
          getInstance purpose.
 String getType()
          getType purpose.
 boolean isClass(Class c)
           
 boolean isClassInstance(Object obj)
          isClassInstance purpose.
 String toString(Object obj)
           
 

Method Detail

getType

String getType()
getType purpose.

Returns a constant type name.

Returns:
String a constant type name.

getInstance

Object getInstance(Element value)
                   throws ValidationException
getInstance purpose.

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

Parameters:
value - The Element to interpret.
Returns:
The particular argument type expected.
Throws:
ValidationException

getInstance

Object getInstance(String value)
                   throws ValidationException
getInstance purpose.

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

Parameters:
value - The Element to interpret.
Returns:
The particular argument type expected.
Throws:
ValidationException

isClassInstance

boolean isClassInstance(Object obj)
isClassInstance purpose.

Tests to see if this class is of the expected type.

Parameters:
obj - The object to test.
Returns:
true when they are compatible

isClass

boolean isClass(Class c)

encode

String encode(Object obj)
              throws ValidationException
encode purpose.

Creates an XML String from the obj provided, if the object is of the expected type for this mapping.

Parameters:
obj - The object to try and encode.
Returns:
An XML String if the type is correct, ClassCastException otherwise.
Throws:
ValidationException

toString

String toString(Object obj)

getElementName

String getElementName()
getElementName purpose.

This is the name of the element represented.



Copyright © 1996-2010 Geotools. All Rights Reserved.