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.

Version:
$Id: ArgHelper.java 32252 2009-01-18 09:40:37Z aaime $
Author:
dzwiers, Refractions Research, Inc., $Author: dmzwiers $ (last modification)

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

Method Detail

getType

java.lang.String getType()
getType purpose.

Returns a constant type name.

Returns:
String a constant type name.

getInstance

java.lang.Object getInstance(org.w3c.dom.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

java.lang.Object getInstance(java.lang.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(java.lang.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(java.lang.Class c)

encode

java.lang.String encode(java.lang.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

java.lang.String toString(java.lang.Object obj)

getElementName

java.lang.String getElementName()
getElementName purpose.

This is the name of the element represented.



Copyright © 1996-2010 Geotools. All Rights Reserved.