public interface PropertyAccessor
Modifier and Type | Method and Description |
---|---|
boolean |
canHandle(Object object,
String xpath,
Class<?> target)
Determines if the property accessor can handle the property denoted by xpath.
|
<T> T |
get(Object object,
String xpath,
Class<T> target)
Accesses a property of object via xpath expression.
|
<T> void |
set(Object object,
String xpath,
T value,
Class<T> target)
Sets a property of object via xpath expression.
|
boolean canHandle(Object object, String xpath, Class<?> target)
Can be used to perform checks against schema to ensure that the propery accessor will actually work with the provided instance.
object
- The target object.xpath
- An xpath expression denoting a property of the target object.true
if the property can be accessed, otherwise false
<T> T get(Object object, String xpath, Class<T> target) throws IllegalArgumentException
#canHandle(Object, String)
should be called before calling this method to ensure
that the property can be safely accessed.
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)null
IllegalArgumentException
- In the even that xpath is not supported.<T> void set(Object object, String xpath, T value, Class<T> target) throws IllegalArgumentException
#canHandle(Object, String)
should be called before calling this method to ensure
that the property can be safely accessed.
object
- The target object.xpath
- An xpath expression denoting a property of the target object.value
- The new value to settarget
- The target context we intend to update (often null or Geometry.class)IllegalArgumentException
- In the even that xpath is not supported.Copyright © 1996–2019 Geotools. All rights reserved.