|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ccs.xml.XUtil
public class XUtil
Various utility methods for generating and interacting with XML-style markup languages, including HTML.
Method Summary | |
---|---|
static java.lang.String |
attr(java.lang.String name,
java.lang.String value)
Returns a string of the form ¬name="value" where the
'¬' character stands for a single space character. |
static java.lang.String |
elem(java.lang.String name,
java.lang.String value)
Return a string of the form <name>value</name> . |
static java.lang.String |
esc(java.lang.String src)
Returns a markup-friendly version of the source string. |
static java.lang.String |
esc(java.lang.String src,
java.lang.String bypass)
Returns a markup-friendly version of the source string. |
static java.lang.String |
esca(java.lang.String name,
boolean value)
As esca(String, String) , except that the value is a boolean
to be encoded as a string (either true or false). |
static java.lang.String |
esca(java.lang.String name,
int value)
As esca(String, String) , except that the value is an int to
be encoded as a string. |
static java.lang.String |
esca(java.lang.String name,
long value)
As esca(String, String) , except that the value is a long to
be encoded as a string. |
static java.lang.String |
esca(java.lang.String name,
java.lang.String value)
Returns a string of the form ¬name="value" where the
'¬' character stands for a single space character. |
static java.lang.String |
esce(java.lang.String name,
boolean value)
Return a string of the form <name>value</name> . |
static java.lang.String |
esce(java.lang.String name,
int value)
Return a string of the form <name>value</name> . |
static java.lang.String |
esce(java.lang.String name,
long value)
Return a string of the form <name>value</name> . |
static java.lang.String |
esce(java.lang.String name,
java.lang.String value)
Return a string of the form <name>value</name> . |
static javax.xml.transform.Templates |
newTemplates(javax.xml.transform.Source xform)
Returns a new XSLT templates object based on the supplied transform. |
static org.xml.sax.XMLReader |
newXMLReader()
Returns a new SAX parser. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static org.xml.sax.XMLReader newXMLReader()
public static javax.xml.transform.Templates newTemplates(javax.xml.transform.Source xform)
public static java.lang.String esc(java.lang.String src, java.lang.String bypass)
src
- The source text.bypass
- If not null, any characters in this string will not be escaped.
public static java.lang.String esc(java.lang.String src)
esc(src, null)
.
src
- The source text.
public static java.lang.String esca(java.lang.String name, java.lang.String value)
¬name="value"
where the
'¬' character stands for a single space character. This form is what
an XML attribute looks like, which makes this form useful when generating
XML documents from data objects. The value string is escaped by passing it
through esc
; the name isn't.
name
- The attribute name.value
- The attribute value.
public static java.lang.String esca(java.lang.String name, boolean value)
esca(String, String)
, except that the value is a boolean
to be encoded as a string (either true
or false).
name
- The attribute name.value
- The attribute value.
public static java.lang.String esca(java.lang.String name, int value)
esca(String, String)
, except that the value is an int to
be encoded as a string.
name
- The attribute name.value
- The attribute value.
public static java.lang.String esca(java.lang.String name, long value)
esca(String, String)
, except that the value is a long to
be encoded as a string.
name
- The attribute name.value
- The attribute value.
public static java.lang.String esce(java.lang.String name, java.lang.String value)
<name>value</name>
.
This form is useful when generating XML documents from data objects.
The value string is escaped by passing it through esc
; the name isn't.
name
- The attribute name.value
- The attribute value.
public static java.lang.String esce(java.lang.String name, int value)
<name>value</name>
.
This form is useful when generating XML documents from data objects.
name
- The attribute name.value
- The attribute value.
public static java.lang.String esce(java.lang.String name, long value)
<name>value</name>
.
This form is useful when generating XML documents from data objects.
name
- The attribute name.value
- The attribute value.
public static java.lang.String esce(java.lang.String name, boolean value)
<name>value</name>
.
This form is useful when generating XML documents from data objects.
name
- The attribute name.value
- The attribute value.
public static java.lang.String attr(java.lang.String name, java.lang.String value)
¬name="value"
where the
'¬' character stands for a single space character. This form is what
an XML attribute looks like, which makes this form useful when generating
XML documents from data objects. Note that the value is not escaped: use with
caution.
name
- The attribute name.value
- The attribute value.
public static java.lang.String elem(java.lang.String name, java.lang.String value)
<name>value</name>
.
This form is useful when generating XML documents from data objects.
Note that the value is not escaped: use with caution.
name
- The attribute name.value
- The attribute value.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |