|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.core.util.XMLUtils
public class XMLUtils
| Nested Class Summary | |
|---|---|
static class |
XMLUtils.ReplacePolicy
|
static interface |
XMLUtils.TransformPolicy
|
| Constructor Summary | |
|---|---|
XMLUtils()
|
|
| Method Summary | |
|---|---|
static String |
escape(char ch)
If there is a suitable entity reference for this character, return it. |
static String |
escape(char ch,
XMLUtils.TransformPolicy policy)
Escape XML characters with a user specified transformation policy for invalid characters. |
static String |
escape(String source)
Escape an XML string using a default policy of replacing invalid XML characters. |
static String |
escape(String source,
XMLUtils.TransformPolicy policy)
Escapes a string so it may be returned as text content or attribute value. |
static String |
escapeForCdata(String source)
|
static String |
getAttributeWithDefault(Element element,
String attributeName,
String defaultValue)
Get an attribute of a given element, with a default value if the attribute is not present or blank. |
static String |
getContainedText(Node parent,
String childTagName)
With a given parent XML Element, find the text contents of the child element with supplied name. |
static Element |
getSingleChildElement(Element el,
String name)
Given one element, get a single named child element of it. |
static boolean |
validXml(char ch)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XMLUtils()
| Method Detail |
|---|
public static String getContainedText(Node parent,
String childTagName)
public static Element getSingleChildElement(Element el,
String name)
public static String getAttributeWithDefault(Element element,
String attributeName,
String defaultValue)
public static String escape(String source,
XMLUtils.TransformPolicy policy)
source - the string to escape or "" for null.policy - how to handle invalid XML characterspublic static String escape(String source)
public static String escapeForCdata(String source)
public static String escape(char ch)
public static String escape(char ch,
XMLUtils.TransformPolicy policy)
public static boolean validXml(char ch)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||