Interface ContentTypes
public interface ContentTypes
A lightweight and immutable representation of the ContentType definitions.
If the model is still 'current' its version property can be compared against the current version provided by the
ContentTypeService
.-
Method Summary
Modifier and TypeMethodDescriptiongetContentTypeForNode
(Node node) Returns the effective ContentType representation for a specific NodegetContentTypeForNodeByPath
(Session session, String path) Returns the effective ContentType representation for an existing Node identified by its absolute pathgetContentTypeForNodeByUuid
(Session session, String uuid) Returns the effective ContentType representation for an existing Node identified by its uuidlong
version()
-
Method Details
-
getEffectiveNodeTypes
EffectiveNodeTypes getEffectiveNodeTypes()- Returns:
- The EffectiveNodeTypes used by this ContentTypes instance.
-
version
long version()- Returns:
- The immutable instance version which is automatically incremented for every new (changed) ContentTypes instance created by the ContentTypeService
-
getType
- Parameters:
name
- Qualified Name for a ContentType (see JCR-2.0 3.2.5.2)- Returns:
- The immutable ContentType definition
-
getTypesByPrefix
SortedMap<String,Set<ContentType>> getTypesByPrefix()- Returns:
- The immutable map of ContentTypes grouped and sorted by their namespace prefix as key and their elements ordered (but not sorted) by their name
-
getContentTypeForNode
Returns the effective ContentType representation for a specific Node- Parameters:
node
- The Node for which to retrieve the ContentType representation- Returns:
- the ContentType representation for a specific Node
- Throws:
RepositoryException
- if a repository error occurs
-
getContentTypeForNodeByUuid
ContentType getContentTypeForNodeByUuid(Session session, String uuid) throws ItemNotFoundException, RepositoryException Returns the effective ContentType representation for an existing Node identified by its uuidThe existence and allowed read access to the Node is first checked through the provided Session.
- Parameters:
session
- An active repository Sessionuuid
- An existing Node uuid- Returns:
- the ContentType representation for an existing Node identified by its uuid
- Throws:
ItemNotFoundException
- if node doesn't exist or is not accessibleRepositoryException
- if another error occurs
-
getContentTypeForNodeByPath
ContentType getContentTypeForNodeByPath(Session session, String path) throws PathNotFoundException, RepositoryException Returns the effective ContentType representation for an existing Node identified by its absolute pathThe existence and allowed read access to the Node is first checked through the provided Session.
- Parameters:
session
- An active repository Sessionpath
- The absolute path of an existing Node- Returns:
- the ContentType representation for an existing Node identified by its absolute path
- Throws:
PathNotFoundException
- if node doesn't exist or is not accessibleRepositoryException
- if a repository error occurs
-