Humboldt Alignment Editor 2.5.0

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

java.lang.Object
  extended by eu.esdihumboldt.hale.common.schema.model.impl.AbstractDefinition<C>
      extended by eu.esdihumboldt.hale.common.schema.model.impl.AbstractChildDefinition<GroupPropertyConstraint>
          extended by eu.esdihumboldt.hale.common.schema.model.impl.DefaultGroupPropertyDefinition
All Implemented Interfaces:
Locatable, ChildDefinition<GroupPropertyConstraint>, Definition<GroupPropertyConstraint>, DefinitionGroup, GroupPropertyDefinition, Comparable<Definition<?>>
Direct Known Subclasses:
LazyGroupPropertyDefinition

public class DefaultGroupPropertyDefinition
extends AbstractChildDefinition<GroupPropertyConstraint>
implements GroupPropertyDefinition

Default GroupPropertyDefinition implementation

Author:
Simon Templer

Field Summary
 
Fields inherited from class eu.esdihumboldt.hale.common.schema.model.impl.AbstractDefinition
name
 
Constructor Summary
DefaultGroupPropertyDefinition(QName name, DefinitionGroup parentGroup, boolean allowFlatten)
          Create a new group property
 
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.
 ChildDefinition<?> getChild(QName name)
          Get the child with the given name
 Collection<? extends ChildDefinition<?>> getDeclaredChildren()
          Get the properties and property groups declared by the type
 String toString()
           
 
Methods inherited from class eu.esdihumboldt.hale.common.schema.model.impl.AbstractChildDefinition
getDeclaringGroup, getIdentifier, getParentType
 
Methods inherited from class eu.esdihumboldt.hale.common.schema.model.impl.AbstractDefinition
compareTo, equals, getConstraint, getDescription, getDisplayName, getInheritedConstraint, getLocation, getName, hasConstraint, hashCode, setConstraint, setConstraintIfNotSet, setDescription, setLocation
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface eu.esdihumboldt.hale.common.schema.model.DefinitionGroup
getIdentifier
 
Methods inherited from interface eu.esdihumboldt.hale.common.schema.model.ChildDefinition
getDeclaringGroup, getParentType
 
Methods inherited from interface eu.esdihumboldt.hale.common.schema.model.Definition
getConstraint, getDescription, getDisplayName, getIdentifier, getName
 
Methods inherited from interface eu.esdihumboldt.hale.common.core.io.supplier.Locatable
getLocation
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

DefaultGroupPropertyDefinition

public DefaultGroupPropertyDefinition(QName name,
                                      DefinitionGroup parentGroup,
                                      boolean allowFlatten)
Create a new group property

Parameters:
name - the group name
parentGroup - the parent group
allowFlatten - if the group may be replaced by its children
See Also:
GroupPropertyDefinition.allowFlatten()
Method Detail

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()

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)

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()

toString

public String toString()
Overrides:
toString in class AbstractDefinition<GroupPropertyConstraint>
See Also:
AbstractDefinition.toString()

Humboldt Alignment Editor 2.5.0

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