org.opengis.feature.type
Interface ComplexType

All Superinterfaces:
AttributeType, PropertyType
All Known Subinterfaces:
FeatureCollectionType, FeatureType, SimpleFeatureCollectionType, SimpleFeatureType

public interface ComplexType
extends AttributeType

Represents an AttirbuteType with interesting internal structure made available as properties.

When creating a wrapper for an existing java domain model the use of ComplexType is optional; the interface allows you to make available to the dynamic type system additional attributes, associations and operations. By making this detail available your feature model will be more rich and capable.

There are two kinds of properties that may be used to compose a complex type:

When choosing between attribute and associations - just answer this question. Is the value removed when you delete? If it is removed the value is an attribute, if it is an attribute, if the value would still be around you should model it with an association.


Method Summary
 Collection<AssociationDescriptor> associations()
          Allowable associations, indicating non containment relationships.
 Collection<AttributeDescriptor> attributes()
          Describes allowable content, indicating containment.
 Class<Collection<Property>> getBinding()
          Java class bound to this complex type.
 Collection<StructuralDescriptor> getProperties()
          Returns the only the structural properties (Attributes and Associations) used to define this type.
 boolean isInline()
          Indicates ability of XPath to notice this attribute.
 
Methods inherited from interface AttributeType
getOperations, getRestrictions, getSuper, isAbstract, isIdentified
 
Methods inherited from interface PropertyType
equals, getDescription, getName, getUserData, hashCode, putUserData
 

Method Detail

isInline

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

Returns:
true if attribute is to be considered transparent by XPath queries

getBinding

Class<Collection<Property>> getBinding()
Java class bound to this complex type.

Note this method will return null if the complex type does not bind to a Java object.

Specified by:
getBinding in interface AttributeType
Returns:
Java binding, or null if not applicable

getProperties

Collection<StructuralDescriptor> getProperties()
Returns the only the structural properties (Attributes and Associations) used to define this type.

We are not including the OperationDescriptors in this list as they do not vary on a instance by instance basis. The difference between a ComplexType and a AttributeType is the notion of inner structure represented by this method.

You may access "views" of this information using the attributes() and associations() methods.

Returns:
Collection of StructuralDescriptors describing allowable contents

attributes

Collection<AttributeDescriptor> attributes()
Describes allowable content, indicating containment.

A collection of AttributeDescriptors (name and AttributeType) is used. We make no restrictions as to attribute order. All attributes are considered accessable by name (and order is thus insignificant).

If you are modling a typing system where attribute order is relevant you may make use of a List. Similarly if duplicate attributes are disallowed you may make use of a Set.

This method follows JavaBeans naming convention indicating this is part of our data model.


associations

Collection<AssociationDescriptor> associations()
Allowable associations, indicating non containment relationships.



Copyright © 1994-2008 Open Geospatial Consortium. All Rights Reserved.