public abstract class NodePropertiesTools extends Object
| Constructor and Description |
|---|
NodePropertiesTools() |
| Modifier and Type | Method and Description |
|---|---|
static void |
appendOrReplaceNodeProperty(javax.jcr.Node node,
String propertyName,
javax.jcr.Value newValue)
Given a JCR node, property and value, either:
- if the property is single-valued, replace the existing property with
the new value
- if the property is multivalued, append the new value to the property
|
static int |
getPropertyType(javax.jcr.Node node,
String propertyName)
Get the JCR property type ID for a given property name.
|
static boolean |
isMultivaluedProperty(javax.jcr.Node node,
String propertyName)
Determine if a given JCR property name is single- or multi- valued.
|
static void |
removeNodeProperty(javax.jcr.Node node,
String propertyName,
javax.jcr.Value valueToRemove)
Given a JCR node, property and value, remove the value (if it exists)
from the property, and remove the
property if no values remove
|
public static void appendOrReplaceNodeProperty(javax.jcr.Node node,
String propertyName,
javax.jcr.Value newValue)
throws javax.jcr.RepositoryException
node - the JCR nodepropertyName - a name of a JCR property (either pre-existing or
otherwise)newValue - the JCR value to insertjavax.jcr.RepositoryExceptionpublic static void removeNodeProperty(javax.jcr.Node node,
String propertyName,
javax.jcr.Value valueToRemove)
throws javax.jcr.RepositoryException
node - the JCR nodepropertyName - a name of a JCR property (either pre-existing or
otherwise)valueToRemove - the JCR value to removejavax.jcr.RepositoryExceptionpublic static int getPropertyType(javax.jcr.Node node,
String propertyName)
throws javax.jcr.RepositoryException
node - the JCR node to add the property onpropertyName - the property namejavax.jcr.RepositoryExceptionpublic static boolean isMultivaluedProperty(javax.jcr.Node node,
String propertyName)
throws javax.jcr.RepositoryException
node - the JCR node to checkpropertyName - the property name
(which may or may not already exist)javax.jcr.RepositoryExceptionCopyright © 2013 DuraSpace, Inc.. All Rights Reserved.