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 interface:
ArgHelper

protected static interface ArgHelper.Mapping

Mapping purpose.

Used to mask attribute specific fucntions from the user.

Version:
$Id: ArgHelper.java 17704 2006-01-23 00:26:16Z desruisseaux $
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

public java.lang.String getType()
getType purpose.

Returns a constant type name.

Returns:
String a constant type name.

getInstance

public 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

public 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

public 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

public boolean isClass(java.lang.Class c)

encode

public 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

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

getElementName

public java.lang.String getElementName()
getElementName purpose.

This is the name of the element represented.

Returns:


Copyright © GeoTools. All Rights Reserved.