|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.arsdigita.xml.XML
Provides a set of helper methods for dealing with XML, including file parsing & object -> string serialization
| Nested Class Summary | |
static interface |
XML.Action
This visitor is called by traverse(Element, int, XML.Action). |
| Method Summary | |
static Formatter |
findFormatter(Class klass)
Looks for the best matching formatter. |
static String |
format(Object value)
Converts an object to a String using the closest matching registered Formatter implementation. |
static Formatter |
getFormatter(Class klass)
Gets a directly registered formatter for a class. |
static void |
parse(InputStream source,
org.xml.sax.helpers.DefaultHandler handler)
Processes an XML file with the default SAX Parser, with namespace processing, schema validation & DTD validation enabled. |
static void |
parseResource(String path,
org.xml.sax.helpers.DefaultHandler handler)
Processes an XML file with the default SAX Parser, with namespace processing, schema validation & DTD validation enabled. |
static void |
registerFormatter(Class klass,
Formatter formatter)
Registers a formatter for serializing objects of a class to a String suitable for XML output. |
static String |
toSkeleton(Element element)
This is a wrapper for toSkeleton(Element, PrintWriter). |
static void |
toSkeleton(Element element,
PrintWriter writer)
Prints the skeleton structure of the element to the supplied print writer. |
static void |
traverse(Element elem,
int level,
XML.Action action)
Pre-order, depth-first traversal. |
static void |
unregisterFormatter(Class klass)
Unregisters a formatter against a class. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public static void registerFormatter(Class klass,
Formatter formatter)
public static void unregisterFormatter(Class klass)
public static Formatter getFormatter(Class klass)
klass - the class to find a formatter for
public static Formatter findFormatter(Class klass)
klass - the class to find a formatter for
public static String format(Object value)
public static final void parseResource(String path,
org.xml.sax.helpers.DefaultHandler handler)
path - the XML file relative to the webapp roothandler - the content handler
public static final void parse(InputStream source,
org.xml.sax.helpers.DefaultHandler handler)
source - the xml input streamhandler - the content handler
public static void toSkeleton(Element element,
PrintWriter writer)
public static String toSkeleton(Element element)
toSkeleton(Element, PrintWriter).
public static void traverse(Element elem,
int level,
XML.Action action)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||