ZMObject
└─ZMBeanUtils
public class ZMBeanUtils
extends ZMObject
| Fields inherited from org.zenmagick.core.ZMObject | |
|---|---|
| properties_ | |
| Method Summary | |
|---|---|
| static mixed | getBean(string definition) Build an object based on the bean definition. |
| static array | getPropertyMap(mixed obj, array properties) Get the property mapping for a given class/object. |
| static mixed | map2obj(string clazz, array data, array keys) Create a new instance of the given class and populate with the provided data. |
| static array | obj2map(mixed obj, array properties, mixed addGeneric, addGeneric Optional) Convert an object into a map. |
| static mixed | setAll(mixed obj, array data, array keys, mixed setGeneric, setGeneric Optional) Set a given map of key/value pairs on an object. |
| Methods inherited from org.zenmagick.core.ZMObject | |
|---|---|
| attachMethod, get, getAttachedMethods, getPropertyNames, set, singleton | |
public static mixed getBean(string definition)
Build an object based on the bean definition.
The syntax for bean definitions is: [class name]#[property1=value1&property2=value2&...].
null.public static array getPropertyMap(mixed obj, array properties)
Get the property mapping for a given class/object.
If explicitely set (via $properties), generic properties will be considered too.
null for all.public static mixed map2obj(string clazz, array data, array keys)
Create a new instance of the given class and populate with the provided data.
null to use all.null.public static array obj2map(mixed obj, array properties, mixed addGeneric, addGeneric Optional)
Convert an object into a map.
If explicitely set (via $properties), generic properties will be considered, even if
$addGeneric is set to false.
null for all.ZMObject properties should be included or not; default is true to include generic properties.public static mixed setAll(mixed obj, array data, array keys, mixed setGeneric, setGeneric Optional)
Set a given map of key/value pairs on an object.
null to use all.ZMObject properties should be included or not; default is true to include generic properties.$obj.
Bean utility.
Bean definitions and properties handled by this class may use two special (magic) name prefixes to create/set objects rather than strings:
null.