classafBeanUtils::BeanProperties

sys::Obj
  afBeanUtils::BeanProperties

Static methods to get and set bean values from property expressions.

call

Source

const static Obj? call(Obj instance, Str property, Obj?[]? args := null)

Similar to get() but may read better in code if you know the expression ends with a method.

Any arguments given overwrite arguments in the expression. Example:

BeanProperties.call(Buf(), "fill(255, 4)", [128, 2])  // --> 0x8080
create

Source

const static Obj create(Type type, Str:Obj? propertyValues, TypeCoercer? typeCoercer := null, |Type->BeanFactory? factoryFunc := null)

Uses the given property expressions to instantiate a tree of beans and values. Nested beans may be const as long as they supply an it-block ctor argument.

get

Source

const static Obj? get(Obj instance, Str property)

Gets the value of the field (or method) at the end of the property expression.

set

Source

const static Void set(Obj instance, Str property, Obj? value)

Sets the value of the field at the end of the property expression.

setAll

Source

const static Obj setAll(Obj instance, Str:Obj? propertyValues)

Given a map of values, keyed by property expressions, this sets them on the given instance.

Returns the given instance.