|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.joox.JOOX
public final class JOOX
Constructor Summary | |
---|---|
JOOX()
|
Method Summary | ||
---|---|---|
static Match |
$(Context context)
Convenience method for calling $(context.match()) |
|
static Match |
$(Document document)
Wrap a DOM document in a jOOX Match element set |
|
static Match |
$(Element element)
Wrap a DOM element in a jOOX Match element set |
|
static Match |
$(File file)
Read a DOM document from a file into a Match element set |
|
static Match |
$(InputSource source)
Read a DOM document from a file into a Match element set |
|
static Match |
$(InputStream stream)
Read a DOM document from a stream into a Match element set |
|
static Match |
$(Node node)
Wrap a DOM element or document in a jOOX Match element set
If the supplied Node is neither an element nor a document, then an empty
Match is created |
|
static Match |
$(NodeList list)
Wrap a DOM NodeList in a jOOX Match element set
If the supplied NodeList is empty or null, then an empty Match is created |
|
static Match |
$(Object object)
Wrap a JAXB-marshallable element in a jOOX Match element set |
|
static Match |
$(Reader reader)
Read a DOM document from a reader into a Match element set |
|
static Match |
$(String name)
Create a new DOM element in an independent document |
|
static Match |
$(String name,
Element... content)
Create a new DOM element in an independent document The added content is cloned into the new document |
|
static Match |
$(String name,
Match... content)
Create a new DOM element in an independent document The added content is cloned into the new document |
|
static Match |
$(String name,
String content)
Create a new DOM element in an independent document |
|
static FastFilter |
all()
A filter that always returns true |
|
static Filter |
and(Filter... filters)
Combine filters |
|
static FastFilter |
at(int... indexes)
A filter that returns true on elements at given iteration indexes |
|
static Mapper<String> |
attrs(String attributeName)
Create a mapper that returns all attributes with a given name |
|
static DocumentBuilder |
builder()
Get a document builder |
|
static Content |
content(String value)
Get a constant content that returns the same value for all
elements. |
|
static
|
convert(List<String> values,
Class<T> type)
Convert several values |
|
static
|
convert(String value,
Class<T> type)
Convert a string value to any of these types: String : The conversion has no effect
Byte : Numeric conversion. |
|
static FastFilter |
even()
A filter that returns true on all even iteration indexes (starting with 0!) |
|
static Mapper<String> |
ids()
Create a mapper that returns all id attributes |
|
static FastFilter |
ids(String... ids)
Create a filter matching id attributes |
|
static Iterable<Element> |
iterable(NodeList elements)
Wrap a NodeList into an Iterable |
|
static Iterator<Element> |
iterator(NodeList elements)
Wrap a NodeList into an Iterator |
|
static List<Element> |
list(NodeList elements)
Wrap a NodeList into an List |
|
static FastFilter |
none()
A filter that always returns false |
|
static Filter |
not(Filter filter)
Inverse a filter |
|
static FastFilter |
odd()
A filter that returns true on all odd iteration indexes (starting with 0!) |
|
static Filter |
or(Filter... filters)
Combine filters |
|
static Filter |
selector(String selector)
A filter that returns all elements matched by a given selector. |
|
static FastFilter |
tag(String tagName)
A filter that returns all elements with a given tag name |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JOOX()
Method Detail |
---|
public static Match $(Object object)
Match
element set
public static Match $(String name)
public static Match $(String name, String content)
public static Match $(String name, Element... content)
The added content is cloned into the new document
public static Match $(String name, Match... content)
The added content is cloned into the new document
public static Match $(Document document)
Match
element set
public static Match $(Element element)
Match
element set
public static Match $(Node node)
Match
element set
If the supplied Node is neither an element nor a document, then an empty Match is created
public static Match $(NodeList list)
NodeList
in a jOOX Match
element set
If the supplied NodeList is empty or null, then an empty Match is created
public static Match $(Context context)
$(context.match())
public static Match $(File file) throws SAXException, IOException
Match
element set
IOException
SAXException
public static Match $(InputStream stream) throws SAXException, IOException
Match
element set
IOException
SAXException
public static Match $(Reader reader) throws SAXException, IOException
Match
element set
IOException
SAXException
public static Match $(InputSource source) throws SAXException, IOException
Match
element set
IOException
SAXException
public static FastFilter none()
public static FastFilter all()
public static FastFilter even()
public static FastFilter odd()
public static FastFilter at(int... indexes)
public static Filter selector(String selector)
As of jOOX 0.9.0, this is the same as calling tag(String)
. More
sophisticated selector expressions will be added in the future.
public static FastFilter tag(String tagName)
public static Filter and(Filter... filters)
public static Filter or(Filter... filters)
public static Filter not(Filter filter)
public static FastFilter ids(String... ids)
public static Content content(String value)
value
for all
elements.
public static Mapper<String> ids()
id
attributes
public static Mapper<String> attrs(String attributeName)
public static Iterable<Element> iterable(NodeList elements)
NodeList
into an Iterable
public static Iterator<Element> iterator(NodeList elements)
NodeList
into an Iterator
public static List<Element> list(NodeList elements)
NodeList
into an List
public static DocumentBuilder builder()
public static <T> T convert(String value, Class<T> type)
String
: The conversion has no effectByte
: Numeric conversion. NaN will return nullShort
: Numeric conversion. NaN will return nullInteger
: Numeric conversion. NaN will return nullLong
: Numeric conversion. NaN will return nullFloat
: Numeric conversion. NaN will return nullDouble
: Numeric conversion. NaN will return nullBigDecimal
: Numeric conversion. NaN will return nullBigInteger
: Numeric conversion. NaN will return nullBoolean
: Boolean conversion. Boolean values for
true
are any of these case-insensitive strings:
1
y
yes
true
on
enabled
false
are any of these case-insensitive
strings:
0
n
no
false
off
disabled
Date
: Datetime conversion.Calendar
: Datetime conversion.Timestamp
: Datetime conversion. Possible patterns
for datetime conversion are
yyyy
: Only the year is parsedyyyy[-/]MM
: Year and month are parsed. Separator
characters are optionalyyyy[-/]MM[-/]dd
: Date is parsed. Separator characters
are optionaldd[-/.]MM[-/.]yyyy
: Date is parsed. Separator characters
are mandatoryyyyy[-/]MM[-/]dd[T ]HH
: Date and hour are parsed.
Separator characters are optionalyyyy[-/]MM[-/]dd[T ]HH[:]mm
: Date and time are parsed.
Separator characters are optionalyyyy[-/]MM[-/]dd[T ]HH[:]mm[:]ss
: Date and time are
parsed. Separator characters are optionalyyyy[-/]MM[-/]dd[T ]HH[:]mm[:]ss.SSS
: Date and time are
parsed. Separator characters are optionalDate
: Date conversion. Possible patterns for date
conversion are
yyyy
: Only the year is parsedyyyy[-/]MM
: Year and month are parsed. Separator
characters are optionalyyyy[-/]MM[-/]dd
: Date is parsed. Separator characters
are optionaldd[-/.]MM[-/.]yyyy
: Date is parsed. Separator characters
are mandatoryTime
: Time conversion. Possible patterns for time
conversion are
HH
: Hour is parsed. Separator characters are optionalHH[:]mm
: Hour and minute are parsed. Separator
characters are optionalHH[:]mm[:]ss
: Time is parsed. Separator characters are
optional
All other values evaluate to null
public static <T> List<T> convert(List<String> values, Class<T> type)
convert(String, Class)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |