Humboldt Alignment Editor 2.5.0

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

java.lang.Object
  extended by eu.esdihumboldt.hale.common.schema.model.impl.AbstractGroupPropertyDecorator
All Implemented Interfaces:
Locatable, ChildDefinition<GroupPropertyConstraint>, Definition<GroupPropertyConstraint>, DefinitionGroup, GroupPropertyDefinition, Comparable<Definition<?>>
Direct Known Subclasses:
ConstraintOverrideGroupProperty, RedeclareGroupProperty, ReparentGroupProperty

@Immutable
public abstract class AbstractGroupPropertyDecorator
extends Object
implements GroupPropertyDefinition

Abstract decorator for GroupPropertyDefinitions

Author:
Simon Templer

Field Summary
protected  GroupPropertyDefinition propertyGroup
          The internal property definition
 
Constructor Summary
AbstractGroupPropertyDecorator(GroupPropertyDefinition propertyGroup)
          Create a property group definition decorator
 
Method Summary
 void addChild(ChildDefinition<?> child)
          Add a declared child, this is called by the AbstractChildDefinition constructor.
 boolean allowFlatten()
          States if the group may be flattened, i.e.
 GroupPropertyDefinition asGroup()
          Return as a group definition is possible.
 PropertyDefinition asProperty()
          Return as a property definition is possible.
 int compareTo(Definition<?> o)
           
 ChildDefinition<?> getChild(QName name)
          Get the child with the given name
<T extends GroupPropertyConstraint>
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.
 Collection<? extends ChildDefinition<?>> getDeclaredChildren()
          Get the properties and property groups declared by the type
 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 group identifier
 URI getLocation()
          Get the location
 QName getName()
          Get the definition's qualified name
 TypeDefinition getParentType()
          Get the parent type of the child.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

propertyGroup

protected final GroupPropertyDefinition propertyGroup
The internal property definition

Constructor Detail

AbstractGroupPropertyDecorator

public AbstractGroupPropertyDecorator(GroupPropertyDefinition propertyGroup)
Create a property group definition decorator

Parameters:
propertyGroup - the internal property group 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: DefinitionGroup
Get the group identifier

Specified by:
getIdentifier in interface Definition<GroupPropertyConstraint>
Specified by:
getIdentifier in interface DefinitionGroup
Returns:
the unique name of the group
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<GroupPropertyConstraint>
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<GroupPropertyConstraint>
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<GroupPropertyConstraint>
Returns:
the description string or null
See Also:
Definition.getDescription()

getDeclaringGroup

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

Specified by:
getDeclaringGroup in interface ChildDefinition<GroupPropertyConstraint>
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<GroupPropertyConstraint>
Returns:
the parent type of the property
See Also:
ChildDefinition.getParentType()

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<GroupPropertyConstraint>
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<GroupPropertyConstraint>
Returns:
a group definition if this child definition is one, otherwise null
See Also:
ChildDefinition.asGroup()

getDeclaredChildren

public Collection<? extends ChildDefinition<?>> getDeclaredChildren()
Description copied from interface: DefinitionGroup
Get the properties and property groups declared by the type

Specified by:
getDeclaredChildren in interface DefinitionGroup
Returns:
the definitions of the declared properties and groups
See Also:
DefinitionGroup.getDeclaredChildren()

getChild

public ChildDefinition<?> getChild(QName name)
Description copied from interface: DefinitionGroup
Get the child with the given name

Specified by:
getChild in interface DefinitionGroup
Parameters:
name - the child name
Returns:
the child definition or null if no child with the given name is available
See Also:
DefinitionGroup.getChild(QName)

addChild

public void addChild(ChildDefinition<?> child)
Description copied from interface: DefinitionGroup
Add a declared child, this is called by the AbstractChildDefinition constructor.

Specified by:
addChild in interface DefinitionGroup
Parameters:
child - the child definition
See Also:
DefinitionGroup.addChild(ChildDefinition)

getConstraint

public <T extends GroupPropertyConstraint> 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<GroupPropertyConstraint>
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)

allowFlatten

public boolean allowFlatten()
Description copied from interface: GroupPropertyDefinition
States if the group may be flattened, i.e. that the group's children may be added to the group's parent instead of itself.
This can be reasonable for groups that are only created because at creation time the children are not yet determined.

Specified by:
allowFlatten in interface GroupPropertyDefinition
Returns:
if the group may be replaced by its children
See Also:
GroupPropertyDefinition.allowFlatten()

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