com.webmethods.caf.jcr.faces.util
Class PropertyHelper

java.lang.Object
  extended by com.webmethods.caf.jcr.faces.util.PropertyHelper

public class PropertyHelper
extends Object

Utilities for converting objects to and from JCR data types


Constructor Summary
PropertyHelper()
           
 
Method Summary
static Object getObjectFromProperty(Property property)
          Converts the property value to a java object.
static Object getObjectFromValue(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(Node node, String propertyName, Object value)
          Convert the value object to the right format before calling Node.setProperty(..)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyHelper

public PropertyHelper()
Method Detail

setPropertyFromObject

public static void setPropertyFromObject(Node node,
                                         String propertyName,
                                         Object value)
                                  throws RepositoryException,
                                         CommonException
Convert the value object to the right format before calling Node.setProperty(..)

Parameters:
node - the target node
propertyName - the target property name
value - the target property value
Throws:
RepositoryException
CommonException

getObjectFromProperty

public static Object getObjectFromProperty(Property property)
                                    throws RepositoryException
Converts the property value to a java object.

Parameters:
property - the property to convert
Returns:
the converted property value
Throws:
RepositoryException

getObjectFromValue

public static Object getObjectFromValue(Value value)
                                 throws RepositoryException
Converts the Value to a java object

Parameters:
value - the value to convert
Returns:
the converted value object
Throws:
RepositoryException

getValueType

public static Class getValueType(boolean isMulti,
                                 int type)
Returns the value type for the specified property type

Parameters:
isMulti - true for a multi-value property
type - the property type constant. See PropertyType
Returns:
the value class for the type