org.geotools.data.complex.config
Class NonFeatureTypeProxy

Object
  extended by NonFeatureTypeProxy
All Implemented Interfaces:
AttributeType, ComplexType, FeatureType, PropertyType

public class NonFeatureTypeProxy
extends Object
implements FeatureType

This class represents the fake feature type needed for feature chaining for properties that are not features. When a non feature is mapped separately in app schema data access, it is regarded as a feature since it would have a feature source.

Author:
Rini Angreani (CSIRO Earth Science and Resource Engineering)

Constructor Summary
NonFeatureTypeProxy(AttributeType type, FeatureTypeMapping mapping)
          Sole constructor
NonFeatureTypeProxy(AttributeType type, FeatureTypeMapping mapping, Collection<PropertyDescriptor> schema)
           
 
Method Summary
 boolean equals(Object o)
          Equality based on property PropertyType.getName().
 Class getBinding()
          The java class that values of properties of the property type are bound to.
 CoordinateReferenceSystem getCoordinateReferenceSystem()
          The coordinate reference system of the feature.
 InternationalString getDescription()
          Human readable description of this property type.
 PropertyDescriptor getDescriptor(Name name)
          Describe a single property by name.
 PropertyDescriptor getDescriptor(String name)
          Describe a single property by unqualified name.
 Collection<PropertyDescriptor> getDescriptors()
          The property descriptor which compose the complex type.
 GeometryDescriptor getGeometryDescriptor()
          Describe the default geometric attribute for this feature.
 Name getName()
          The name of the property type.
 Collection getOperations()
           
 List<Filter> getRestrictions()
          List of restrictions used define valid values for properties of this property type.
 AttributeType getSubject()
           
 AttributeType getSuper()
          Override of PropertyType.getSuper() which type narrows to AttributeType.
 Collection<PropertyDescriptor> getTypeDescriptors()
          Return only the schema descriptors
 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.
 boolean isIdentified()
          Indicates if the type is identified or not.
 boolean isInline()
          Indicates ability of XPath to notice this attribute.
 
Methods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface FeatureType
isIdentified
 
Methods inherited from interface ComplexType
getBinding, getDescriptor, isInline
 
Methods inherited from interface AttributeType
getSuper
 
Methods inherited from interface PropertyType
equals, getDescription, getName, getRestrictions, getUserData, hashCode, isAbstract
 

Constructor Detail

NonFeatureTypeProxy

public NonFeatureTypeProxy(AttributeType type,
                           FeatureTypeMapping mapping)
Sole constructor

Parameters:
type - The underlying non feature type

NonFeatureTypeProxy

public NonFeatureTypeProxy(AttributeType type,
                           FeatureTypeMapping mapping,
                           Collection<PropertyDescriptor> schema)
Method Detail

getSubject

public AttributeType getSubject()
See Also:
AttributeTypeProxy.getSubject()

getDescriptor

public PropertyDescriptor getDescriptor(Name name)
Description copied from interface: ComplexType
Describe a single property by name.

This method returns null if no such property is found.

Specified by:
getDescriptor in interface ComplexType
Parameters:
name - The name of the property to get.
Returns:
The property matching the specified name, or null.

getDescriptors

public Collection<PropertyDescriptor> getDescriptors()
Description copied from interface: ComplexType
The property descriptor which compose the complex type.

A complex type can be composed of attributes and associations which means this collection returns instances of AttributeDescriptor and AssociationDescriptor.

Specified by:
getDescriptors in interface ComplexType
Returns:
Collection of descriptors representing the composition of the complex type.

getTypeDescriptors

public Collection<PropertyDescriptor> getTypeDescriptors()
Return only the schema descriptors

Returns:

getCoordinateReferenceSystem

public CoordinateReferenceSystem getCoordinateReferenceSystem()
Description copied from interface: FeatureType
The coordinate reference system of the feature.

This value is derived from the default geometry attribute:

   ((GeometryType)getDefaultGeometry().getType()).getCRS();
 

This method will return null in the case where no default geometric attribute is defined.

Specified by:
getCoordinateReferenceSystem in interface FeatureType
Returns:
The coordinate referencing system, or null.

getGeometryDescriptor

public GeometryDescriptor getGeometryDescriptor()
Description copied from interface: FeatureType
Describe the default geometric attribute for this feature.

This method returns null in the case where no such attribute exists.

Specified by:
getGeometryDescriptor in interface FeatureType
Returns:
The descriptor of the default geometry attribute, or null.

getDescriptor

public PropertyDescriptor getDescriptor(String name)
Description copied from interface: ComplexType
Describe a single property by unqualified name.

Note: Special care should be taken when using this method in the case that two properties with the same local name but different namespace uri exist. For this reason using ComplexType.getDescriptor(Name) is safer.

This method returns null if no such property is found.

Specified by:
getDescriptor in interface ComplexType
Parameters:
name - The name of the property to get.
Returns:
The property matching the specified name, or null.

isInline

public boolean isInline()
Description copied from interface: ComplexType
Indicates ability of XPath to notice this attribute.

This facility is used to "hide" an attribute from XPath searches, while the compelx contents will still be navigated no additional nesting will be considered. It will be as if the content were "folded" inline resulting in a flatter nesting structure.

Construct described using Java Interfaces:


 interface TestSample {
     String name;
     List measurement;
 }
 interface Measurement {
     long timestamp;
     Point point;
     long reading;
 }
 
The above is can hold the following information:

 [ name="survey1",
   measurements=(
       [timestamp=3,point=(2,3), reading=4200],
       [timestamp=9,point=(2,4), reading=445600],
   )
 ]
 
Out of the box this is represented to XPath as the following tree:

 root/name: survey1
 root/measurement[0]/timestamp:3
 root/measurement[0]/point: (2,3)
 root/measurement[0]/reading: 4200
 root/measurement[1]/timestamp:9
 root/measurement[2]/point: (2,4)
 root/measurement[3]/reading: 445600
 
By inlining Measurement we can achive the following:

 root/name: survey1
 root/timestamp[0]:3
 root/point[0]: (2,3)
 root/reading[0]: 4200
 root/timestamp[1]:9
 root/point[1]: (2,4)
 root/reading[1] 445600
 

Specified by:
isInline in interface ComplexType
Returns:
true if attribute is to be considered transparent by XPath queries

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.

getOperations

public Collection getOperations()

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 AttributeType getSuper()
Description copied from interface: AttributeType
Override of PropertyType.getSuper() which type narrows to AttributeType.

Specified by:
getSuper in interface AttributeType
Specified by:
getSuper in interface PropertyType
Returns:
The parent or super type, or null.
See Also:
PropertyType.getSuper()

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.

isIdentified

public boolean isIdentified()
Description copied from interface: AttributeType
Indicates if the type is identified or not.

If this method returns true, then the corresponding attribute must have a unique identifier, ie, Attribute#getID() must return a value, and cannot be null.

Specified by:
isIdentified in interface AttributeType
Returns:
true if the attribute is identified, otherwise false.
See Also:
Attribute#getID()

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.

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.

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.

equals

public boolean equals(Object o)
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

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()


Copyright © 1996-2014 Geotools. All Rights Reserved.