Modifier and Type | Class and Description |
---|---|
static class |
Jerry.JerryParser
Content parser and Jerry factory.
|
Modifier and Type | Field and Description |
---|---|
protected DOMBuilder |
builder |
protected Node[] |
nodes |
protected Jerry |
parent |
Modifier | Constructor and Description |
---|---|
protected |
Jerry(DOMBuilder builder,
Node... nodes)
Creates root Jerry.
|
protected |
Jerry(Jerry parent,
java.util.List<Node> nodeList)
Creates child Jerry.
|
protected |
Jerry(Jerry parent,
Node... nodes)
Creates child Jerry.
|
protected |
Jerry(Jerry parent,
Node[] nodes1,
Node[] nodes2)
Creates child Jerry.
|
Modifier and Type | Method and Description |
---|---|
Jerry |
add(java.lang.String selector)
Adds elements to the set of matched elements.
|
Jerry |
addClass(java.lang.String... classNames)
Adds the specified class(es) to each of the set of matched elements.
|
Jerry |
after(java.lang.String html)
Inserts content, specified by the parameter, after each
element in the set of matched elements.
|
Jerry |
append(java.lang.String html)
Inserts content, specified by the parameter, to the end of each
element in the set of matched elements.
|
java.lang.String |
attr(java.lang.String name)
Gets the value of an attribute for the first element in the set of matched elements.
|
Jerry |
attr(java.lang.String name,
java.lang.String value)
Sets one or more attributes for the set of matched elements.
|
Jerry |
before(java.lang.String html)
Inserts content, specified by the parameter, before each
element in the set of matched elements.
|
Jerry |
children()
Gets the immediate children of each element in the set of matched elements.
|
Jerry |
contents()
Get the children of each element in the set of matched elements,
including text and comment nodes.
|
protected NodeSelector |
createNodeSelector(Node node)
Creates node selector.
|
protected java.util.Map<java.lang.String,java.lang.String> |
createPropertiesMap(java.lang.String attrValue,
char propertiesDelimiter,
char valueDelimiter) |
protected java.util.Set<java.lang.String> |
createPropertiesSet(java.lang.String attrValue,
char propertiesDelimiter) |
Jerry |
css(java.lang.String... css)
Sets one or more CSS properties for the set of matched elements.
|
java.lang.String |
css(java.lang.String propertyName)
Gets the value of a style property for the first element
in the set of matched elements.
|
Jerry |
css(java.lang.String propertyName,
java.lang.String value)
Sets one or more CSS properties for the set of matched elements.
|
Jerry |
detach()
Removes the set of matched elements from the DOM.
|
Jerry |
each(JerryFunction function)
Iterates over a jQuery object, executing a function for
each matched element.
|
Jerry |
eachNode(JerryNodeFunction function)
Iterates over a jQuery object, executing a function for
each matched element.
|
Jerry |
empty()
Removes all child nodes of the set of matched elements from the DOM.
|
Jerry |
end()
Ends the most recent filtering operation in the current chain
and returns the set of matched elements to its previous state.
|
Jerry |
eq(int value)
Reduces the set of matched elements to the one at the specified index.
|
Jerry |
filter(JerryFunction jerryFunction)
Reduces the set of matched elements to those that pass the
function's test. |
Jerry |
filter(java.lang.String cssSelectors)
Reduces the set of matched elements to those that match the selector.
|
Jerry |
find(java.lang.String cssSelector)
Gets the descendants of each element in the current set of matched elements,
filtered by a selector.
|
Jerry |
first()
Reduces the set of matched elements to the first in the set.
|
Jerry |
form(java.lang.String formCssSelector,
JerryFormHandler jerryFormHandler)
Processes all forms, collects all form parameters and calls back the
JerryFormHandler . |
protected java.lang.String |
generateAttributeValue(java.util.Map<java.lang.String,java.lang.String> map,
char propertiesDelimiter,
char valueDelimiter) |
protected java.lang.String |
generateAttributeValue(java.util.Set<java.lang.String> set,
char propertiesDelimiter) |
Node[] |
get()
Retrieve all DOM elements matched by this set.
|
Node |
get(int index)
Returns node at given index.
|
Jerry |
gt(int value)
Reduces the set of matched elements to the one at an index greater
than specified index.
|
Jerry |
has(java.lang.String cssSelectors)
Reduce the set of matched elements to those that have a descendant that
matches the selector or DOM element.
|
boolean |
hasClass(java.lang.String... classNames)
Determines whether any of the matched elements are assigned the given class.
|
java.lang.String |
html()
Gets the HTML contents of the first element in the set of matched elements.
|
Jerry |
html(java.lang.String html)
Sets the HTML contents of each element in the set of matched elements.
|
java.lang.String |
htmlAll(boolean setIncluded)
Gets the combined HTML contents of each element in the set of
matched elements, including their descendants.
|
int |
index(Node element)
Searches for a given
Node from among the matched elements. |
boolean |
is(java.lang.String cssSelectors)
Checks the current matched set of elements against a selector and
return
true if at least one of these elements matches
the given arguments. |
java.util.Iterator<Jerry> |
iterator()
Returns iterator over nodes contained in the Jerry object.
|
static Jerry.JerryParser |
jerry()
Just creates new
Jerry runner to separate
parser creation and creation of new Jerry instances. |
static Jerry |
jerry(char[] content)
Parses input sequence and creates new
Jerry . |
static Jerry.JerryParser |
jerry(DOMBuilder domBuilder)
Creates new
Jerry runner with
provided implementation of DOMBuilder . |
static Jerry |
jerry(java.lang.String content)
Parses input content and creates new
Jerry . |
Jerry |
last()
Reduces the set of matched elements to the last in the set.
|
int |
length()
Returns number of nodes in this Jerry.
|
Jerry |
lt(int value)
Reduces the set of matched elements to the one at an index less
than specified index.
|
Jerry |
next()
Gets the immediately following sibling of each element in the
set of matched elements.
|
Jerry |
nextAll()
Get all following siblings of each element in the set of matched
elements, optionally filtered by a selector.
|
Jerry |
not(java.lang.String cssSelector)
Removes elements from the set of matched elements.
|
Jerry |
parent()
Gets the parent of each element in the current set of matched elements.
|
Jerry |
prepend(java.lang.String html)
Insert content, specified by the parameter, to the beginning of each
element in the set of matched elements.
|
Jerry |
prev()
Gets the immediately preceding sibling of each element in the
set of matched elements.
|
Jerry |
prevAll()
Get all preceding siblings of each element in the set of matched
elements, optionally filtered by a selector.
|
Jerry |
remove()
Removes the set of matched elements from the DOM.
|
Jerry |
removeAttr(java.lang.String name)
Removes an attribute from each element in the set of matched elements.
|
Jerry |
removeClass(java.lang.String... classNames)
Removes a single class, multiple classes, or all classes
from each element in the set of matched elements.
|
Jerry |
replaceWith(java.lang.String html)
Replace each element in the set of matched elements with the provided
new content and return the set of elements that was removed.
|
Jerry |
root()
Returns root Jerry.
|
Jerry |
s(java.lang.String cssSelector)
Selects nodes.
|
Jerry |
siblings()
Gets the siblings of each element in the set of matched elements.
|
int |
size()
Returns number of nodes in this Jerry.
|
java.lang.String |
text()
Gets the combined text contents of each element in the set of
matched elements, including their descendants.
|
Jerry |
text(java.lang.String text)
Sets the content of each element in the set of matched elements to the specified text.
|
Jerry |
toggleClass(java.lang.String... classNames)
Adds or remove one or more classes from each element in the set of
matched elements, depending on either the class's presence or
the value of the switch argument.
|
Jerry |
unwrap()
Remove the parents of the set of matched elements from the DOM, leaving
the matched elements (and siblings, if any) in their place.
|
Jerry |
wrap(java.lang.String html)
Wraps an HTML structure around each element in the set of matched elements.
|
protected final Jerry parent
protected final Node[] nodes
protected final DOMBuilder builder
protected Jerry(DOMBuilder builder, Node... nodes)
public static Jerry jerry(char[] content)
Jerry
.public static Jerry jerry(java.lang.String content)
Jerry
.public static Jerry.JerryParser jerry()
Jerry runner
to separate
parser creation and creation of new Jerry instances.public static Jerry.JerryParser jerry(DOMBuilder domBuilder)
Jerry runner
with
provided implementation of DOMBuilder
.public int length()
public int size()
public Node get(int index)
null
if index is out of bounds.public Node[] get()
public int index(Node element)
Node
from among the matched elements.public Jerry children()
public Jerry contents()
public Jerry parent()
public Jerry siblings()
public Jerry next()
public Jerry nextAll()
public Jerry prev()
public Jerry prevAll()
public Jerry find(java.lang.String cssSelector)
public Jerry s(java.lang.String cssSelector)
find(String)
protected NodeSelector createNodeSelector(Node node)
public Jerry each(JerryFunction function)
eachNode(JerryNodeFunction)
public Jerry eachNode(JerryNodeFunction function)
each(JerryFunction)
public Jerry add(java.lang.String selector)
public Jerry end()
public Jerry not(java.lang.String cssSelector)
public Jerry root()
public Jerry first()
public Jerry last()
public Jerry eq(int value)
public Jerry gt(int value)
public Jerry lt(int value)
public boolean is(java.lang.String cssSelectors)
true
if at least one of these elements matches
the given arguments.public Jerry filter(java.lang.String cssSelectors)
public Jerry filter(JerryFunction jerryFunction)
function's
test.public Jerry has(java.lang.String cssSelectors)
public java.lang.String attr(java.lang.String name)
null
if set is empty.public Jerry attr(java.lang.String name, java.lang.String value)
public Jerry removeAttr(java.lang.String name)
public java.lang.String css(java.lang.String propertyName)
null
if set is empty.public Jerry css(java.lang.String propertyName, java.lang.String value)
public Jerry css(java.lang.String... css)
public Jerry addClass(java.lang.String... classNames)
public boolean hasClass(java.lang.String... classNames)
public Jerry removeClass(java.lang.String... classNames)
public Jerry toggleClass(java.lang.String... classNames)
public java.lang.String text()
public Jerry text(java.lang.String text)
public java.lang.String html()
htmlAll(boolean)
public java.lang.String htmlAll(boolean setIncluded)
setIncluded
- if true
than sets node are included in the outputhtml()
public Jerry html(java.lang.String html)
public Jerry append(java.lang.String html)
public Jerry prepend(java.lang.String html)
public Jerry before(java.lang.String html)
public Jerry after(java.lang.String html)
public Jerry replaceWith(java.lang.String html)
public Jerry remove()
public Jerry detach()
remove()
.public Jerry empty()
public Jerry wrap(java.lang.String html)
public Jerry unwrap()
public java.util.Iterator<Jerry> iterator()
each(JerryFunction)
.iterator
in interface java.lang.Iterable<Jerry>
public Jerry form(java.lang.String formCssSelector, JerryFormHandler jerryFormHandler)
JerryFormHandler
.protected java.util.Set<java.lang.String> createPropertiesSet(java.lang.String attrValue, char propertiesDelimiter)
protected java.lang.String generateAttributeValue(java.util.Set<java.lang.String> set, char propertiesDelimiter)
protected java.util.Map<java.lang.String,java.lang.String> createPropertiesMap(java.lang.String attrValue, char propertiesDelimiter, char valueDelimiter)
protected java.lang.String generateAttributeValue(java.util.Map<java.lang.String,java.lang.String> map, char propertiesDelimiter, char valueDelimiter)
Copyright © 2003-present Jodd Team