Class PropertyHelper
java.lang.Object
com.webmethods.caf.jcr.faces.util.PropertyHelper
Utilities for converting objects to and from JCR data types
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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 objectstatic Class<?>
getValueType
(boolean isMulti, int type) Returns the value type for the specified property typestatic void
setPropertyFromObject
(javax.jcr.Node node, String propertyName, Object value) Convert the value object to the right format before calling Node.setProperty(..)
-
Constructor Details
-
PropertyHelper
public PropertyHelper()
-
-
Method Details
-
setPropertyFromObject
public static void setPropertyFromObject(javax.jcr.Node node, String propertyName, Object value) throws javax.jcr.RepositoryException, CommonException Convert the value object to the right format before calling Node.setProperty(..)- Parameters:
node
- the target nodepropertyName
- the target property namevalue
- the target property value- Throws:
javax.jcr.RepositoryException
CommonException
-
getObjectFromProperty
public static Object getObjectFromProperty(javax.jcr.Property property) throws javax.jcr.RepositoryException Converts the property value to a java object.- Parameters:
property
- the property to convert- Returns:
- the converted property value
- Throws:
javax.jcr.RepositoryException
-
getObjectFromValue
Converts the Value to a java object- Parameters:
value
- the value to convert- Returns:
- the converted value object
- Throws:
javax.jcr.RepositoryException
-
getValueType
Returns the value type for the specified property type- Parameters:
isMulti
- true for a multi-value propertytype
- the property type constant. SeePropertyType
- Returns:
- the value class for the type
-
encodeNodeName
-