org.apache.commons.beanutils.expression
Class DefaultResolver

java.lang.Object
  extended by org.apache.commons.beanutils.expression.DefaultResolver
All Implemented Interfaces:
Resolver

public class DefaultResolver
extends Object
implements Resolver

Default Property Name Expression Resolver Implementation.

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

Since:
1.8.0
Version:
$Revision: 473888 $ $Date: 2006-11-12 06:21:24 +0000 (Sun, 12 Nov 2006) $

Constructor Summary
DefaultResolver()
          Default Constructor.
 
Method Summary
 int getIndex(String expression)
          Return the index value from the property expression or -1.
 String getKey(String expression)
          Return the map key from the property expression or null.
 String getProperty(String expression)
          Return the property name from the property expression.
 boolean hasNested(String expression)
          Indicates whether or not the expression contains nested property expressions or not.
 boolean isIndexed(String expression)
          Indicate whether the expression is for an indexed property or not.
 boolean isMapped(String expression)
          Indicate whether the expression is for a mapped property or not.
 String next(String expression)
          Extract the next property expression from the current expression.
 String remove(String expression)
          Remove the last property expresson from the current expression.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultResolver

public DefaultResolver()
Default Constructor.

Method Detail

getIndex

public int getIndex(String expression)
Return the index value from the property expression or -1.

Specified by:
getIndex in interface Resolver
Parameters:
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.

getKey

public String getKey(String expression)
Return the map key from the property expression or null.

Specified by:
getKey in interface Resolver
Parameters:
expression - The property expression
Returns:
The index value
Throws:
IllegalArgumentException - If the mapped property is illegally formed.

getProperty

public String getProperty(String expression)
Return the property name from the property expression.

Specified by:
getProperty in interface Resolver
Parameters:
expression - The property expression
Returns:
The property name

hasNested

public boolean hasNested(String expression)
Indicates whether or not the expression contains nested property expressions or not.

Specified by:
hasNested in interface Resolver
Parameters:
expression - The property expression
Returns:
The next property expression

isIndexed

public boolean isIndexed(String expression)
Indicate whether the expression is for an indexed property or not.

Specified by:
isIndexed in interface Resolver
Parameters:
expression - The property expression
Returns:
true if the expresion is indexed, otherwise false

isMapped

public boolean isMapped(String expression)
Indicate whether the expression is for a mapped property or not.

Specified by:
isMapped in interface Resolver
Parameters:
expression - The property expression
Returns:
true if the expresion is mapped, otherwise false

next

public String next(String expression)
Extract the next property expression from the current expression.

Specified by:
next in interface Resolver
Parameters:
expression - The property expression
Returns:
The next property expression

remove

public String remove(String expression)
Remove the last property expresson from the current expression.

Specified by:
remove in interface Resolver
Parameters:
expression - The property expression
Returns:
The new expression value, with first property expression removed - null if there are no more expressions


Copyright © 2000-2009 The Apache Software Foundation. All Rights Reserved.