|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectAbstractLazyAttributeTypeImpl
public abstract class AbstractLazyAttributeTypeImpl
A replacement for AttributeTypeImpl with lazy evaluation of super type, so types can be
defined in any order. Note that type equality is defined by name, so do not allow different types
with the same name to be put in any Collection.
Inspired by AttributeTypeImpl and PropertyTypeImpl.
AttributeTypeImpl,
PropertyTypeImpl| Constructor Summary | |
|---|---|
AbstractLazyAttributeTypeImpl(Name name,
Class<?> binding,
boolean identified,
boolean isAbstract,
List<Filter> restrictions,
InternationalString description)
Constructor arguments have the same meaning as in AttributeTypeImpl. |
|
| Method Summary | |
|---|---|
abstract AttributeType |
buildSuper()
Subclasses must override this method to return the super type of this type or null if none. |
boolean |
equals(Object other)
Equality by name. |
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. |
AttributeType |
getSuper()
Override of PropertyType.getSuper() which type narrows to
AttributeType. |
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. |
String |
toString()
|
| Methods inherited from class Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractLazyAttributeTypeImpl(Name name,
Class<?> binding,
boolean identified,
boolean isAbstract,
List<Filter> restrictions,
InternationalString description)
AttributeTypeImpl.
name - binding - identified - isAbstract - restrictions - description - | Method Detail |
|---|
public abstract AttributeType buildSuper()
public boolean isIdentified()
AttributeType
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.
isIdentified in interface AttributeTypetrue if the attribute is identified, otherwise false.AttributeType.isIdentified()public AttributeType getSuper()
AttributeTypePropertyType.getSuper() which type narrows to
AttributeType.
getSuper in interface AttributeTypegetSuper in interface PropertyTypenull.AttributeType.getSuper()public Name getName()
PropertyType
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.
getName in interface PropertyTypePropertyType.getName()public Class<?> getBinding()
PropertyType
This value is never null.
getBinding in interface PropertyTypePropertyType.getBinding()public boolean isAbstract()
PropertyType
isAbstract in interface PropertyTypetrue if the type is abstract, otherwise false.PropertyType.isAbstract()public List<Filter> getRestrictions()
PropertyType
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.
getRestrictions in interface PropertyTypePropertyType.getRestrictions()public InternationalString getDescription()
PropertyType
getDescription in interface PropertyTypePropertyType.getDescription()public Map<Object,Object> getUserData()
PropertyTypeAs 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 );
getUserData in interface PropertyTypePropertyType.getUserData()public boolean equals(Object other)
equals in interface PropertyTypeequals in class Objecttrue if other is a PropertyType with the same nameObject.equals(java.lang.Object)public int hashCode()
PropertyTypePropertyType.getName().
hashCode in interface PropertyTypehashCode in class ObjectObject.hashCode()public String toString()
toString in class ObjectObject.toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||