|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.geotools.feature.type.ChoiceAttributeType
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
Nested Class Summary | |
static class |
ChoiceAttributeType.Geometric
A special class that is made so a Choice can serve as the Default Geometry in a FeatureType, by implementing GeometryAttributeType. |
Field Summary |
Fields inherited from interface org.geotools.feature.AttributeType |
UNBOUNDED |
Constructor Summary | |
ChoiceAttributeType(ChoiceAttributeType copy)
DOCUMENT ME! |
|
ChoiceAttributeType(java.lang.String name,
AttributeType[] children)
|
|
ChoiceAttributeType(java.lang.String name,
int min,
int max,
AttributeType[] children,
Filter restriction)
|
Method Summary | |
boolean |
calculateNillable(AttributeType[] children)
|
protected AttributeType[] |
copyChildren(AttributeType[] attributes)
|
java.lang.Object |
createDefaultValue()
Returns the default value for the first child which does not throw an exception, null otherwise. |
java.lang.Object |
duplicate(java.lang.Object src)
Goes through the children, and searches for a duplicator that works. |
boolean |
equals(java.lang.Object other)
|
int |
find(AttributeType type)
Find the position of a given AttributeType. |
int |
find(java.lang.String attName)
Find the position of an AttributeType which matches the given String. |
int |
getAttributeCount()
Returns the number of attributes at the first 'level' of the schema. |
AttributeType |
getAttributeType(int position)
Gets the attributeType at the specified index. |
AttributeType |
getAttributeType(java.lang.String xPath)
Gets the attributeType at this xPath, if the specified attributeType does not exist then null is returned. |
AttributeType[] |
getAttributeTypes()
|
int |
getMaxOccurs()
Returns the Max number of occurences ... |
int |
getMinOccurs()
Returns the Min number of occurences ... |
java.lang.String |
getName()
Gets the name of this attribute. |
Filter |
getRestriction()
This represents a Facet in XML schema ... for example can be used to represent the max length of 20 for a string. |
java.lang.Class |
getType()
Gets the class of the object. |
boolean |
hasAttributeType(java.lang.String xPath)
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. |
int |
hashCode()
Override of hashCode. |
boolean |
isGeometry()
|
boolean |
isNillable()
Returns whether nulls are allowed for this attribute. |
java.lang.Object |
parse(java.lang.Object value)
Goes through the children, and searches for a parser that works. |
java.lang.String |
toString()
Gets a representation of this object as a string. |
void |
validate(java.lang.Object obj)
Goes through the children, and searches for a validator that works. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ChoiceAttributeType(ChoiceAttributeType copy)
copy
- public ChoiceAttributeType(java.lang.String name, int min, int max, AttributeType[] children, Filter restriction)
public ChoiceAttributeType(java.lang.String name, AttributeType[] children)
Method Detail |
public Filter getRestriction()
AttributeType
getRestriction
in interface AttributeType
protected AttributeType[] copyChildren(AttributeType[] attributes)
public java.lang.String getName()
AttributeType
getName
in interface AttributeType
public java.lang.Class getType()
getType
in interface AttributeType
AttributeType.getType()
public boolean isNillable()
AttributeType
isNillable
in interface AttributeType
public boolean calculateNillable(AttributeType[] children)
public int getMinOccurs()
AttributeType
getMinOccurs
in interface AttributeType
public int getMaxOccurs()
AttributeType
getMaxOccurs
in interface AttributeType
public boolean isGeometry()
public java.lang.Object parse(java.lang.Object value) throws java.lang.IllegalArgumentException
parse
in interface AttributeType
value
- The object to parse.
java.lang.IllegalArgumentException
- If the object could not be parsed by
any of the child attribute Types.public void validate(java.lang.Object obj) throws java.lang.IllegalArgumentException
validate
in interface AttributeType
obj
- The object to validate.
java.lang.IllegalArgumentException
- If none of the children can validate.public java.lang.Object duplicate(java.lang.Object src) throws IllegalAttributeException
duplicate
in interface AttributeType
src
- The object to be duplicated.
IllegalAttributeException
- For any attribute errors.
java.lang.IllegalArgumentException
- If the object could not be duplicated.public java.lang.Object createDefaultValue()
createDefaultValue
in interface AttributeType
public boolean hasAttributeType(java.lang.String xPath)
xPath
- XPath pointer to attribute type.
public int getAttributeCount()
public AttributeType getAttributeType(java.lang.String xPath)
xPath
- XPath pointer to attribute type.
public int find(AttributeType type)
type
- The type to search for.
public int find(java.lang.String attName)
attName
- the name to look for
public AttributeType getAttributeType(int position)
position
- the position of the attribute to check.
public AttributeType[] getAttributeTypes()
public boolean equals(java.lang.Object other)
public int hashCode()
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |