|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jackrabbit.core.ItemValidator
public class 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 NodeTypeRegistry |
ntReg
node type registry |
protected PathResolver |
resolver
Path resolver for outputting user-friendly error messages. |
| Constructor Summary | |
|---|---|
ItemValidator(NodeTypeRegistry ntReg,
HierarchyManager hierMgr,
PathResolver resolver)
Creates a new ItemValidator instance. |
|
| Method Summary | |
|---|---|
EffectiveNodeType |
getEffectiveNodeType(NodeState state)
Helper method that builds the effective (i.e. |
java.lang.String |
safeGetJCRPath(ItemId id)
Failsafe translation of internal ItemId to JCR path for use
in error messages etc. |
java.lang.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 PathResolver resolver
| Constructor Detail |
|---|
public ItemValidator(NodeTypeRegistry ntReg,
HierarchyManager hierMgr,
PathResolver resolver)
ItemValidator instance.
ntReg - node type registryhierMgr - hierarchy managerresolver - path resolver| Method Detail |
|---|
public void validate(NodeState nodeState)
throws javax.jcr.nodetype.ConstraintViolationException,
javax.jcr.RepositoryException
nodeState - state of node to be validated
javax.jcr.nodetype.ConstraintViolationException - if any of the validations fail
javax.jcr.RepositoryException - if another error occurs
public void validate(PropertyState propState)
throws javax.jcr.nodetype.ConstraintViolationException,
javax.jcr.RepositoryException
propState - state of property to be validated
javax.jcr.nodetype.ConstraintViolationException - if any of the validations fail
javax.jcr.RepositoryException - if another error occurs
public EffectiveNodeType getEffectiveNodeType(NodeState state)
throws javax.jcr.RepositoryException
state -
javax.jcr.RepositoryExceptionpublic java.lang.String safeGetJCRPath(Path path)
Path to JCR path for use in
error messages etc.
path - path to convert
public java.lang.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 | |||||||||