org.geotools.filter.expression
Interface PropertyAccessor


public interface PropertyAccessor

Used to get and set object properties based on an xpath expression.

Author:
Justin Deoliveira, The Open Planning Project
Module:
modules/library/api (gt-api.jar)

Method Summary
 boolean canHandle(Object object, String xpath, Class target)
          Determines if the property accessor can handle the property denoted by xpath.
 Object get(Object object, String xpath, Class target)
          Accesses a property of object via xpath expression.
 void set(Object object, String xpath, Object value, Class target)
          Sets a property of object via xpath expression.
 

Method Detail

canHandle

boolean canHandle(Object object,
                  String xpath,
                  Class target)
Determines if the property accessor can handle the property denoted by xpath.

Can be used to perform checks against schema to ensure that the propery accessor will actually work with the provided instance.

Parameters:
object - The target object.
xpath - An xpath expression denoting a property of the target object.
Returns:
true if the property can be accessed, otherwise false

get

Object get(Object object,
           String xpath,
           Class target)
           throws IllegalArgumentException
Accesses a property of object via xpath expression.

#canHandle(Object, String) should be called before calling this method to ensure that the property can be safely accessed.

Parameters:
object - The target object.
xpath - An xpath expression denoting a property of the target object.
target - Target context we intend to access (often null or Geometry.class)
Returns:
The property, which might be null
Throws:
IllegalArgumentException - In the even that xpath is not supported.

set

void set(Object object,
         String xpath,
         Object value,
         Class target)
         throws IllegalArgumentException
Sets a property of object via xpath expression.

#canHandle(Object, String) should be called before calling this method to ensure that the property can be safely accessed.

Parameters:
object - The target object.
xpath - An xpath expression denoting a property of the target object.
value - The new value to set
target - The target context we intend to update (often null or Geometry.class)
Throws:
IllegalArgumentException - In the even that xpath is not supported.


Copyright © 1996-2009 Geotools. All Rights Reserved.