public interface Document extends Iterable<Element>, DocumentAssignable, Serializable
Modifier and Type | Method and Description |
---|---|
void |
accept(Visitor visitor)
Accepts the visitor and calls the appropriate method on the visitor based
on the document type.
|
boolean |
contains(String name)
Returns true if the document contains an element with the specified name.
|
<E extends Element> |
find(Class<E> clazz,
String... nameRegexs)
Returns the elements matching the path of regular expressions.
|
List<Element> |
find(String... nameRegexs)
Returns the elements matching the path of regular expressions.
|
<E extends Element> |
findFirst(Class<E> clazz,
String... nameRegexs)
Returns the first element matching the path of regular expressions.
|
Element |
findFirst(String... nameRegexs)
Returns the first element matching the path of regular expressions.
|
<E extends Element> |
get(Class<E> clazz,
String name)
Returns the element with the specified name or null if no element with
that name exists.
|
Element |
get(String name)
Returns the element with the specified name or null if no element with
that name exists.
|
<E extends Element> |
queryPath(Class<E> clazz,
String... nameRegexs)
Deprecated.
Use the
find(Class,String...) method instead. Will
be removed after the 1.1.0 release. |
List<Element> |
queryPath(String... nameRegexs)
Deprecated.
Use the
find(String...) method instead. Will be
removed after the 1.1.0 release. |
asDocument
void accept(Visitor visitor)
visitor
- THe visitor for the document.boolean contains(String name)
name
- The name of the element to locate.<E extends Element> List<E> find(Class<E> clazz, String... nameRegexs)
E
- The type of element to match.clazz
- The class of elements to match.nameRegexs
- The path of regular expressions.null
.List<Element> find(String... nameRegexs)
nameRegexs
- The path of regular expressions.null
.<E extends Element> E findFirst(Class<E> clazz, String... nameRegexs)
Note: It is much faster to use the get(Class,String)
method on a
document than to use the findFirst(String...)
with a single
nameRegexs
.
E
- The type of element to match.clazz
- The class of element to match.nameRegexs
- The path of regular expressions.Element findFirst(String... nameRegexs)
Note: It is much faster to use the get(String)
method on a
document than to use the findFirst(String...)
with a single
nameRegexs
.
nameRegexs
- The path of regular expressions.<E extends Element> E get(Class<E> clazz, String name)
E
- The type of element to get.clazz
- The class of element to get.name
- The name of the element to locate.Element get(String name)
name
- The name of the element to locate.@Deprecated <E extends Element> List<E> queryPath(Class<E> clazz, String... nameRegexs)
find(Class,String...)
method instead. Will
be removed after the 1.1.0 release.E
- The type of element to match.clazz
- The class of elements to match.nameRegexs
- The path of regular expressions.@Deprecated List<Element> queryPath(String... nameRegexs)
find(String...)
method instead. Will be
removed after the 1.1.0 release.nameRegexs
- The path of regular expressions.Copyright © 2011-2012 Allanbank Consulting, Inc.. All Rights Reserved.