|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.hippoecm.hst.util.NodeUtils
public class NodeUtils
NodeUtils
Constructor Summary | |
---|---|
NodeUtils()
|
Method Summary | |
---|---|
static javax.jcr.Node |
getCanonicalNode(javax.jcr.Node node)
Returns the canonical version of this node, and null when there is no canonical node |
static javax.jcr.Node |
getCanonicalNode(javax.jcr.Node node,
javax.jcr.Node defaultNode)
Deprecated. use getCanonicalNode(Node) instead |
static javax.jcr.Node |
getDeref(javax.jcr.Node mirrorNode)
|
static boolean |
isDereferenceable(javax.jcr.Node node)
Checks if the node is dereferenceable. |
static boolean |
isNodeType(javax.jcr.Node node,
String... nodeTypeNames)
Checks if the node is type of any of the nodeTypeNames . |
static boolean |
isNodeType(javax.jcr.Node node,
String nodeTypeName)
Checks if the node is type of the nodeTypeName . |
static boolean |
isPrimaryNodeType(javax.jcr.Node node,
String... primaryNodeTypeNames)
Checks if the primary nodetype of node is equal to one of the supplied primaryNodeTypeNames . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NodeUtils()
Method Detail |
---|
public static javax.jcr.Node getCanonicalNode(javax.jcr.Node node)
null
when there is no canonical node
node
-
null
when there is no canonical node.
RuntimeException
- when the repository throws a general repository exception@Deprecated public static javax.jcr.Node getCanonicalNode(javax.jcr.Node node, javax.jcr.Node defaultNode)
getCanonicalNode(Node)
instead
defaultNode
when there is no canonical node
node
- defaultNode
-
defaultNode
when there is no canonical node.
RuntimeException
- when the repository throws a general repository exceptionpublic static boolean isDereferenceable(javax.jcr.Node node) throws javax.jcr.RepositoryException
node
is dereferenceable.
When the node
is type of either "hippo:facetselect" or "hippo:mirror" (or subtype of one of these),
the node is regarded as dereferenceable and the dereferenced node can be retrieved
by using getDeref(Node)
method.
node
-
true
when the node is dereferenceable
javax.jcr.RepositoryException
public static javax.jcr.Node getDeref(javax.jcr.Node mirrorNode)
mirrorNode
-
null
when the mirrorNode is not a dereferenceable type or when no dereferenced node can be foundpublic static boolean isNodeType(javax.jcr.Node node, String nodeTypeName) throws javax.jcr.RepositoryException
node
is type of the nodeTypeName
.
Returns true
if this node is of the specified primary node
type or mixin type, or a subtype thereof of the nodeTypeName
. Returns false
otherwise. Also see Node.isNodeType(String)
node
- nodeTypeName
-
true
when node
is of the specified primary node type or mixin type,
or a subtype thereof of any of the nodeTypeName
javax.jcr.RepositoryException
public static boolean isNodeType(javax.jcr.Node node, String... nodeTypeNames) throws javax.jcr.RepositoryException
node
is type of any of the nodeTypeNames
.
Returns true
if this node is of the specified primary node
type or mixin type, or a subtype thereof of any of the nodeTypeNames
. Returns false
otherwise. Also see Node.isNodeType(String)
node
- the jcr nodenodeTypeNames
- the list of nodeTypeNames
to check.
true
when node
is of the specified primary node type or mixin type,
or a subtype thereof of any of the nodeTypeNames
. If the node
is null
then
false
is returned
javax.jcr.RepositoryException
public static boolean isPrimaryNodeType(javax.jcr.Node node, String... primaryNodeTypeNames) throws javax.jcr.RepositoryException
node
is equal to one of the supplied primaryNodeTypeNames
.
It returns true if node.getPrimaryNodeType().getName().equals(primaryNodeTypeName) returns true
for any of the
primaryNodeTypeNames
node
- primaryNodeTypeNames
-
true
if node.getPrimaryNodeType().getName().equals(primaryNodeTypeName)
returns true
for any of the primaryNodeTypeNames
javax.jcr.RepositoryException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |