public interface ContentType
EffectiveNodeType
exposing only non-residual ContentTypeProperty
and ContentTypeChild
elements with additional meta-data describing these ContentTypeItems
.
A ContentType is always backed by an underlying EffectiveNodeType, and for all EffectiveNodeTypes a ContentType is provided.
For EffectiveNodeTypes which do not have a corresponding ContentType pre-defined, a ContentType definition is automatically derived, see isDerivedType()
.
The getProperties()
and getChildren()
methods provides direct access to these elements, but also can be access separately by name through getItem(String)
Note that in case of a isDerivedType()
both a ContentTypeProperty and ContentTypeChild element may be defined by the same name, in which case getItem(String)
will
only provide access to the corresponding child element (see also JCR-2.0 5.1.8).
Some pre-defined ContentTypes may represent an aggregate (isAggregate()
) which means that the ContentType also combines one or more mixin types, besides possibly having superTypes as well.
This can happen when a pre-defined ContentType is enhanced with one or more mixins after its initial definition, as well as its underlying JCR NodeType definition was created,
Currently the Jackrabbit JCR repository doesn't support adding extra mixins to an existing NodeType definition, thus for ContentTypes these must be aggregated separately.
ContentType definitions representing existing the EffectiveNodeType of an JCR Node instance can also be an aggregate if the Node instance has additional mixins besides its primary NodeType.
Modifier and Type | Method and Description |
---|---|
SortedSet<String> |
getAggregatedTypes() |
Map<String,ContentTypeChild> |
getChildren() |
EffectiveNodeType |
getEffectiveNodeType() |
ContentTypeItem |
getItem(String name)
A convenient method to directly access a defined
ContentTypeProperty or ContentTypeChild element by its name. |
String |
getName() |
String |
getPrefix() |
Map<String,ContentTypeProperty> |
getProperties() |
SortedSet<String> |
getSuperTypes() |
default List<String> |
getValidators() |
boolean |
isAggregate() |
boolean |
isCascadeValidate()
Deprecated.
Use validation as offered by the hippo-services-validation module. Cascading is then obsolete.
|
boolean |
isCompoundType() |
boolean |
isContentType(String contentTypeName) |
boolean |
isDerivedType() |
boolean |
isDocumentType() |
boolean |
isMixin() |
long |
version() |
long version()
boolean isDerivedType()
boolean isAggregate()
EffectiveNodeType getEffectiveNodeType()
NodeType
representation
which underlies this ContentType definitionString getName()
isAggregate()
javax.jcr.nodetype.NodeTypeDefinition#getName()
String getPrefix()
isAggregate()
SortedSet<String> getSuperTypes()
NodeType.getSupertypes()
SortedSet<String> getAggregatedTypes()
getName()
even if not isAggregate()
boolean isContentType(String contentTypeName)
contentTypeName
- The name of a ContentTypegetSuperTypes()
is equal to contentTypeNameNodeType.isNodeType(String)
boolean isDocumentType()
boolean isCompoundType()
boolean isMixin()
NodeTypeDefinition.isMixin()
@Deprecated boolean isCascadeValidate()
isDerivedType()
Map<String,ContentTypeProperty> getProperties()
NodeType.getChildNodeDefinitions()
Map<String,ContentTypeChild> getChildren()
NodeType.getPropertyDefinitions()
ContentTypeItem getItem(String name)
ContentTypeProperty
or ContentTypeChild
element by its name.
Note that a isDerivedType()
ContentType is allowed to have both a property and child element by the same name.
In that case this method will only provide access to the child element by that name (see also JCR-2.0 5.1.8).
The same named property element in that case can still be accessed through getProperties()
.
For not isDerivedType()
ContentTypes duplicate named properties and children are not supported, so in that case this method can be relied
upon to access all defined ContentTypeItem elements
name
- the name of a defined ContentTypeProperty
or ContentTypeChild
elementContentTypeProperty
or ContentTypeChild
element by that nameCopyright © 2012–2019 Hippo B.V. (http://www.onehippo.com). All rights reserved.