On 05/14/2012 02:43 PM, [hidden email] wrote:
> Author: adrianc > Date: Mon May 14 19:43:18 2012 > New Revision: 1338361 > > URL: http://svn.apache.org/viewvc?rev=1338361&view=rev > Log: > Added a utility method to FlexibleMapAccessor.java to test for nested expressions. > > Modified: > ofbiz/trunk/framework/base/src/org/ofbiz/base/util/collections/FlexibleMapAccessor.java > ofbiz/trunk/framework/base/src/org/ofbiz/base/util/collections/test/FlexibleMapAccessorTests.java > > Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/collections/FlexibleMapAccessor.java > URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/collections/FlexibleMapAccessor.java?rev=1338361&r1=1338360&r2=1338361&view=diff > ============================================================================== > --- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/collections/FlexibleMapAccessor.java (original) > +++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/collections/FlexibleMapAccessor.java Mon May 14 19:43:18 2012 > @@ -76,6 +76,16 @@ public class FlexibleMapAccessor<T> impl > } > } > > + /** > + * Returns <code>true</code> if <code>fma</code> contains a nested expression. > + * @param fma > + * @return <code>true</code> if <code>fma</code> contains a nested expression > + * @throws NullPointerException if <code>fma</code> is null > + */ > + public static boolean containsNestedExpression(FlexibleMapAccessor<?> fma) { > + return fma.fse != null; > + } > + Just make it a method on the object itself, so one can do: fma.containsNestedExpression() |
On 05/14/2012 02:49 PM, Adam Heath wrote:
> On 05/14/2012 02:43 PM, [hidden email] wrote: >> Author: adrianc >> Date: Mon May 14 19:43:18 2012 >> New Revision: 1338361 >> >> URL: http://svn.apache.org/viewvc?rev=1338361&view=rev >> Log: >> Added a utility method to FlexibleMapAccessor.java to test for nested expressions. >> >> Modified: >> ofbiz/trunk/framework/base/src/org/ofbiz/base/util/collections/FlexibleMapAccessor.java >> ofbiz/trunk/framework/base/src/org/ofbiz/base/util/collections/test/FlexibleMapAccessorTests.java >> >> Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/collections/FlexibleMapAccessor.java >> URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/collections/FlexibleMapAccessor.java?rev=1338361&r1=1338360&r2=1338361&view=diff >> ============================================================================== >> --- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/collections/FlexibleMapAccessor.java (original) >> +++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/collections/FlexibleMapAccessor.java Mon May 14 19:43:18 2012 >> @@ -76,6 +76,16 @@ public class FlexibleMapAccessor<T> impl >> } >> } >> >> + /** >> + * Returns <code>true</code> if <code>fma</code> contains a nested expression. >> + * @param fma >> + * @return <code>true</code> if <code>fma</code> contains a nested expression >> + * @throws NullPointerException if <code>fma</code> is null >> + */ >> + public static boolean containsNestedExpression(FlexibleMapAccessor<?> fma) { >> + return fma.fse != null; >> + } >> + > > Just make it a method on the object itself, so one can do: > > fma.containsNestedExpression() Thanks, Adrian, for changing that. Generally, ofbiz uses static methods for lots of things, and then uses generic objects(simple collection objects, strings, etc). Howeverr, in this case, we already have a custom object, doing various things, so the feature should just be a new method on that. |
Free forum by Nabble | Edit this page |