Interface ContentTypeItem

All Known Subinterfaces:
ContentTypeChild, ContentTypeProperty

public interface ContentTypeItem
Represents a ContentType 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 through ContentType.getProperties() or ContentType.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 the ContentType.getItem(String) method (see also JCR-2.0 5.1.8). In that case the property element by that name still can be accessed through ContentType.getProperties().

See Also:
  • Method Details

    • getName

      String getName()
      Returns:
      The qualified item name, never "*" (residual)
      See Also:
    • getDefiningType

      String getDefiningType()
      Returns:
      The ContentType name which defines this item, which not necessarily is the same as the containing ContentType.
      See Also:
    • isProperty

      boolean isProperty()
      Returns:
      True if this item denotes a NodeType Property, false if denotes a NodeType Child
      See Also:
    • 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 from getEffectiveType() 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 a isMultiTyped() 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

      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:
    • isMandatory

      boolean isMandatory()
      Returns:
      True if this item is required
      See Also:
    • isAutoCreated

      boolean isAutoCreated()
      Returns:
      True if this item is autoCreated
      See Also:
    • isProtected

      boolean isProtected()
      Returns:
      True if this item is protected
      See Also:
    • 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.
    • getItemProperties

      Map<String,List<String>> getItemProperties()
      Returns:
      The immutable map of item type specific properties, keyed on property name. The property values may be empty, single or multi-valued but never null. The returned map itself may be empty but never null.