org.geotools.feature.type
Class PropertyTypeImpl

Object
  extended by PropertyTypeImpl
All Implemented Interfaces:
PropertyType
Direct Known Subclasses:
AssociationTypeImpl, AttributeTypeImpl

public abstract class PropertyTypeImpl
extends Object
implements PropertyType


Field Summary
protected  Class<?> binding
           
protected  InternationalString description
           
protected  boolean isAbstract
           
protected  Name name
           
protected  List<Filter> restrictions
           
protected  PropertyType superType
           
protected  Map<Object,Object> userData
           
 
Constructor Summary
PropertyTypeImpl(Name name, Class<?> binding, boolean isAbstract, List<Filter> restrictions, PropertyType superType, InternationalString description)
           
 
Method Summary
 boolean equals(Object other)
          Equality based on property PropertyType.getName().
 Class<?> getBinding()
          The java class that values of properties of the property type are bound to.
 InternationalString getDescription()
          Human readable description of this property type.
 Name getName()
          The name of the property type.
 List<Filter> getRestrictions()
          List of restrictions used define valid values for properties of this property type.
 PropertyType getSuper()
          The parent type of the property type.
 Map<Object,Object> getUserData()
          A map of "user data" which enables applications to store "application-specific" information against a property type.
 int hashCode()
          Hashcode override based on PropertyType.getName().
 boolean isAbstract()
          Flag indicating if the type is abstract or not.
 String toString()
           
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected final Name name

binding

protected final Class<?> binding

isAbstract

protected final boolean isAbstract

superType

protected final PropertyType superType

restrictions

protected final List<Filter> restrictions

description

protected final InternationalString description

userData

protected final Map<Object,Object> userData
Constructor Detail

PropertyTypeImpl

public PropertyTypeImpl(Name name,
                        Class<?> binding,
                        boolean isAbstract,
                        List<Filter> restrictions,
                        PropertyType superType,
                        InternationalString description)
Method Detail

getName

public Name getName()
Description copied from interface: PropertyType
The name of the property type.

Note that this is not the same name as Property.getName(), which is the name of the instance of the type, not the type itself.

The returned name is a qualified name made up of two parts. The first a namespace uri (Name.getNamespaceURI(), and the second a local part (Name.getLocalPart().

This value is never null.

Specified by:
getName in interface PropertyType
Returns:
The name of the property type.

getBinding

public Class<?> getBinding()
Description copied from interface: PropertyType
The java class that values of properties of the property type are bound to.

This value is never null.

Specified by:
getBinding in interface PropertyType
Returns:
The binding of the property type.

isAbstract

public boolean isAbstract()
Description copied from interface: PropertyType
Flag indicating if the type is abstract or not.

Specified by:
isAbstract in interface PropertyType
Returns:
true if the type is abstract, otherwise false.

getRestrictions

public List<Filter> getRestrictions()
Description copied from interface: PropertyType
List of restrictions used define valid values for properties of this property type.

Each restriction is a Filter object in which the property is passed through. If Filter.evaluate(Object) returns true the restriction is met. If false is returned then the restriction has not been met and the property should be considered invalid. Remember to check getSuper().getRestrictions() as well.

This method returns an empty set in the case of no restrictions and should not return null.

Specified by:
getRestrictions in interface PropertyType
Returns:
List used to validate allowable values.

getSuper

public PropertyType getSuper()
Description copied from interface: PropertyType
The parent type of the property type.

This method returns null if no super type is defined.

The super type may contain additional restrictions to be considered against properties of the the property type.

Specified by:
getSuper in interface PropertyType
Returns:
The parent or super type, or null.

getDescription

public InternationalString getDescription()
Description copied from interface: PropertyType
Human readable description of this property type.

Specified by:
getDescription in interface PropertyType
Returns:
Human readable description of this property type.

hashCode

public int hashCode()
Description copied from interface: PropertyType
Hashcode override based on PropertyType.getName().

Specified by:
hashCode in interface PropertyType
Overrides:
hashCode in class Object
Returns:
getName().hashCode()

equals

public boolean equals(Object other)
Description copied from interface: PropertyType
Equality based on property PropertyType.getName().

Specified by:
equals in interface PropertyType
Overrides:
equals in class Object
Returns:
true if other is a PropertyType with the same name

getUserData

public Map<Object,Object> getUserData()
Description copied from interface: PropertyType
A map of "user data" which enables applications to store "application-specific" information against a property type.

As an example, consider an application that builds a PropertyType from an xml schema. A useful bit of information to attach to the PropertyType is the original schema itself, in whatever construct it might be stored in:

 
 XSDComplexTypeDefinition complexTypeDef = ...;
 PropertyType type = buildPropertyType( complexTypeDef );

 type.getUserData().put( XSDComplexTypeDefintion.class, complexTypeDef );
 
 

Specified by:
getUserData in interface PropertyType
Returns:
A map of user data.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 1996-2014 Geotools. All Rights Reserved.