public class DefaultTypeDefinition extends AbstractDefinition<TypeConstraint> implements TypeDefinition
TypeDefinition
implementation.name
Constructor and Description |
---|
DefaultTypeDefinition(QName name)
Create a type definition with the given name
|
Modifier and Type | Method and Description |
---|---|
void |
addChild(ChildDefinition<?> child)
Add a declared child, this is called by the
AbstractChildDefinition constructor. |
protected void |
addSubType(DefaultTypeDefinition subtype)
Add a sub-type
|
ChildDefinition<?> |
getChild(QName name)
Get the child with the given name
|
Collection<? extends ChildDefinition<?>> |
getChildren()
Get all children that an instance of the type may have.
|
Collection<? extends ChildDefinition<?>> |
getDeclaredChildren()
Get the properties and property groups declared by the type
|
String |
getIdentifier()
Get the definitions identifier
|
protected Map<QName,ChildDefinition<?>> |
getInheritedChildren()
Get the unmodifiable map of inherited children.
|
protected <T extends TypeConstraint> |
getInheritedConstraint(Class<T> constraintType)
Get the inherited constraint of the given constraint type.
This implementation returns null , as inheritance is not
supported generally for definitions. |
Collection<? extends DefaultTypeDefinition> |
getSubTypes()
Get the sub types
|
DefaultTypeDefinition |
getSuperType()
Get the super type
|
protected void |
removeSubType(DefaultTypeDefinition subtype)
Remove a sub-type
|
void |
setSuperType(DefaultTypeDefinition superType)
Set the type's super type.
|
String |
toString() |
compareTo, equals, getConstraint, getDescription, getDisplayName, getLocation, getName, hasConstraint, hashCode, setConstraint, setConstraintIfNotSet, setDescription, setLocation
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getConstraint, getDescription, getDisplayName, getName
getLocation
compareTo
public DefaultTypeDefinition(QName name)
name
- the type namepublic String getIdentifier()
Definition
getIdentifier
in interface Definition<TypeConstraint>
getIdentifier
in interface DefinitionGroup
getIdentifier
in class AbstractDefinition<TypeConstraint>
Definition.getIdentifier()
public Collection<? extends ChildDefinition<?>> getDeclaredChildren()
DefinitionGroup
getDeclaredChildren
in interface DefinitionGroup
DefinitionGroup.getDeclaredChildren()
public void addChild(ChildDefinition<?> child)
DefinitionGroup
AbstractChildDefinition
constructor.addChild
in interface DefinitionGroup
child
- the child definitionDefinitionGroup.addChild(ChildDefinition)
protected Map<QName,ChildDefinition<?>> getInheritedChildren()
public Collection<? extends ChildDefinition<?>> getChildren()
getChildren
in interface TypeDefinition
TypeDefinition.getChildren()
protected <T extends TypeConstraint> T getInheritedConstraint(Class<T> constraintType)
AbstractDefinition
null
, as inheritance is not
supported generally for definitions.getInheritedConstraint
in class AbstractDefinition<TypeConstraint>
constraintType
- the constraint typenull
if there is none or
inheritance is not allowedAbstractDefinition.getInheritedConstraint(Class)
public DefaultTypeDefinition getSuperType()
TypeDefinition
getSuperType
in interface TypeDefinition
null
TypeDefinition.getSuperType()
public void setSuperType(DefaultTypeDefinition superType)
superType
- the super-type to setprotected void removeSubType(DefaultTypeDefinition subtype)
subtype
- the sub-type to removesetSuperType(DefaultTypeDefinition)
protected void addSubType(DefaultTypeDefinition subtype)
subtype
- the sub-type to addsetSuperType(DefaultTypeDefinition)
public Collection<? extends DefaultTypeDefinition> getSubTypes()
TypeDefinition
getSubTypes
in interface TypeDefinition
TypeDefinition.getSubTypes()
public ChildDefinition<?> getChild(QName name)
getChild
in interface DefinitionGroup
name
- the child namenull
if no child with the
given name is availableDefinitionGroup.getChild(QName)
public String toString()
toString
in class AbstractDefinition<TypeConstraint>
AbstractDefinition.toString()
Build 2013-10-07_11-27-38
Revision 99b27713a799a59a21b0b166eaaea8aaefbf125a