org.exoplatform.social.common.jcr
Class Util

java.lang.Object
  extended by org.exoplatform.social.common.jcr.Util

public class Util
extends Object

Provides utility for working with jcr

Since:
Dec 22, 2010, 1.2.0-GA
Author:
hoatle (hoatlevan at gmail dot com)

Constructor Summary
Util()
           
 
Method Summary
static
<T> T[]
convertListToArray(List<T> list, Class<T> type)
          Converts a list to an array.
static String[] convertMapToStrings(Map<String,String> templateParams)
          Convert a map of string key and string value into a string array where values are in the form key=value.
static Map<String,String> convertValuesToMap(javax.jcr.Value[] values)
          Converts an array of Value into a map of string.
static String[] convertValuesToStrings(javax.jcr.Value[] values)
          Converts array of Value to array of string.
static String getPropertiesNamePattern(String[] propertyNames)
          Gets properties name pattern from an array of property names.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Util

public Util()
Method Detail

getPropertiesNamePattern

public static String getPropertiesNamePattern(String[] propertyNames)
Gets properties name pattern from an array of property names.

Parameters:
propertyNames -
Returns:
properties name pattern.

convertValuesToStrings

public static String[] convertValuesToStrings(javax.jcr.Value[] values)
                                       throws Exception
Converts array of Value to array of string. Make sure these Values can getString().

Parameters:
values -
Returns:
Throws:
Exception

convertMapToStrings

public static String[] convertMapToStrings(Map<String,String> templateParams)
Convert a map of string key and string value into a string array where values are in the form key=value.

Parameters:
templateParams -
Returns:

convertValuesToMap

public static Map<String,String> convertValuesToMap(javax.jcr.Value[] values)
Converts an array of Value into a map of string. The values are expected to be of string type and in the form key=value

Parameters:
values -
Returns:

convertListToArray

public static <T> T[] convertListToArray(List<T> list,
                                         Class<T> type)
Converts a list to an array.

Parameters:
list - List to be converted to array.
type - Type of list's and array's element.
Returns:
An array with the same type of element in list.


Copyright © 2003–2014 eXo Platform SAS. All rights reserved.