|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.jackrabbit.core.ItemValidator
Utility class for validating an item against constraints specified by its definition.
Field Summary | |
protected HierarchyManager |
hierMgr
hierarchy manager used for generating error msg's that contain human readable paths |
protected NamespaceResolver |
nsResolver
namespace resolver used for generating error msg's that contain human readable paths |
protected NodeTypeRegistry |
ntReg
node type registry |
Constructor Summary | |
ItemValidator(NodeTypeRegistry ntReg,
HierarchyManager hierMgr,
NamespaceResolver nsResolver)
Creates a new ItemValidator instance. |
Method Summary | |
EffectiveNodeType |
getEffectiveNodeType(NodeState nodeState)
Helper method that builds the effective (i.e. |
String |
safeGetJCRPath(ItemId id)
Failsafe translation of internal ItemId to JCR path for use
in error messages etc. |
String |
safeGetJCRPath(Path path)
Failsafe conversion of internal Path to JCR path for use in
error messages etc. |
void |
validate(NodeState nodeState)
Checks whether the given node state satisfies the constraints specified by its primary and mixin node types. |
void |
validate(PropertyState propState)
Checks whether the given property state satisfies the constraints specified by its definition. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected final NodeTypeRegistry ntReg
protected final HierarchyManager hierMgr
safeGetJCRPath(ItemId)
protected final NamespaceResolver nsResolver
safeGetJCRPath(Path)
Constructor Detail |
public ItemValidator(NodeTypeRegistry ntReg, HierarchyManager hierMgr, NamespaceResolver nsResolver)
ItemValidator
instance.
ntReg
- node type registryhierMgr
- hierarchy managernsResolver
- namespace resolverMethod Detail |
public void validate(NodeState nodeState) throws ConstraintViolationException, RepositoryException
nodeState
- state of node to be validated
ConstraintViolationException
- if any of the validations fail
RepositoryException
- if another error occurspublic void validate(PropertyState propState) throws ConstraintViolationException, RepositoryException
propState
- state of property to be validated
ConstraintViolationException
- if any of the validations fail
RepositoryException
- if another error occurspublic EffectiveNodeType getEffectiveNodeType(NodeState nodeState) throws RepositoryException
nodeState
-
RepositoryException
public String safeGetJCRPath(Path path)
Path
to JCR path for use in
error messages etc.
path
- path to convert
public String safeGetJCRPath(ItemId id)
ItemId
to JCR path for use
in error messages etc.
id
- id to translate
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |