public interface ITypeDescriptor extends org.apache.wicket.util.io.IClusterable, IObservable
One refinement over the JCR type system is the use of 'pseudo-types'. These types do not directly correspond to JCR types, but instead use a different type for their storage (the 'real' type). This allows additional semantics to be provided on top of simpler storage, and is usually also represented differently in the document editor.
The mutator methods / setters can only be used in a type editing context such as the document type editor. In other cases, the type should be considered immutable and the mutator methods may not be invoked.
Modifier and Type | Method and Description |
---|---|
void |
addField(IFieldDescriptor descriptor)
Add a field to the type.
|
Map<String,IFieldDescriptor> |
getDeclaredFields()
The map of fields that are declared in this type.
|
IFieldDescriptor |
getField(String key)
Retrieve the field associated with a key.
|
Map<String,IFieldDescriptor> |
getFields()
The map of fields that are declared in this type of any of its super types.
|
String |
getName()
The name of the type.
|
List<ITypeDescriptor> |
getSubTypes()
Retrieve all types that descend from the type.
|
List<String> |
getSuperTypes()
The super types of the type.
|
String |
getType()
The name of the underlying type can be different if this is a "pseudo" type.
|
boolean |
isMixin()
Does the type correspond to a mixin, i.e.
|
boolean |
isNode()
Is the type a compound or mixin type, corresponding to a node type.
|
boolean |
isType(String typeName)
Returns true if this type is
typeName
or a subtype of typeName , otherwise returns
false . |
boolean |
isValidationCascaded()
Returns true if validation is cascaded, i.e.
|
void |
removeField(String name)
Remove a field from the type.
|
void |
setIsMixin(boolean isMixin) |
void |
setIsNode(boolean isNode) |
void |
setIsValidationCascaded(boolean isCascaded) |
void |
setPrimary(String name)
Declare one of the fields to be the primary item.
|
void |
setSuperTypes(List<String> superTypes)
Set the super types of the type.
|
equals, hashCode, setObservationContext, startObservation, stopObservation
String getName()
String getType()
For type descriptors that do not correspond to current or draft versions of a namespace, the prefix will be the JCR prefix. (E.g. myproject_0_0 when version 0.1 is current)
List<String> getSuperTypes()
List<ITypeDescriptor> getSubTypes()
Map<String,IFieldDescriptor> getFields()
Map<String,IFieldDescriptor> getDeclaredFields()
IFieldDescriptor getField(String key)
key
- boolean isNode()
boolean isMixin()
boolean isType(String typeName)
typeName
or a subtype of typeName
, otherwise returns
false
.typeName
- the name of a node type.boolean isValidationCascaded()
void setSuperTypes(List<String> superTypes)
superTypes
- the list of super typesvoid addField(IFieldDescriptor descriptor) throws TypeException
descriptor
- the field that is added to the typeTypeException
void removeField(String name) throws TypeException
name
- the name of the field that is removedTypeException
void setPrimary(String name)
name
- void setIsNode(boolean isNode)
void setIsMixin(boolean isMixin)
void setIsValidationCascaded(boolean isCascaded)
isCascaded
- are fields of this type always validatedCopyright © 2007–2017 Hippo B.V. (http://www.onehippo.com). All rights reserved.