Humboldt Alignment Editor 2.5.0

eu.esdihumboldt.hale.common.schema.model.impl
Class AbstractPropertyDecorator

java.lang.Object
  extended by eu.esdihumboldt.hale.common.schema.model.impl.AbstractPropertyDecorator
All Implemented Interfaces:
Locatable, ChildDefinition<PropertyConstraint>, Definition<PropertyConstraint>, PropertyDefinition, Comparable<Definition<?>>
Direct Known Subclasses:
ConstraintOverrideProperty, RedeclareProperty, ReparentProperty

@Immutable
public abstract class AbstractPropertyDecorator
extends Object
implements PropertyDefinition

Abstract decorator for PropertyDefinitions

Author:
Simon Templer

Field Summary
protected  PropertyDefinition property
          The internal property definition
 
Constructor Summary
AbstractPropertyDecorator(PropertyDefinition property)
          Create a property definition decorator
 
Method Summary
 GroupPropertyDefinition asGroup()
          Return as a group definition is possible.
 PropertyDefinition asProperty()
          Return as a property definition is possible.
 int compareTo(Definition<?> o)
           
<T extends PropertyConstraint>
T
getConstraint(Class<T> constraintType)
          Get the constraint with the given constraint type.
Should usually not be called while creating the model, exceptions can be getting mutable constraints where this is intended.
 DefinitionGroup getDeclaringGroup()
          Get the definition of the group declaring the property.
 String getDescription()
          Get the definition description
 String getDisplayName()
          Get the definition's display name
 String getIdentifier()
          Get the definitions identifier
 URI getLocation()
          Get the location
 QName getName()
          Get the definition's qualified name
 TypeDefinition getParentType()
          Get the parent type of the child.
 TypeDefinition getPropertyType()
          Get the type associated with the property
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

property

protected final PropertyDefinition property
The internal property definition

Constructor Detail

AbstractPropertyDecorator

public AbstractPropertyDecorator(PropertyDefinition property)
Create a property definition decorator

Parameters:
property - the internal property definition
Method Detail

compareTo

public int compareTo(Definition<?> o)
Specified by:
compareTo in interface Comparable<Definition<?>>
See Also:
Comparable.compareTo(Object)

getLocation

public URI getLocation()
Description copied from interface: Locatable
Get the location

Specified by:
getLocation in interface Locatable
Returns:
the location, may be null
See Also:
Locatable.getLocation()

getIdentifier

public String getIdentifier()
Description copied from interface: Definition
Get the definitions identifier

Specified by:
getIdentifier in interface Definition<PropertyConstraint>
Returns:
the unique name of the definition
See Also:
Definition.getIdentifier()

getDisplayName

public String getDisplayName()
Description copied from interface: Definition
Get the definition's display name

Specified by:
getDisplayName in interface Definition<PropertyConstraint>
Returns:
the display name
See Also:
Definition.getDisplayName()

getName

public QName getName()
Description copied from interface: Definition
Get the definition's qualified name

Specified by:
getName in interface Definition<PropertyConstraint>
Returns:
the qualified name
See Also:
Definition.getName()

getDescription

public String getDescription()
Description copied from interface: Definition
Get the definition description

Specified by:
getDescription in interface Definition<PropertyConstraint>
Returns:
the description string or null
See Also:
Definition.getDescription()

getConstraint

public <T extends PropertyConstraint> T getConstraint(Class<T> constraintType)
Description copied from interface: Definition
Get the constraint with the given constraint type.
Should usually not be called while creating the model, exceptions can be getting mutable constraints where this is intended.

Specified by:
getConstraint in interface Definition<PropertyConstraint>
Type Parameters:
T - the constraint type
Parameters:
constraintType - the constraint type, see Constraint
Returns:
the constraint with the given type
See Also:
Definition.getConstraint(Class)

getDeclaringGroup

public DefinitionGroup getDeclaringGroup()
Description copied from interface: ChildDefinition
Get the definition of the group declaring the property.

Specified by:
getDeclaringGroup in interface ChildDefinition<PropertyConstraint>
Returns:
the group declaring the property
See Also:
ChildDefinition.getDeclaringGroup()

getParentType

public TypeDefinition getParentType()
Description copied from interface: ChildDefinition
Get the parent type of the child. This can either be the declaring type or a sub-type.

Specified by:
getParentType in interface ChildDefinition<PropertyConstraint>
Returns:
the parent type of the property
See Also:
ChildDefinition.getParentType()

getPropertyType

public TypeDefinition getPropertyType()
Description copied from interface: PropertyDefinition
Get the type associated with the property

Specified by:
getPropertyType in interface PropertyDefinition
Returns:
the property type
See Also:
PropertyDefinition.getPropertyType()

asProperty

public PropertyDefinition asProperty()
Description copied from interface: ChildDefinition
Return as a property definition is possible. This is convenience for avoiding casts and instanceof expressions when handling children.

Specified by:
asProperty in interface ChildDefinition<PropertyConstraint>
Returns:
a property definition if this child definition is one, otherwise null
See Also:
ChildDefinition.asProperty()

asGroup

public GroupPropertyDefinition asGroup()
Description copied from interface: ChildDefinition
Return as a group definition is possible. This is convenience for avoiding casts and instanceof expressions when handling children.

Specified by:
asGroup in interface ChildDefinition<PropertyConstraint>
Returns:
a group definition if this child definition is one, otherwise null
See Also:
ChildDefinition.asGroup()

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()

Humboldt Alignment Editor 2.5.0

Build 2012-12-03_12-30-59
Revision 9d2dd4b0318cda9f1393b1ddd390f7f792d70a2d