| java.lang.Object org.geotools.feature.type.ChoiceAttributeType
ChoiceAttributeType | public class ChoiceAttributeType implements AttributeType(Code) | | This represents a Choice of AttributeTypes. That means, an Attribute of this
type may be one of any of this AttributeType's children. This attribute is
not valid for Simple Features, and maps to the Choice construct in GML.
Another way to think about the ChoiceAttributeType is as a Union
construction from C - it can store a number of different types of value,
but it only stores the one value. The parse and validate methods try out
each of the choices to see if one of them might work, since all are valid.
The order that the child attributeTypes (the choices you can use) are
specified is important, because some objects can parse and validate
against several types. The first choice that returns true is the one that
will
author: dzwiers author: Chris Holmes, TOPP |
ChoiceAttributeType | public ChoiceAttributeType(String name, int min, int max, AttributeType[] children, Filter restriction)(Code) | | |
createDefaultValue | public Object createDefaultValue()(Code) | | Returns the default value for the first child which does not throw an
exception, null otherwise.
The default value of the first choice that does not throw anexception. |
duplicate | public Object duplicate(Object src) throws IllegalAttributeException(Code) | | Goes through the children, and searches for a duplicator that works.
This method searches in the order in which the children are specified
... please keep this in mind when creating these objects if you care
about precedence.
Parameters: src - The object to be duplicated. A deep copy of the original object. throws: IllegalAttributeException - For any attribute errors. throws: IllegalArgumentException - If the object could not be duplicated. |
find | public int find(AttributeType type)(Code) | | Find the position of a given AttributeType.
Parameters: type - The type to search for. -1 if not found, a zero-based index if found. |
find | public int find(String attName)(Code) | | Find the position of an AttributeType which matches the given String.
Parameters: attName - the name to look for -1 if not found, zero-based index otherwise |
getAttributeCount | public int getAttributeCount()(Code) | | Returns the number of attributes at the first 'level' of the schema.
equivalent value to getAttributeTypes().length |
getAttributeType | public AttributeType getAttributeType(String xPath)(Code) | | Gets the attributeType at this xPath, if the specified attributeType
does not exist then null is returned.
Parameters: xPath - XPath pointer to attribute type. True if attribute exists. |
getAttributeType | public AttributeType getAttributeType(int position)(Code) | | Gets the attributeType at the specified index.
Parameters: position - the position of the attribute to check. The attribute type at the specified position. |
getMaxOccurs | public int getMaxOccurs()(Code) | | |
getMinOccurs | public int getMinOccurs()(Code) | | |
getRestriction | public Filter getRestriction()(Code) | | |
getType | final public Class getType()(Code) | | Gets the class of the object. For a choice this is fairly useless, as
it just returns Object, since we can not tell more than that.
currently always returns Object.class, since we can't tell more. See Also: org.geotools.feature.AttributeType.getType |
hasAttributeType | public boolean hasAttributeType(String xPath)(Code) | | 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. Number of occurrences. |
hashCode | public int hashCode()(Code) | | Override of hashCode.
hashCode for this object. |
isGeometry | public boolean isGeometry()(Code) | | |
isNillable | public boolean isNillable()(Code) | | |
parse | public Object parse(Object value) throws IllegalArgumentException(Code) | | Goes through the children, and searches for a parser that works. This
method searches in the order in which the children are specified ...
please keep this in mind when creating these objects if you care about
precedence.
Parameters: value - The object to parse. The object parsed into the appropriate form for the Attribute. throws: IllegalArgumentException - If the object could not be parsed byany of the child attribute Types. |
toString | public String toString()(Code) | | Gets a representation of this object as a string.
A representation of this object as a string |
validate | public void validate(Object obj) throws IllegalArgumentException(Code) | | Goes through the children, and searches for a validator that works. This
method searches in the order in which the children are specified ...
please keep this in mind when creating these objects if you care about
precedence.
Parameters: obj - The object to validate. throws: IllegalArgumentException - If none of the children can validate. |
|
|