|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.felix.scrplugin.xml.IOUtils
public class IOUtils
Utility class for xml/sax handling. It provides support for "older" sax implementations (like the default one shipped with JDK 1.4.2) which have bugs in the namespace handling.
| Nested Class Summary | |
|---|---|
static class |
IOUtils.NamespaceAsAttributes
A pipe that ensures that all namespace prefixes are also present as 'xmlns:' attributes. |
| Constructor Summary | |
|---|---|
IOUtils()
|
|
| Method Summary | |
|---|---|
protected static void |
addAttribute(org.xml.sax.helpers.AttributesImpl ai,
java.lang.String name,
java.lang.Object value)
Helper method to add an attribute. |
static org.xml.sax.ContentHandler |
getSerializer(java.io.File file)
|
protected static void |
indent(org.xml.sax.ContentHandler ch,
int level)
Helper method to indent the xml elements. |
protected static boolean |
needsNamespacesAsAttributes(java.util.Properties format)
Checks if the used Trax implementation correctly handles namespaces set using startPrefixMapping(), but wants them also as 'xmlns:' attributes. |
protected static void |
newline(org.xml.sax.ContentHandler ch)
Helper method to create a new line. |
static void |
parse(java.io.File file,
org.xml.sax.ContentHandler handler)
Parse a file and send the sax events to the content handler. |
protected static void |
text(org.xml.sax.ContentHandler ch,
java.lang.String text)
Helper method writing out a string. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public IOUtils()
| Method Detail |
|---|
public static final void parse(java.io.File file,
org.xml.sax.ContentHandler handler)
throws java.io.IOException,
javax.xml.transform.TransformerException
file - handler -
java.io.IOException
javax.xml.transform.TransformerException
public static org.xml.sax.ContentHandler getSerializer(java.io.File file)
throws java.io.IOException,
javax.xml.transform.TransformerException
java.io.IOException
javax.xml.transform.TransformerException
protected static boolean needsNamespacesAsAttributes(java.util.Properties format)
throws javax.xml.transform.TransformerException,
org.xml.sax.SAXException
startPrefixMapping(), but wants them also as 'xmlns:' attributes.
The check consists in sending SAX events representing a minimal namespaced document
with namespaces defined only with calls to startPrefixMapping (no
xmlns:xxx attributes) and check if they are present in the resulting text.
javax.xml.transform.TransformerException
org.xml.sax.SAXException
protected static void addAttribute(org.xml.sax.helpers.AttributesImpl ai,
java.lang.String name,
java.lang.Object value)
ai - The attributes impl receiving the additional attribute.name - The name of the attribute.value - The value of the attribute.
protected static void text(org.xml.sax.ContentHandler ch,
java.lang.String text)
throws org.xml.sax.SAXException
ch - The content handler.text -
org.xml.sax.SAXException
protected static void indent(org.xml.sax.ContentHandler ch,
int level)
throws org.xml.sax.SAXException
ch - The content handler.level - The level of indention.
org.xml.sax.SAXException
protected static void newline(org.xml.sax.ContentHandler ch)
throws org.xml.sax.SAXException
ch - The content handler.
org.xml.sax.SAXException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||