C
- the path element typepublic abstract class AbstractAccessor<C>
extends groovy.lang.GroovyObjectSupport
Constructor and Description |
---|
AbstractAccessor(List<? extends Path<C>> initialPaths)
Creates a new accessor.
|
AbstractAccessor(Path<C> parentPath)
Creates a new accessor.
|
Modifier and Type | Method and Description |
---|---|
List<? extends Path<C>> |
all()
Get all found paths.
|
Path<C> |
eval()
Get a unique found child path.
|
Path<C> |
eval(boolean unique)
Get a single found child path.
|
protected abstract List<? extends Path<C>> |
findChildPaths(List<? extends Path<C>> parentPaths,
String name,
List<?> args)
Find child paths for the given name.
|
AbstractAccessor<C> |
findChildren(String name)
Find children with the given name.
|
AbstractAccessor<C> |
findChildren(String name,
List<?> args)
Find children with the given name.
|
Object |
getProperty(String property) |
Object |
invokeMethod(String name,
Object args) |
public AbstractAccessor(Path<C> parentPath)
parentPath
- the root path, usually containing only one path with
the parent elementpublic Object getProperty(String property)
getProperty
in interface groovy.lang.GroovyObject
getProperty
in class groovy.lang.GroovyObjectSupport
public Object invokeMethod(String name, Object args)
invokeMethod
in interface groovy.lang.GroovyObject
invokeMethod
in class groovy.lang.GroovyObjectSupport
public AbstractAccessor<C> findChildren(String name)
name
- the property namepublic AbstractAccessor<C> findChildren(String name, List<?> args)
name
- the property nameargs
- the list of additional arguments apart from the nameprotected abstract List<? extends Path<C>> findChildPaths(List<? extends Path<C>> parentPaths, String name, List<?> args)
parentPaths
- the parent pathsname
- the property nameargs
- the list of additional arguments apart from the namepublic Path<C> eval()
null
if none was foundIllegalStateException
- if there are multiple pathspublic Path<C> eval(boolean unique)
unique
- if the path must be uniquenull
if none was foundIllegalStateException
- if there are multiple paths but a unique
path was requestedBuild 2013-10-07_11-27-38
Revision 99b27713a799a59a21b0b166eaaea8aaefbf125a