commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benedikt Ritter (JIRA)" <>
Subject [jira] [Commented] (SANDBOX-463) Implementation of property paths
Date Wed, 12 Mar 2014 18:32:47 GMT


Benedikt Ritter commented on SANDBOX-463:

Hello again,

bq. 1. You are right, I will extend the test cases to contain negative tests as well!


bq. 2. The method name is a result of using the GOF Interpreter Pattern, where a (bean) property
is an expression, a BeanAccessor is a context which is required for interpretation and the
PropertyInterpreter is the client which brings all together. [...]

Fair enough, let's leave it this way. :)

bq. 3. Hmmmm... Please help me what you intent here, I can't see what you mean. :(

Each call of {{MappedPropertyExpression.interpret(BeanAccessor)}} and {{ListedPropertyExpression.interpret(BeanAcessor)}}
calls {{Pattern.compile(REGEXP)}}. Since the REGEXP never changes, the result of {{compile(String)}}
will always be the same and thus can be initialized only once (for example in a static field)


> Implementation of property paths 
> ---------------------------------
>                 Key: SANDBOX-463
>                 URL:
>             Project: Commons Sandbox
>          Issue Type: Improvement
>          Components: BeanUtils2
>            Reporter: Andre Diermann
>         Attachments: Commons-Sandbox-463#2.patch, Commons-Sandbox-463.patch
> In [1] Benedikt Ritter mentioned the lag of BU1's property path for BU2.
> The attached patch contains an implementation of a PropertyInterpreter - following the
GOF Interpreter Pattern - which is able to interpret simple/index/mapped/nested properties
and any combination of it. The result is a BeanAccessor. The idea is to use the PropertyInterpreter
inside of a BeanAccessor implementation.
> The patch also contains a corresponding test case.
> Example:
> on( anyBean ).set( "contact[15].address(home).street" ).with( "Example Street 1000" );
> [1]

This message was sent by Atlassian JIRA

View raw message