Package com.composum.sling.core.util
Class NodeUtil
- java.lang.Object
-
- com.composum.sling.core.util.NodeUtil
-
public class NodeUtil extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringFORBIDDEN_NAME_CHARSstatic StringJCR_TITLE
-
Constructor Summary
Constructors Constructor Description NodeUtil()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetId(javax.jcr.Node node)Retrieves the nodes id.static StringgetNodeTitle(javax.jcr.Node node)Retrieves the 'jcr:title' property value from a nodestatic StringgetTitle(javax.jcr.Node node)Retrieves the title with a fallback to the nodes name.static booleanisNodeType(javax.jcr.Node node, String... nodeType)static StringmangleNodeName(String name)TODO(rw,2015-04-22) not useful in the core layer
-
-
-
Field Detail
-
JCR_TITLE
public static final String JCR_TITLE
- See Also:
- Constant Field Values
-
FORBIDDEN_NAME_CHARS
public static final String FORBIDDEN_NAME_CHARS
- See Also:
- Constant Field Values
-
-
Method Detail
-
getId
public String getId(javax.jcr.Node node)
Retrieves the nodes id.- Returns:
- a hopefully useful ID (not
null)
-
getTitle
public static String getTitle(javax.jcr.Node node)
Retrieves the title with a fallback to the nodes name.- Parameters:
node-- Returns:
- the usable title (not blank)
-
getNodeTitle
public static String getNodeTitle(javax.jcr.Node node)
Retrieves the 'jcr:title' property value from a node- Parameters:
node-- Returns:
- the title value or
nullif not present
-
mangleNodeName
public static String mangleNodeName(String name)
TODO(rw,2015-04-22) not useful in the core layer- Parameters:
name-- Returns:
-
isNodeType
public static boolean isNodeType(javax.jcr.Node node, String... nodeType) throws javax.jcr.RepositoryException- Throws:
javax.jcr.RepositoryException
-
-