|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.funambol.util.XmlUtil
public class XmlUtil
Utility class that XML manipulation functions.
Method Summary | |
---|---|
static void |
addElement(java.lang.StringBuffer out,
java.lang.String tag)
Add an empty tag to the StringBuffer out. |
static void |
addElement(java.lang.StringBuffer out,
java.lang.String tag,
java.lang.String content)
Add a tag to the StringBuffer out. |
static void |
addElementNewLine(java.lang.StringBuffer out,
java.lang.String tag,
java.lang.String content,
boolean escape)
This function builds a simple Tag with newline char after the close tag. |
static void |
addElementNewLineWithTagAttr(java.lang.StringBuffer out,
java.lang.String tag,
java.lang.String content,
boolean escape,
java.lang.String[] attr)
This function builds a simple Tag with newline char after the close tag. |
static void |
addElementWithTagAttr(java.lang.StringBuffer out,
java.lang.String tag,
java.lang.String content,
java.lang.String[] attr)
Add a tag with attributes to the StringBuffer out. |
static java.lang.String |
createCloseTag(java.lang.String tagname)
|
static java.lang.String |
createCloseTagNewLine(java.lang.String tagname)
|
static java.lang.String |
createOpenTag(java.lang.String tagname)
|
static java.lang.String |
createOpenTagNewLine(java.lang.String tagname)
|
static java.lang.String |
escapeXml(java.lang.String str)
Escapes the characters in a String using XML entities. |
static int |
getTag(ChunkedString xml,
java.lang.String tag)
Return the index of tag, validating also the presence of the end tag. |
static java.util.Hashtable |
getTagAttributes(ChunkedString xml,
java.lang.String tag)
|
static ChunkedString |
getTagValue(ChunkedString xml,
java.lang.String tag)
Make a String by value of tag. |
static java.util.Vector |
getTagValues(ChunkedString xmlInput,
java.lang.String tag)
Return a Vector of String with tags matching the search tag. |
static java.util.Vector |
getTagValues(java.util.Vector xmlInput,
java.lang.String tag)
Return a Vector of String with tags matching the search tag. |
static java.lang.String |
unescapeXml(java.lang.String str)
Unescapes a string containing XML entity escapes to a string containing the actual Unicode characters corresponding to the escapes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.lang.String escapeXml(java.lang.String str)
Escapes the characters in a String
using XML entities.
Supports only the four basic XML entities (gt, lt, quot, amp). Does not support DTDs or external entities.
str
- the String
to escape, may be null
String
, null
if null string inputpublic static java.lang.String unescapeXml(java.lang.String str)
Unescapes a string containing XML entity escapes to a string containing the actual Unicode characters corresponding to the escapes.
Supports only the four basic XML entities (gt, lt, quot, amp). Does not support DTDs or external entities.
str
- the String
to unescape, may be null
String
, null
if null string inputpublic static int getTag(ChunkedString xml, java.lang.String tag)
xml
- xml msgtag
- tag to find
public static java.util.Hashtable getTagAttributes(ChunkedString xml, java.lang.String tag)
public static ChunkedString getTagValue(ChunkedString xml, java.lang.String tag) throws XmlException
xml
- xml msgtag
- tag to find + sourceType +
XmlException
public static java.util.Vector getTagValues(java.util.Vector xmlInput, java.lang.String tag) throws XmlException
xmlInput
- Vector of XML tags to search intag
- to find
XmlException
public static java.util.Vector getTagValues(ChunkedString xmlInput, java.lang.String tag) throws XmlException
xmlInput
- XML document to search intag
- to find
XmlException
public static void addElement(java.lang.StringBuffer out, java.lang.String tag)
out
- the buffer to append totag
- tag to be appendedpublic static void addElement(java.lang.StringBuffer out, java.lang.String tag, java.lang.String content)
out
- the buffer to append totag
- tag to be appendedpublic static void addElementNewLine(java.lang.StringBuffer out, java.lang.String tag, java.lang.String content, boolean escape)
out
- StringBuffer to store outputtag
- The Tag will be generatedcontent
- The content data of the Tagescape
- Flag to tell if data need to be escapedpublic static void addElementWithTagAttr(java.lang.StringBuffer out, java.lang.String tag, java.lang.String content, java.lang.String[] attr)
out
- the buffer to append totag
- tag to be appendedcontent
- The content data of the Tagattr
- The attributes arraypublic static void addElementNewLineWithTagAttr(java.lang.StringBuffer out, java.lang.String tag, java.lang.String content, boolean escape, java.lang.String[] attr)
out
- StringBuffer to store outputtag
- The Tag will be generatedcontent
- The content data of the Tagescape
- Flag to tell if data need to be escapedattr
- The attributes arraypublic static java.lang.String createOpenTag(java.lang.String tagname)
public static java.lang.String createOpenTagNewLine(java.lang.String tagname)
public static java.lang.String createCloseTag(java.lang.String tagname)
public static java.lang.String createCloseTagNewLine(java.lang.String tagname)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |