Package com.avoka.core.util
Class PropertyUtils
- java.lang.Object
-
- com.avoka.core.util.PropertyUtils
-
public class PropertyUtils extends Object
Provides Property Utilities.
-
-
Constructor Summary
Constructors Constructor Description PropertyUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Object
getValue(Object source, String name)
Return the property value for the given object and property name using the MVEL library.static boolean
hasSetterMethod(Object object, String propertyName)
Return true if the given object has the setter method with the given property name.static void
setValue(Object target, String name, Object value)
Return the property value for the given object and property name using the MVEL library.static void
setValue(Object target, String name, Object value, boolean logErrors)
Return the property value for the given object and property name using the MVEL library.
-
-
-
Method Detail
-
getValue
public static Object getValue(Object source, String name)
Return the property value for the given object and property name using the MVEL library. This method is thread-safe, and caches parsed MVEL expressions in an cache.- Parameters:
source
- the source objectname
- the name of the property- Returns:
- the property value for the given source object and property name
-
setValue
public static void setValue(Object target, String name, Object value)
Return the property value for the given object and property name using the MVEL library. This method is thread-safe, and caches parsed MVEL expressions in an cache.- Parameters:
target
- the target object to set the property ofname
- the name of the property to setvalue
- the property value to set
-
setValue
public static void setValue(Object target, String name, Object value, boolean logErrors)
Return the property value for the given object and property name using the MVEL library. This method is thread-safe, and caches parsed MVEL expressions in an cache.- Parameters:
target
- the target object to set the property ofname
- the name of the property to setvalue
- the property value to setlogErrors
- log any property setting errors
-
hasSetterMethod
public static boolean hasSetterMethod(Object object, String propertyName)
Return true if the given object has the setter method with the given property name.- Parameters:
object
- the target object to testpropertyName
- the property name to test- Returns:
- true if the given object has the setter method with the given property name
- Since:
- 4.2.0
-
-