Class PropertyTypeImpl
- All Implemented Interfaces:
PropertyType
- Direct Known Subclasses:
AssociationTypeImpl
,AttributeTypeImpl
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Class<?>
protected final InternationalString
protected final boolean
protected final Name
protected final PropertyType
-
Constructor Summary
ConstructorsConstructorDescriptionPropertyTypeImpl
(Name name, Class<?> binding, boolean isAbstract, List<Filter> restrictions, PropertyType superType, InternationalString description) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Equality based on propertyPropertyType.getName()
.Class<?>
The java class that values of properties of the property type are bound to.Human readable description of this property type.getName()
The name of the property type.List of restrictions used define valid values for properties of this property type.getSuper()
The parent type of the property type.A map of "user data" which enables applications to store "application-specific" information against a property type.int
hashCode()
Hashcode override based onPropertyType.getName()
.boolean
Flag indicating if the type is abstract or not.toString()
-
Field Details
-
name
-
binding
-
isAbstract
protected final boolean isAbstract -
superType
-
restrictions
-
description
-
userData
-
-
Constructor Details
-
PropertyTypeImpl
public PropertyTypeImpl(Name name, Class<?> binding, boolean isAbstract, List<Filter> restrictions, PropertyType superType, InternationalString description)
-
-
Method Details
-
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 interfacePropertyType
- Returns:
- The name of the property type.
-
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 interfacePropertyType
- 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 interfacePropertyType
- Returns:
true
if the type is abstract, otherwisefalse
.
-
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. IfFilter.evaluate(Object)
returnstrue
the restriction is met. Iffalse
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 interfacePropertyType
- Returns:
- List
used to validate allowable values.
-
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 interfacePropertyType
- Returns:
- The parent or super type, or
null
.
-
getDescription
Description copied from interface:PropertyType
Human readable description of this property type.- Specified by:
getDescription
in interfacePropertyType
- Returns:
- Human readable description of this property type.
-
hashCode
public int hashCode()Description copied from interface:PropertyType
Hashcode override based onPropertyType.getName()
.- Specified by:
hashCode
in interfacePropertyType
- Overrides:
hashCode
in classObject
- Returns:
- getName().hashCode()
-
equals
Description copied from interface:PropertyType
Equality based on propertyPropertyType.getName()
.- Specified by:
equals
in interfacePropertyType
- Overrides:
equals
in classObject
- Returns:
true
if other is a PropertyType with the same name
-
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 interfacePropertyType
- Returns:
- A map of user data.
-
toString
-