PropertyNameResolver

Default Property Name Resolver .

This class assists in resolving property names in the following four formats, with the layout of an identifying String in parentheses:

  • Simple (name) - The specified name identifies an individual property of a particular JavaBean. The name of the actual getter or setter method to be used is determined using standard JavaBeans instrospection, a property named "xyz" will have a getter method named getXyz() or (for boolean properties only) isXyz(), and a setter method named setXyz().

  • Indexed (name[index]) - The underlying property value is assumed to be an array. The appropriate (zero-relative) entry in the array is selected. List objects are now also supported for read/write.

  • Mapped (name(key)) - The JavaBean is assumed to have an property getter and setter methods with an additional attribute of type java.lang.String.

  • Nested (name1.name2[index].name3(key)) - Combining mapped, nested, and indexed references is also supported.

Since

3.2.0

Companion
object
class Object
trait Matchable
class Any

Value members

Concrete methods

def getIndex(expression: String): Int

Return the index value from the property expression or -1.

Return the index value from the property expression or -1.

Value Params
expression

The property expression

Returns

The index value or -1 if the property is not indexed

Throws
IllegalArgumentException

If the indexed property is illegally formed or has an invalid (non-numeric) value.

def getKey(expression: String): String

Return the map key from the property expression or null.

Return the map key from the property expression or null.

Value Params
expression

The property expression

Returns

The index value

Throws
IllegalArgumentException

If the mapped property is illegally formed.

def getProperty(expression: String): String

Return the property name from the property expression.

Return the property name from the property expression.

Value Params
expression

The property expression

Returns

The property name

def hasNested(expression: String): Boolean

Indicates whether or not the expression contains nested property expressions or not.

Indicates whether or not the expression contains nested property expressions or not.

Value Params
expression

The property expression

Returns

The next property expression

def isIndexed(expression: String): Boolean

Indicate whether the expression is for an indexed property or not.

Indicate whether the expression is for an indexed property or not.

Value Params
expression

The property expression

Returns

true if the expresion is indexed, otherwise false

def isMapped(expression: String): Boolean

Indicate whether the expression is for a mapped property or not.

Indicate whether the expression is for a mapped property or not.

Value Params
expression

The property expression

Returns

true if the expresion is mapped, otherwise false

def next(expression: String): String

Extract the next property expression from the current expression.

Extract the next property expression from the current expression.

Value Params
expression

The property expression

Returns

The next property expression

def remove(expression: String): String

Remove the last property expresson from the current expression.

Remove the last property expresson from the current expression.

Value Params
expression

The property expression

Returns

The new expression value, with first property expression removed - null if there are no more expressions