public class Picker
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
Picker |
addClass(java.lang.String where,
java.lang.String what)
Add a class
|
Picker |
after(java.lang.String where,
java.lang.String what)
Add after a given node
|
Picker |
append(java.lang.String what)
Append the node as a children to the current node
|
Picker |
append(java.lang.String where,
java.lang.String what)
Append the node as a children to the selected node.
|
Picker |
attr(java.lang.String where,
java.lang.String attr,
java.lang.String what)
Set attribute
|
Picker |
before(java.lang.String where,
java.lang.String what)
Add before a given node
|
static Picker |
create(java.lang.String html)
Get a picker from a string
|
static Picker |
create(java.lang.String html,
java.lang.String cssq)
Get a picker from a string and select the given query
|
Picker |
dump(Log log)
Convenience method to dump the html of the current node - embedded calls
are decoded.
|
static void |
dump(Log log,
java.lang.String html)
Convenience method to dump a generic html are decoded.
|
Picker |
empty()
Empty the current node
|
Picker |
empty(java.lang.String where)
Empty the specified node
|
java.lang.String |
html(Content... content)
Return the inner html of the selected nod.
|
java.lang.String |
innerHtml(Content... content)
Alias for html(...)
|
static Picker |
load(java.lang.String resource)
Get a picker form a given resource in the classpath and select the given
query
|
static Picker |
load(java.lang.String resource,
java.lang.String cssq)
Get a picker form a given resource in the classpath
|
Picker |
odump(Log log)
Convenience method to dump the outer html of the current node - embedded
calls are decoded.
|
java.lang.String |
outerHtml(Content... content)
Return the html of the selected node including the node itself
|
Picker |
prefixAttrs(java.lang.String where,
java.lang.String attr,
java.lang.String prefix)
Set attribute prefix for all the attributes found
|
Picker |
remove(java.lang.String where)
Remove nodes specified
|
Picker |
removeAttrs(java.lang.String where,
java.lang.String... attrs)
Remove specified attributes
|
Picker |
replace(java.lang.String where,
java.lang.String what)
Replace where indicated with the specified html
|
Picker |
replaceWith(java.lang.String where,
java.lang.String what)
Replace tag selected by "where" with String "What"
|
Picker |
select(java.lang.String where)
Select a new element and return a new Picker
|
Picker |
single(java.lang.String where)
Keep only one instance of the node specified
|
java.lang.String |
toString()
Print the current selected node as a string
|
Picker |
up()
Return to the precedent selected element
|
public static Picker load(java.lang.String resource, java.lang.String cssq)
resource
- cssq
- public static Picker load(java.lang.String resource)
resource
- cssq
- public static Picker create(java.lang.String html)
resource
- cssq
- public static Picker create(java.lang.String html, java.lang.String cssq)
resource
- cssq
- public Picker select(java.lang.String where)
where
- java.lang.Exception
public Picker up()
where
- public Picker replace(java.lang.String where, java.lang.String what)
where
- what
- java.lang.Exception
public Picker remove(java.lang.String where)
where
- public Picker removeAttrs(java.lang.String where, java.lang.String... attrs)
where
- public Picker single(java.lang.String where)
where
- public Picker empty(java.lang.String where)
where
- public Picker empty()
where
- public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String html(Content... content)
public java.lang.String innerHtml(Content... content)
public java.lang.String outerHtml(Content... content)
public Picker before(java.lang.String where, java.lang.String what)
where
- what
- public Picker after(java.lang.String where, java.lang.String what)
where
- what
- public Picker append(java.lang.String where, java.lang.String what)
where
- what
- public Picker append(java.lang.String what)
where
- what
- public Picker attr(java.lang.String where, java.lang.String attr, java.lang.String what)
public Picker prefixAttrs(java.lang.String where, java.lang.String attr, java.lang.String prefix)
public Picker addClass(java.lang.String where, java.lang.String what)
public Picker dump(Log log)
stream
- public static void dump(Log log, java.lang.String html)
stream
- public Picker odump(Log log)
stream
- public Picker replaceWith(java.lang.String where, java.lang.String what)
where
- Selection criteria (placeholder)what
- The string to replace the "where" with, this must be valid
HTML