public class PropertyHelper extends Object
Constructor and Description |
---|
PropertyHelper() |
Modifier and Type | Method and Description |
---|---|
static String |
encodeNodeName(String name) |
static Object |
getObjectFromProperty(javax.jcr.Property property)
Converts the property value to a java object.
|
static Object |
getObjectFromValue(javax.jcr.Value value)
Converts the Value to a java object
|
static Class<?> |
getValueType(boolean isMulti,
int type)
Returns the value type for the specified property type
|
static void |
setPropertyFromObject(javax.jcr.Node node,
String propertyName,
Object value)
Convert the value object to the right format before calling Node.setProperty(..)
|
public static void setPropertyFromObject(javax.jcr.Node node, String propertyName, Object value) throws javax.jcr.RepositoryException, CommonException
node
- the target nodepropertyName
- the target property namevalue
- the target property valuejavax.jcr.RepositoryException
CommonException
public static Object getObjectFromProperty(javax.jcr.Property property) throws javax.jcr.RepositoryException
property
- the property to convertjavax.jcr.RepositoryException
public static Object getObjectFromValue(javax.jcr.Value value) throws javax.jcr.RepositoryException
value
- the value to convertjavax.jcr.RepositoryException
public static Class<?> getValueType(boolean isMulti, int type)
isMulti
- true for a multi-value propertytype
- the property type constant. See PropertyType