|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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. merged and resolved) node type representation of the specified node's primary and mixin node types. |
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 PathResolver resolver
Constructor Detail |
---|
public ItemValidator(NodeTypeRegistry ntReg, HierarchyManager hierMgr, PathResolver resolver)
ItemValidator
instance.
ntReg
- node type registryhierMgr
- hierarchy managerresolver
- path 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 state) throws RepositoryException
state
-
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 |