eu.esdihumboldt.hale.common.schema.model.impl
Class DefaultGroupPropertyDefinition
java.lang.Object
eu.esdihumboldt.hale.common.schema.model.impl.AbstractDefinition<C>
eu.esdihumboldt.hale.common.schema.model.impl.AbstractChildDefinition<GroupPropertyConstraint>
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
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 |
DefaultGroupPropertyDefinition
public DefaultGroupPropertyDefinition(QName name,
DefinitionGroup parentGroup,
boolean allowFlatten)
- Create a new group property
- Parameters:
name
- the group nameparentGroup
- the parent groupallowFlatten
- if the group may be replaced by its children- See Also:
GroupPropertyDefinition.allowFlatten()
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()
Build 2012-12-03_12-30-59
Revision 9d2dd4b0318cda9f1393b1ddd390f7f792d70a2d