|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ComplexType
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:
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 |
---|
boolean isInline()
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
Class<Collection<Property>> getBinding()
Note this method will return null if the complex type does not bind to a Java object.
getBinding
in interface AttributeType
Collection<StructuralDescriptor> getProperties()
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.
Collection<AttributeDescriptor> attributes()
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.
Collection<AssociationDescriptor> associations()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |