ox.system.core.dynamic.concurrent.Callable interface">
|
ColdBox Platform - LogBox Version 1.5 | ||||
| FRAMES | |||||
WEB-INF.cftags.component
logbox.system.core.dynamic.BeanPopulator
public class BeanPopulator
This is a bean populator that binds different types of data to a bean.
| Constructor Summary | |
|---|---|
init()
Constructor |
|
| Method Summary | |
|---|---|
private Util |
getUtil()
Create and return a util object |
any |
populateFromJSON(any target, string JSONString, [string scope=''], [boolean trustedSetter='false'], [string include=''], [string exclude=''])
Populate a named or instantiated bean from a json string |
Any |
populateFromQuery(any target, query qry, [Numeric rowNumber='1'], [string scope=''], [boolean trustedSetter='false'], [string include=''], [string exclude=''])
Populate a named or instantiated bean from query |
any |
populateFromQueryWithPrefix(any target, query qry, [Numeric rowNumber='1'], [string scope=''], [boolean trustedSetter='false'], [string include=''], [string exclude=''], string prefix)
Populates an Object using only specific columns from a query |
any |
populateFromStruct(any target, struct memento, [string scope], [boolean trustedSetter='false'], [string include=''], [string exclude=''])
Populate a named or instantiated bean from a structure |
any |
populateFromXML(any target, any xml, [string root=''], [string scope=''], [boolean trustedSetter='false'], [string include=''], [string exclude=''])
Populate a named or instantiated bean from an XML packet |
| Methods inherited from class WEB-INF.cftags.component |
|---|
|
| Constructor Detail |
|---|
public init()
| Method Detail |
|---|
private Util getUtil()
public any populateFromJSON(any target, string JSONString, [string scope=''], [boolean trustedSetter='false'], [string include=''], [string exclude=''])
target - The target to populateJSONString - The JSON string to populate the object with. It has to be valid JSON and also a structure with name-key value pairs. scope - Use scope injection instead of setters population. Ex: scope=variables.instance.trustedSetter - If set to true, the setter method will be called even if it does not exist in the beaninclude - A list of keys to include in the populationexclude - A list of keys to exclude in the populationpublic Any populateFromQuery(any target, query qry, [Numeric rowNumber='1'], [string scope=''], [boolean trustedSetter='false'], [string include=''], [string exclude=''])
target - The target to populateqry - The query to popluate the bean object withrowNumber - The query row number to use for populationscope - Use scope injection instead of setters population. Ex: scope=variables.instance.trustedSetter - If set to true, the setter method will be called even if it does not exist in the beaninclude - A list of keys to include in the populationexclude - A list of keys to exclude in the populationpublic any populateFromQueryWithPrefix(any target, query qry, [Numeric rowNumber='1'], [string scope=''], [boolean trustedSetter='false'], [string include=''], [string exclude=''], string prefix)
target - This can be an instantiated bean object or a bean instantitation path as a string. If you pass an instantiation path and the bean has an 'init' method. It will be executed. This method follows the bean contract (set{property_name}). Example: setUsername(), setfname()qry - The query to popluate the bean object withrowNumber - The query row number to use for populationscope - Use scope injection instead of setters population. Ex: scope=variables.instance.trustedSetter - If set to true, the setter method will be called even if it does not exist in the beaninclude - A list of keys to include in the populationexclude - A list of keys to exclude in the populationprefix - The prefix used to filter, Example: 'user_' would apply to the following columns: 'user_id' and 'user_name' but not 'address_id'.public any populateFromStruct(any target, struct memento, [string scope], [boolean trustedSetter='false'], [string include=''], [string exclude=''])
target - The target to populatememento - The structure to populate the object with.scope - Use scope injection instead of setters population.trustedSetter - If set to true, the setter method will be called even if it does not exist in the beaninclude - A list of keys to include in the populationexclude - A list of keys to exclude in the populationpublic any populateFromXML(any target, any xml, [string root=''], [string scope=''], [boolean trustedSetter='false'], [string include=''], [string exclude=''])
target - The target to populatexml - The XML string or packetroot - The XML root element to start fromtrustedSetter - If set to true, the setter method will be called even if it does not exist in the beaninclude - A list of keys to include in the populationexclude - A list of keys to exclude in the population
|
ColdBox Platform - LogBox Version 1.5 | ||||
| FRAMES | |||||