org.geotools.feature.type
Class ListAttributeType

Object
  extended by PropertyDescriptorImpl
      extended by AttributeDescriptorImpl
          extended by ListAttributeType
All Implemented Interfaces:
AttributeType, AttributeDescriptor, PropertyDescriptor
Direct Known Subclasses:
NestedAttributeType

Deprecated. Will be removed in geootols 2.6.

public class ListAttributeType
extends AttributeDescriptorImpl
implements AttributeType

Represents an ordered list of AttributeTypes. For SFS this will be a FeatureType. For GML this is the same as an element whose complexType contains a Sequence of Attributes.

Author:
dzwiers
Module:
modules/library/legacy (gt-legacy.jar)

Field Summary
 
Fields inherited from class AttributeDescriptorImpl
defaultValue
 
Fields inherited from class PropertyDescriptorImpl
isNillable, maxOccurs, minOccurs, name, type
 
Fields inherited from interface AttributeType
UNBOUNDED
 
Constructor Summary
ListAttributeType(ListAttributeType copy)
          Deprecated.  
ListAttributeType(String name, boolean nillable, AttributeType[] children)
          Deprecated.  
ListAttributeType(String name, boolean nillable, int min, int max, AttributeType[] children, Filter restriction)
          Deprecated.  
 
Method Summary
 Object createDefaultValue()
          Deprecated. Create a default value for this AttributeType.
 Object duplicate(Object src)
          Deprecated. Create a duplicate value of the passed Object.
 int find(AttributeType type)
          Deprecated. Find the position of a given AttributeType.
 int find(String attName)
          Deprecated. Find the position of an AttributeType which matches the given String.
 int getAttributeCount()
          Deprecated. Returns the number of attributes at the first 'level' of the schema.
 AttributeType getAttributeType(int position)
          Deprecated. Gets the attributeType at the specified index.
 AttributeType getAttributeType(String xPath)
          Deprecated. Gets the attributeType at this xPath, if the specified attributeType does not exist then null is returned.
 AttributeType[] getAttributeTypes()
          Deprecated.  
 Class getBinding()
          Deprecated. Gets the class/type/binding for this attribute.
 String getLocalName()
          Deprecated. Returns the unqualified name of this attribute.
 Filter getRestriction()
          Deprecated. This represents a Facet in XML schema ... for example can be used to represent the max length of 20 for a string.
 boolean hasAttributeType(String xPath)
          Deprecated. This is only used twice in the whole geotools code base, and one of those is for a test, so we're removing it from the interface.
 boolean isGeometry()
          Deprecated.  
 Object parse(Object value)
          Deprecated. Allows this AttributeType to convert an argument to its prefered storage type.
 void validate(Object obj)
          Deprecated. Whether the tested object passes the validity constraints of this AttributeType.
 
Methods inherited from class AttributeDescriptorImpl
equals, getDefaultValue, getType, hashCode, toString
 
Methods inherited from class PropertyDescriptorImpl
getMaxOccurs, getMinOccurs, getName, getUserData, isNillable
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface AttributeType
getMaxOccurs, getMinOccurs, isNillable
 
Methods inherited from interface AttributeDescriptor
getDefaultValue, getType
 
Methods inherited from interface PropertyDescriptor
getName, getUserData
 

Constructor Detail

ListAttributeType

public ListAttributeType(ListAttributeType copy)
Deprecated. 
Parameters:
copy -

ListAttributeType

public ListAttributeType(String name,
                         boolean nillable,
                         int min,
                         int max,
                         AttributeType[] children,
                         Filter restriction)
Deprecated. 

ListAttributeType

public ListAttributeType(String name,
                         boolean nillable,
                         AttributeType[] children)
Deprecated. 
Method Detail

getRestriction

public Filter getRestriction()
Deprecated. 
Description copied from interface: AttributeType
This represents a Facet in XML schema ... for example can be used to represent the max length of 20 for a string.

Specified by:
getRestriction in interface AttributeType
Returns:
Filter, or Filter.INCLUDE if no restriction is needed.

getLocalName

public String getLocalName()
Deprecated. 
Returns the unqualified name of this attribute.

