|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object info.magnolia.jcr.util.PropertyUtil
public class PropertyUtil
Property-related utility methods.
Constructor Summary | |
---|---|
PropertyUtil()
|
Method Summary | |
---|---|
static javax.jcr.Value |
createValue(Object obj,
javax.jcr.ValueFactory valueFactory)
|
static javax.jcr.Value |
createValue(String valueStr,
int type,
javax.jcr.ValueFactory valueFactory)
Transforms a string to a jcr value object. |
static boolean |
getBoolean(javax.jcr.Node node,
String name,
boolean defaultValue)
Return the boolean representing the node property value. |
static Calendar |
getDate(javax.jcr.Node node,
String name)
Return the Calendar representing the node property value. |
static Calendar |
getDate(javax.jcr.Node node,
String name,
Calendar defaultValue)
Return the Calendar representing the node property value. |
static String |
getDateFormat()
|
static int |
getJCRPropertyType(Object obj)
|
static Long |
getLong(javax.jcr.Node node,
String name)
|
static Long |
getLong(javax.jcr.Node node,
String name,
Long defaultValue)
|
static javax.jcr.Property |
getProperty(javax.jcr.Node node,
String relativePath)
Deprecated. since 4.5 - use getPropertyOrNull instead. |
static javax.jcr.Property |
getPropertyOrNull(javax.jcr.Node node,
String relativePath)
Return the Property relative to the Node or null if it's not existing or in case of any RepositoryException. |
static String |
getString(javax.jcr.Node node,
String name)
Return the String representing the node property value. |
static String |
getString(javax.jcr.Node node,
String name,
String defaultValue)
Return the String representing the node property value. |
static Object |
getValueObject(javax.jcr.Value value)
Return the Value Object from a Value . |
static List<String> |
getValuesStringList(javax.jcr.Value[] values)
|
static String |
getValueString(javax.jcr.Property property)
Returns value of the property converted to string no matter what it's type actually is. |
static String |
getValueString(javax.jcr.Value value)
Returns value converted to string no matter what it's type actually is. |
static void |
renameProperty(javax.jcr.Property property,
String newName)
|
static void |
setProperty(javax.jcr.Node node,
String propertyName,
Object propertyValue)
Allows setting a Node's property from an object. |
static void |
updateOrCreate(javax.jcr.Node node,
String string,
GregorianCalendar gregorianCalendar)
Updates existing property or creates a new one if it doesn't exist already. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PropertyUtil()
Method Detail |
---|
public static void renameProperty(javax.jcr.Property property, String newName) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public static void setProperty(javax.jcr.Node node, String propertyName, Object propertyValue) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public static javax.jcr.Value createValue(String valueStr, int type, javax.jcr.ValueFactory valueFactory)
public static int getJCRPropertyType(Object obj)
public static void updateOrCreate(javax.jcr.Node node, String string, GregorianCalendar gregorianCalendar) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public static String getDateFormat()
public static List<String> getValuesStringList(javax.jcr.Value[] values)
public static String getValueString(javax.jcr.Property property)
getDateFormat()
. Binary and reference values are converted to empty string. In case of error during conversion, null will be returned instead. Works only for single value properties.
public static String getValueString(javax.jcr.Value value)
getDateFormat()
. Binary and reference values are converted to empty string. In case of error during conversion, null will be returned instead.
public static javax.jcr.Value createValue(Object obj, javax.jcr.ValueFactory valueFactory) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public static Calendar getDate(javax.jcr.Node node, String name)
public static Calendar getDate(javax.jcr.Node node, String name, Calendar defaultValue)
public static String getString(javax.jcr.Node node, String name)
public static String getString(javax.jcr.Node node, String name, String defaultValue)
public static Long getLong(javax.jcr.Node node, String name)
public static Long getLong(javax.jcr.Node node, String name, Long defaultValue)
public static boolean getBoolean(javax.jcr.Node node, String name, boolean defaultValue)
public static javax.jcr.Property getPropertyOrNull(javax.jcr.Node node, String relativePath)
public static javax.jcr.Property getProperty(javax.jcr.Node node, String relativePath)
public static Object getValueObject(javax.jcr.Value value)
Value
.
Return null in case of exception.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |