org.joox
Class JOOX

java.lang.Object
  extended by org.joox.JOOX

public final class JOOX
extends Object

Author:
Lukas Eder

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
<T> List<T>
convert(List<String> values, Class<T> type)
          Convert several values
static
<T> T
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

JOOX

public JOOX()
Method Detail

$

public static Match $(Object object)
Wrap a JAXB-marshallable element in a jOOX Match element set


$

public static Match $(String name)
Create a new DOM element in an independent document


$

public static Match $(String name,
                      String content)
Create a new DOM element in an independent document


$

public static Match $(String name,
                      Element... content)
Create a new DOM element in an independent document

The added content is cloned into the new document


$

public static Match $(String name,
                      Match... content)
Create a new DOM element in an independent document

The added content is cloned into the new document


$

public static Match $(Document document)
Wrap a DOM document in a jOOX Match element set


$

public static Match $(Element element)
Wrap a DOM element in a jOOX Match element set


$

public 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


$

public 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


$

public static Match $(Context context)
Convenience method for calling $(context.match())


$

public static Match $(File file)
               throws SAXException,
                      IOException
Read a DOM document from a file into a Match element set

Throws:
IOException
SAXException

$

public static Match $(InputStream stream)
               throws SAXException,
                      IOException
Read a DOM document from a stream into a Match element set

Throws:
IOException
SAXException

$

public static Match $(Reader reader)
               throws SAXException,
                      IOException
Read a DOM document from a reader into a Match element set

Throws:
IOException
SAXException

$

public static Match $(InputSource source)
               throws SAXException,
                      IOException
Read a DOM document from a file into a Match element set

Throws:
IOException
SAXException

none

public static FastFilter none()
A filter that always returns false


all

public static FastFilter all()
A filter that always returns true


even

public static FastFilter even()
A filter that returns true on all even iteration indexes (starting with 0!)


odd

public static FastFilter odd()
A filter that returns true on all odd iteration indexes (starting with 0!)


at

public static FastFilter at(int... indexes)
A filter that returns true on elements at given iteration indexes


selector

public static Filter selector(String selector)
A filter that returns all elements matched by a given 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.


tag

public static FastFilter tag(String tagName)
A filter that returns all elements with a given tag name


and

public static Filter and(Filter... filters)
Combine filters


or

public static Filter or(Filter... filters)
Combine filters


not

public static Filter not(Filter filter)
Inverse a filter


ids

public static FastFilter ids(String... ids)
Create a filter matching id attributes


content

public static Content content(String value)
Get a constant content that returns the same value for all elements.


ids

public static Mapper<String> ids()
Create a mapper that returns all id attributes


attrs

public static Mapper<String> attrs(String attributeName)
Create a mapper that returns all attributes with a given name


iterable

public static Iterable<Element> iterable(NodeList elements)
Wrap a NodeList into an Iterable


iterator

public static Iterator<Element> iterator(NodeList elements)
Wrap a NodeList into an Iterator


list

public static List<Element> list(NodeList elements)
Wrap a NodeList into an List


builder

public static DocumentBuilder builder()
Get a document builder


convert

public static <T> T convert(String value,
                            Class<T> type)
Convert a string value to any of these types:

All other values evaluate to null


convert

public static <T> List<T> convert(List<String> values,
                                  Class<T> type)
Convert several values

See Also:
convert(String, Class)


Copyright © 2012. All Rights Reserved.