Interface ContentTypeItem
-
- All Known Subinterfaces:
ContentTypeChild
,ContentTypeProperty
public interface ContentTypeItem
Represents aContentType
property or child element representing an underlying NodeType Child or Property Definition.A ContentTypeItem name is always explicit, so no residual naming allowed. The underlying EffectiveNodeTypeItem (Child or Property) however may be a residual (relaxed) property or child node.
Within a ContentType its ContentTypeItem elements can be accessed by through
ContentType.getItem(String)
, or as map of property or child elements throughContentType.getProperties()
orContentType.getChildren()
.For a
ContentType.isDerivedType()
both a property and child element may be defined by the same name, in which case only the child element is accessible through theContentType.getItem(String)
method (see also JCR-2.0 5.1.8). In that case the property element by that name still can be accessed throughContentType.getProperties()
.- See Also:
ItemDefinition
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
getDefiningType()
EffectiveNodeTypeItem
getEffectiveNodeTypeItem()
String
getEffectiveType()
Map<String,List<String>>
getItemProperties()
String
getItemType()
Returns the type of this item, which may be a qualified name of a ContentType (Child) or an (enhanced variant) of a NodeType property type name.List<EffectiveNodeTypeItem>
getMultiTypes()
String
getName()
List<String>
getValidators()
boolean
isAutoCreated()
boolean
isDerivedItem()
boolean
isMandatory()
boolean
isMultiple()
boolean
isMultiTyped()
boolean
isOrdered()
boolean
isPrimaryItem()
Primary items are for instance used in imagesets to define the cms preview resource.boolean
isProperty()
boolean
isProtected()
-
-
-
Method Detail
-
getName
String getName()
- Returns:
- The qualified item name, never "*" (residual)
- See Also:
ItemDefinition.getName()
-
getDefiningType
String getDefiningType()
- Returns:
- The ContentType name which defines this item, which not necessarily is the same as the containing ContentType.
- See Also:
ItemDefinition.getDeclaringNodeType()
-
isProperty
boolean isProperty()
- Returns:
- True if this item denotes a NodeType Property, false if denotes a NodeType Child
- See Also:
getEffectiveNodeTypeItem()
-
isDerivedItem
boolean isDerivedItem()
- Returns:
- True if there is no explicit ContentTypeItem definition backing this item but it only is derived from the underlying EffectiveNodeType Child or Property
-
getItemType
String getItemType()
Returns the type of this item, which may be a qualified name of a ContentType (Child) or an (enhanced variant) of a NodeType property type name.For a
isDerivedItem()
the value fromgetEffectiveType()
will be returned.- Returns:
- The type of this item, which may be a qualified Child ContentType or an (enhanced variant) of a NodeType property
-
getEffectiveType
String getEffectiveType()
- Returns:
- The underlying
EffectiveNodeTypeItem.getType()
for this item; in case of aisMultiTyped()
returning only the first item definition its type
-
getEffectiveNodeTypeItem
EffectiveNodeTypeItem getEffectiveNodeTypeItem()
- Returns:
- The underlying EffectiveNodeTypeItem (Child or Property) for this item; in case of a
isMultiTyped()
returning only the first item definition
-
isMultiTyped
boolean isMultiTyped()
- Returns:
- true if multiple EffectiveNodeTypeItem definition are allowed for this
isDerivedItem()
- See Also:
getMultiTypes()
-
getMultiTypes
List<EffectiveNodeTypeItem> getMultiTypes()
- Returns:
- the list of all the allowed EffectiveNodeTypeItem definitions for this
isDerivedItem()
or an empty list otherwise
-
isPrimaryItem
boolean isPrimaryItem()
Primary items are for instance used in imagesets to define the cms preview resource. Since an imageset contains multiple images, one of them needs to be marked as the 'preview' variant.- Returns:
- True if this item denotes the primary item
-
isMultiple
boolean isMultiple()
- Returns:
- True for a multi-valued Property or same-name-sibling allowing Child definition
- See Also:
PropertyDefinition.isMultiple()
,NodeDefinition.allowsSameNameSiblings()
-
isMandatory
boolean isMandatory()
- Returns:
- True if this item is required
- See Also:
ItemDefinition.isMandatory()
-
isAutoCreated
boolean isAutoCreated()
- Returns:
- True if this item is autoCreated
- See Also:
ItemDefinition.isAutoCreated()
-
isProtected
boolean isProtected()
- Returns:
- True if this item is protected
- See Also:
ItemDefinition.isProtected()
-
isOrdered
boolean isOrdered()
- Returns:
- True if this item
isMultiple()
and supports ordering of its Property values or its same-name-sibling Child items.
Note: while multi-value properties are (JCR) ordered by definition, this method provides editor support for ordering prototype values or child items (if any), and only for this specific child item while the JCR hasOrderableChildren definition on NodeType level concerns all its children.
-
getValidators
List<String> getValidators()
- Returns:
- The list of validators for this item, may be empty but never null.
-
-