Class PropertyHelper

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

public class PropertyHelper extends Object
Utilities for converting objects to and from JCR data types
  • 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 node
      propertyName - the target property name
      value - 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

      public static Object getObjectFromValue(javax.jcr.Value value) throws javax.jcr.RepositoryException
      Converts the Value to a java object
      Parameters:
      value - the value to convert
      Returns:
      the converted value object
      Throws:
      javax.jcr.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
    • encodeNodeName

      public static String encodeNodeName(String name)