public class NodePropertiesTools extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
REFERENCE_PROPERTY_SUFFIX |
| Constructor and Description |
|---|
NodePropertiesTools() |
| Modifier and Type | Method and Description |
|---|---|
void |
appendOrReplaceNodeProperty(org.fcrepo.kernel.rdf.IdentifierTranslator subjects,
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
|
int |
getPropertyType(javax.jcr.Node node,
String propertyName)
Get the JCR property type ID for a given property name.
|
static String |
getReferencePropertyName(String propertyName)
When we add certain URI properties, we also want to leave a reference node
|
static boolean |
isMultivaluedProperty(javax.jcr.Node node,
String propertyName)
Determine if a given JCR property name is single- or multi- valued.
|
void |
removeNodeProperty(org.fcrepo.kernel.rdf.IdentifierTranslator subjects,
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 final String REFERENCE_PROPERTY_SUFFIX
public void appendOrReplaceNodeProperty(org.fcrepo.kernel.rdf.IdentifierTranslator subjects,
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 void removeNodeProperty(org.fcrepo.kernel.rdf.IdentifierTranslator subjects,
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 String getReferencePropertyName(String propertyName)
propertyName - public 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–2014 DuraSpace, Inc.. All rights reserved.