This method is a replacement for PropertyDescriptor.getName() in order to resolve a naming conflict with the geoapi feature model.

Specified by:
getLocalName in interface AttributeType
Specified by:
getLocalName in interface AttributeDescriptor
Overrides:
getLocalName in class AttributeDescriptorImpl
See Also:
PropertyDescriptor.getName()

getBinding

public Class getBinding()
Deprecated. 
Gets the class/type/binding for this attribute.

This method is a replacement for AttributeDescriptor.getType() in order to resolve a naming conflict with the geoapi feature model.

Specified by:
getBinding in interface AttributeType
See Also:
AttributeDescriptor.getType()

isGeometry

public boolean isGeometry()
Deprecated. 

parse

public Object parse(Object value)
             throws IllegalArgumentException
Deprecated. 
Description copied from interface: AttributeType
Allows this AttributeType to convert an argument to its prefered storage type. If no parsing is possible, returns the original value. If a parse is attempted, yet fails (i.e. a poor decimal format) throw the Exception. This is mostly for use internally in Features, but implementors should simply follow the rules to be safe.

Specified by:
parse in interface AttributeType
Parameters:
value - the object to attempt parsing of.
Returns:
value converted to the preferred storage of this AttributeType. If no parsing was possible then the same object is returned.
Throws:
IllegalArgumentException - if parsing is attempted and is unsuccessful.

validate

public void validate(Object obj)
              throws IllegalArgumentException
Deprecated. 
Description copied from interface: AttributeType
Whether the tested object passes the validity constraints of this AttributeType. At a minimum it should be of the correct class specified by AttributeType.getBinding(), non-null if isNillable is false, and a geometry if isGeometry is true. If The object does not validate then an IllegalArgumentException reporting the error in validation should be thrown.

Specified by:
validate in interface AttributeType
Parameters:
obj - The object to be tested for validity.
Throws:
IllegalArgumentException - if the object does not validate.

duplicate

public Object duplicate(Object src)
                 throws IllegalAttributeException
Deprecated. 
Description copied from interface: AttributeType
Create a duplicate value of the passed Object. For immutable Objects, it is not neccessary to create a new Object.

Specified by:
duplicate in interface AttributeType
Parameters:
src - The Object to duplicate.
Returns:
Duplicate of provided object
Throws:
IllegalAttributeException - If the src Object is not the correct type.

createDefaultValue

public Object createDefaultValue()
Deprecated. 
Description copied from interface: AttributeType
Create a default value for this AttributeType. If the type is nillable, the Object may or may not be null.

Specified by:
createDefaultValue in interface AttributeType
Returns:
Default value, note may be null if isNillable is true

hasAttributeType

public boolean hasAttributeType(String xPath)
Deprecated. 
This is only used twice in the whole geotools code base, and one of those is for a test, so we're removing it from the interface. If getAttributeType does not have the AttributeType it will just return null. Gets the number of occurrences of this attribute.

Parameters:
xPath - XPath pointer to attribute type.
Returns:
Number of occurrences.

getAttributeCount

public int getAttributeCount()
Deprecated. 
Returns the number of attributes at the first 'level' of the schema.

Returns:
equivalent value to getAttributeTypes().length

getAttributeType

public AttributeType getAttributeType(String xPath)
Deprecated. 
Gets the attributeType at this xPath, if the specified attributeType does not exist then null is returned.

Parameters:
xPath - XPath pointer to attribute type.
Returns:
True if attribute exists.

find

public int find(AttributeType type)
Deprecated. 
Find the position of a given AttributeType.

Parameters:
type - The type to search for.
Returns:
-1 if not found, a zero-based index if found.

find

public int find(String attName)
Deprecated. 
Find the position of an AttributeType which matches the given String.

Parameters:
attName - the name to look for
Returns:
-1 if not found, zero-based index otherwise

getAttributeType

public AttributeType getAttributeType(int position)
Deprecated. 
Gets the attributeType at the specified index.

Parameters:
position - the position of the attribute to check.
Returns:
The attribute type at the specified position.

getAttributeTypes

public AttributeType[] getAttributeTypes()
Deprecated. 


Copyright © 1996-2009 Geotools. All Rights Reserved.