|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
public interface X
A wrapper type for Element
This is the main type of the jOOX library. It wraps an ordered list of DOM elements without duplicates and provides useful operations upon all of the contained elements. The API has been inspired by http://jquery.com, a fantastic DOM abstraction library for JavaScript.
| Method Summary | ||
|---|---|---|
X |
add(Element... elements)
Add some elements to the set of matched elements |
|
X |
add(X... elements)
Add some elements to the set of matched elements |
|
X |
after(Content content)
Add content after each element in the set of matched elements. |
|
X |
after(String content)
Add content after each element in the set of matched elements. |
|
X |
append(Content content)
Append content to the end of each element's content in the set of matched elements. |
|
X |
append(String content)
Append content to the end of each element's content in the set of matched elements. |
|
String |
attr(String name)
Get the attribute name from the first element in the set of
matched elements, or null if the first element does not have
that attribute. |
|
X |
attr(String name,
Content value)
Set an attribute on all elements in the set of matched elements. |
|
X |
attr(String name,
String value)
Set an attribute on all elements in the set of matched elements. |
|
List<String> |
attrs(String name)
Get the attribute name from all elements in the set of
matched elements |
|
X |
before(Content content)
Add content before each element in the set of matched elements. |
|
X |
before(String content)
Add content before each element in the set of matched elements. |
|
X |
children()
Find all children of each element in the current set of matched elements. |
|
X |
children(Filter filter)
Find all children of each element in the current set of matched elements. |
|
X |
children(String selector)
Find all children of each element in the current set of matched elements. |
|
String |
content()
Get the XML content of the first element in the set of matched elements, or null if there are no matched elements |
|
X |
content(Content content)
Add some XML content to all elements in the set of matched elements (possibly replacing existing content). |
|
X |
content(String content)
Add some XML content to all elements in the set of matched elements (possibly replacing existing content). |
|
List<String> |
contents()
Get all XML content of the elements in the set of matched elements. |
|
X |
copy()
Get a copy of the X wrapper. |
|
X |
each(Each each)
Execute a callback for every element in the current set of matched elements. |
|
X |
empty()
Removes all content from all elements in the set of matched elements. |
|
X |
eq(int index)
Reduce the current set of matched elements to the element at a given index |
|
X |
filter(Filter filter)
Reduce the current set of matched elements. |
|
X |
filter(String selector)
Reduce the current set of matched elements. |
|
X |
find()
Find all descendants of each element in the current set of matched elements. |
|
X |
find(Filter filter)
Find all descendants of each element in the current set of matched elements. |
|
X |
find(String selector)
Find all descendants of each element in the current set of matched elements. |
|
X |
first()
Get the first in a set of matched elements. |
|
List<Element> |
get()
Get an the set of matched elements |
|
Element |
get(int index)
Get an element from the set of matched elements at a given index |
|
X |
has(Filter filter)
Reduce the set of matched element to those who have a descendant that matches a filter. |
|
X |
has(String selector)
Reduce the set of matched element to those who have a descendant that matches a selector. |
|
String |
id()
Get the first id value This is the same as calling id(0) |
|
String |
id(int index)
Get a list of id values in the current set of matched elements. |
|
List<String> |
ids()
Get a list of id values in the current set of matched elements. |
|
boolean |
is(Filter filter)
Check if at least one element in the set of matched elements satisfies a filter. |
|
boolean |
is(String selector)
Check if at least one element in the set of matched elements satisfies a selector. |
|
X |
last()
Get the last in a set of matched elements. |
|
|
map(Mapper<E> map)
Map the set of matched elements to a list of something |
|
X |
next()
Get the immediate next sibling of every element in set of matched elements. |
|
X |
next(Filter filter)
Get the immediate next sibling of every element in set of matched elements, matching a filter |
|
X |
next(String selector)
Get the immediate next sibling of every element in set of matched elements, matching a selector |
|
X |
nextAll()
Get all next siblings of every element in a set of matched elements |
|
X |
nextAll(Filter filter)
Get all next siblings of every element in a set of matched elements, matching a filter |
|
X |
nextAll(String selector)
Get all next siblings of every element in a set of matched elements, matching a selector |
|
X |
nextUntil(Filter until)
Get all next siblings of every element in a set of matched elements until the provided filter matches |
|
X |
nextUntil(Filter until,
Filter filter)
Get all next siblings of every element in a set of matched elements, matching a filter until the provided filter matches |
|
X |
nextUntil(Filter until,
String selector)
Get all next siblings of every element in a set of matched elements, matching a selector until the provided filter matches |
|
X |
nextUntil(String until)
Get all next siblings of every element in a set of matched elements until the provided selector matches |
|
X |
nextUntil(String until,
Filter filter)
Get all next siblings of every element in a set of matched elements, matching a filter, until the provided selector matches |
|
X |
nextUntil(String until,
String selector)
Get all next siblings of every element in a set of matched elements, matching a selector, until the provided selector matches |
|
X |
not(Filter filter)
Remove elements from the set of matched elements. |
|
X |
not(String selector)
Remove elements from the set of matched elements. |
|
X |
parent()
Get the immediate parent elements of every element in a set of matched elements |
|
X |
parent(Filter filter)
Get the immediate parent elements of every element in a set of matched elements, matching a filter |
|
X |
parent(String selector)
Get the immediate parent elements of every element in a set of matched elements, matching a selector |
|
X |
parents()
Get all ancestor elements of every element in a set of matched elements |
|
X |
parents(Filter filter)
Get all ancestor elements of every element in a set of matched elements, matching a filter |
|
X |
parents(String selector)
Get all ancestor elements of every element in a set of matched elements, matching a selector |
|
X |
parentsUntil(Filter until)
Get all ancestors of every element in a set of matched elements until the provided filter matches |
|
X |
parentsUntil(Filter until,
Filter filter)
Get all ancestors of every element in a set of matched elements, matching a filter until the provided filter matches |
|
X |
parentsUntil(Filter until,
String selector)
Get all ancestors of every element in a set of matched elements, matching a selector until the provided filter matches |
|
X |
parentsUntil(String until)
Get all ancestors of every element in a set of matched elements until the provided selector matches |
|
X |
parentsUntil(String until,
Filter filter)
Get all ancestors of every element in a set of matched elements, matching a filter, until the provided selector matches |
|
X |
parentsUntil(String until,
String selector)
Get all ancestors of every element in a set of matched elements, matching a selector, until the provided selector matches |
|
X |
prepend(Content content)
Prepend content to the beginning of each element's content in the set of matched elements. |
|
X |
prepend(String content)
Prepend content to the beginning of each element's content in the set of matched elements. |
|
X |
prev()
Get the immediate previous sibling of every element in set of matched elements. |
|
X |
prev(Filter filter)
Get the immediate previous sibling of every element in set of matched elements, matching a filter |
|
X |
prev(String selector)
Get the immediate previous sibling of every element in set of matched elements, matching a selector |
|
X |
prevAll()
Get all previous siblings of every element in a set of matched elements |
|
X |
prevAll(Filter filter)
Get all previous siblings of every element in a set of matched elements, matching a filter |
|
X |
prevAll(String selector)
Get all previous siblings of every element in a set of matched elements, matching a selector |
|
X |
prevUntil(Filter until)
Get all previous siblings of every element in a set of matched elements until the provided filter matches |
|
X |
prevUntil(Filter until,
Filter filter)
Get all previous siblings of every element in a set of matched elements, matching a filter until the provided filter matches |
|
X |
prevUntil(Filter until,
String selector)
Get all previous siblings of every element in a set of matched elements, matching a selector until the provided filter matches |
|
X |
prevUntil(String until)
Get all previous siblings of every element in a set of matched elements until the provided selector matches |
|
X |
prevUntil(String until,
Filter filter)
Get all previous siblings of every element in a set of matched elements, matching a filter, until the provided selector matches |
|
X |
prevUntil(String until,
String selector)
Get all previous siblings of every element in a set of matched elements, matching a selector, until the provided selector matches |
|
X |
remove()
Removes all elements in the set of matched elements. |
|
X |
remove(Filter filter)
Removes all elements in the set of matched elements, matching a filter |
|
X |
remove(String selector)
Removes all elements in the set of matched elements, matching a selector |
|
X |
removeAttr(String name)
Remove an attribute from all elements in the set of matched elements. |
|
X |
replaceWith(Content content)
Replace all elements in the set of matched elements with some new content. |
|
X |
replaceWith(String content)
Replace all elements in the set of matched elements with some new content. |
|
X |
siblings()
Get all siblings of every element in a set of matched elements |
|
X |
siblings(Filter filter)
Get all siblings of every element in a set of matched elements, matching a filter |
|
X |
siblings(String selector)
Get all siblings of every element in a set of matched elements, matching a selector |
|
int |
size()
Get the number of matched elements in the set of matched elements |
|
X |
slice(int start)
Reduce the set of matched elements by specifying a range of indexes This is the same as calling slice(start, Integer.MAX_VALUE) |
|
X |
slice(int start,
int end)
Reduce the set of matched elements by specifying a range of indexes |
|
String |
tag()
Get the first tag name in the current set of matched elements. |
|
String |
tag(int index)
Get a list of tag names in the current set of matched elements. |
|
List<String> |
tags()
Get a list of tag names in the current set of matched elements. |
|
String |
text()
Get the text content of the first element in the set of matched elements, or null if there are no matched elements. |
|
X |
text(Content content)
Set some text content to all elements in the set of matched elements (possibly replacing existing content). |
|
X |
text(String content)
Set some text content to all elements in the set of matched elements (possibly replacing existing content). |
|
List<String> |
texts()
Get all text content of the elements in the set of matched elements. |
|
| Methods inherited from interface java.lang.Iterable |
|---|
iterator |
| Method Detail |
|---|
Element get(int index)
List<Element> get()
int size()
X add(Element... elements)
X add(X... elements)
X children()
X children(String selector)
X children(Filter filter)
X each(Each each)
X filter(String selector)
X filter(Filter filter)
X eq(int index)
X find()
X find(String selector)
X find(Filter filter)
X first()
X has(String selector)
X has(Filter filter)
boolean is(String selector)
boolean is(Filter filter)
X last()
<E> List<E> map(Mapper<E> map)
X next()
X next(String selector)
X next(Filter filter)
X nextAll()
X nextAll(String selector)
X nextAll(Filter filter)
X nextUntil(String until)
X nextUntil(Filter until)
X nextUntil(String until,
String selector)
X nextUntil(String until,
Filter filter)
X nextUntil(Filter until,
String selector)
X nextUntil(Filter until,
Filter filter)
X not(String selector)
X not(Filter filter)
X parent()
X parent(String selector)
X parent(Filter filter)
X parents()
X parents(String selector)
X parents(Filter filter)
X parentsUntil(String until)
X parentsUntil(Filter until)
X parentsUntil(String until,
String selector)
X parentsUntil(String until,
Filter filter)
X parentsUntil(Filter until,
String selector)
X parentsUntil(Filter until,
Filter filter)
X prev()
X prev(String selector)
X prev(Filter filter)
X prevAll()
X prevAll(String selector)
X prevAll(Filter filter)
X prevUntil(String until)
X prevUntil(Filter until)
X prevUntil(String until,
String selector)
X prevUntil(String until,
Filter filter)
X prevUntil(Filter until,
String selector)
X prevUntil(Filter until,
Filter filter)
X siblings()
X siblings(String selector)
X siblings(Filter filter)
X slice(int start)
This is the same as calling slice(start, Integer.MAX_VALUE)
X slice(int start,
int end)
X before(String content)
X before(Content content)
X after(String content)
X after(Content content)
X prepend(String content)
X prepend(Content content)
X append(String content)
X append(Content content)
X replaceWith(String content)
X replaceWith(Content content)
X empty()
X remove()
X remove(String selector)
X remove(Filter filter)
String attr(String name)
name from the first element in the set of
matched elements, or null if the first element does not have
that attribute.
List<String> attrs(String name)
name from all elements in the set of
matched elements
X attr(String name,
String value)
value is null, then the attribute is removed. If the
attribute already exists, then it is replaced.
X attr(String name,
Content value)
value returns null, then the attribute is removed. If the
attribute already exists, then it is replaced.
X removeAttr(String name)
attr(name, null).
String content()
null if there are no matched elements
List<String> contents()
X content(String content)
text(String)
X content(Content content)
text(String)
String text()
null if there are no matched elements.
List<String> texts()
X text(String content)
X text(Content content)
X copy()
X wrapper. This is not a deep-copy of wrapped
Element objects. Both this and the copy will reference the same
Element's
String tag()
This is the same as calling tag(0)
String tag(int index)
List<String> tags()
String id()
This is the same as calling id(0)
String id(int index)
This is the same as calling eq(index).attr("id")
List<String> ids()
This is the same as calling attrs("id")
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||