@Deprecated
public class XML
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.Character |
AMP
Deprecated.
The Character '&'.
|
static java.lang.Character |
APOS
Deprecated.
The Character '''.
|
static java.lang.Character |
BANG
Deprecated.
The Character '!'.
|
static java.lang.Character |
EQ
Deprecated.
The Character '='.
|
static java.lang.Character |
GT
Deprecated.
The Character
|
static java.lang.Character |
LT
Deprecated.
The Character '<'.
|
static java.lang.String |
NULL_ATTR
Deprecated.
Null attribute name
|
static java.lang.Character |
QUEST
Deprecated.
The Character '?'.
|
static java.lang.Character |
QUOT
Deprecated.
The Character '"'.
|
static java.lang.Character |
SLASH
Deprecated.
The Character '/'.
|
static java.lang.String |
TYPE_ATTR
Deprecated.
|
Constructor and Description |
---|
XML()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
escape(java.lang.String string)
Deprecated.
Replace special characters with XML escapes:
|
static void |
noSpace(java.lang.String string)
Deprecated.
Throw an exception if the string contains whitespace.
|
static java.lang.Object |
stringToValue(java.lang.String string)
Deprecated.
This method is the same as
JSONObject.stringToValue(String) . |
static java.lang.Object |
stringToValue(java.lang.String string,
XMLXsiTypeConverter<?> typeConverter)
Deprecated.
This method tries to convert the given string value to the target object
|
static JSONObject |
toJSONObject(java.io.Reader reader)
Deprecated.
Convert a well-formed (but not necessarily valid) XML into a
JSONObject.
|
static JSONObject |
toJSONObject(java.io.Reader reader,
boolean keepStrings)
Deprecated.
Convert a well-formed (but not necessarily valid) XML into a
JSONObject.
|
static JSONObject |
toJSONObject(java.io.Reader reader,
XMLParserConfiguration config)
Deprecated.
Convert a well-formed (but not necessarily valid) XML into a
JSONObject.
|
static JSONObject |
toJSONObject(java.lang.String string)
Deprecated.
Convert a well-formed (but not necessarily valid) XML string into a
JSONObject.
|
static JSONObject |
toJSONObject(java.lang.String string,
boolean keepStrings)
Deprecated.
Convert a well-formed (but not necessarily valid) XML string into a
JSONObject.
|
static JSONObject |
toJSONObject(java.lang.String string,
XMLParserConfiguration config)
Deprecated.
Convert a well-formed (but not necessarily valid) XML string into a
JSONObject.
|
static java.lang.String |
toString(java.lang.Object object)
Deprecated.
Convert a JSONObject into a well-formed, element-normal XML string.
|
static java.lang.String |
toString(java.lang.Object object,
int indentFactor)
Deprecated.
Convert a JSONObject into a well-formed, pretty printed element-normal XML string.
|
static java.lang.String |
toString(java.lang.Object object,
java.lang.String tagName)
Deprecated.
Convert a JSONObject into a well-formed, element-normal XML string.
|
static java.lang.String |
toString(java.lang.Object object,
java.lang.String tagName,
int indentFactor)
Deprecated.
Convert a JSONObject into a well-formed, pretty printed element-normal XML string.
|
static java.lang.String |
toString(java.lang.Object object,
java.lang.String tagName,
XMLParserConfiguration config)
Deprecated.
Convert a JSONObject into a well-formed, element-normal XML string.
|
static java.lang.String |
toString(java.lang.Object object,
java.lang.String tagName,
XMLParserConfiguration config,
int indentFactor)
Deprecated.
Convert a JSONObject into a well-formed, pretty printed element-normal XML string.
|
static java.lang.String |
unescape(java.lang.String string)
Deprecated.
Removes XML escapes from the string.
|
public static final java.lang.Character AMP
public static final java.lang.Character APOS
public static final java.lang.Character BANG
public static final java.lang.Character EQ
public static final java.lang.Character GT
'>'.
public static final java.lang.Character LT
public static final java.lang.Character QUEST
public static final java.lang.Character QUOT
public static final java.lang.Character SLASH
public static final java.lang.String NULL_ATTR
public static final java.lang.String TYPE_ATTR
public static java.lang.String escape(java.lang.String string)
& (ampersand) is replaced by &amp;
< (less than) is replaced by &lt;
> (greater than) is replaced by &gt;
" (double quote) is replaced by &quot;
' (single quote / apostrophe) is replaced by &apos;
string
- The string to be escaped.public static java.lang.String unescape(java.lang.String string)
string
- string to remove escapes frompublic static void noSpace(java.lang.String string) throws JSONException
string
- A string.JSONException
- Thrown if the string contains whitespace or is empty.public static java.lang.Object stringToValue(java.lang.String string, XMLXsiTypeConverter<?> typeConverter)
string
- String to converttypeConverter
- value converter to convert string to integer, boolean e.t.cpublic static java.lang.Object stringToValue(java.lang.String string)
JSONObject.stringToValue(String)
.string
- String to convertpublic static JSONObject toJSONObject(java.lang.String string) throws JSONException
<[ [ ]]>
are ignored.string
- The source string.JSONException
- Thrown if there is an errors while parsing the stringpublic static JSONObject toJSONObject(java.io.Reader reader) throws JSONException
<[ [ ]]>
are ignored.reader
- The XML source reader.JSONException
- Thrown if there is an errors while parsing the stringpublic static JSONObject toJSONObject(java.io.Reader reader, boolean keepStrings) throws JSONException
<[ [ ]]>
are ignored.
All values are converted as strings, for 1, 01, 29.0 will not be coerced to
numbers but will instead be the exact value as seen in the XML document.reader
- The XML source reader.keepStrings
- If true, then values will not be coerced into boolean
or numeric values and will instead be left as stringsJSONException
- Thrown if there is an errors while parsing the stringpublic static JSONObject toJSONObject(java.io.Reader reader, XMLParserConfiguration config) throws JSONException
<[ [ ]]>
are ignored.
All values are converted as strings, for 1, 01, 29.0 will not be coerced to
numbers but will instead be the exact value as seen in the XML document.reader
- The XML source reader.config
- Configuration options for the parserJSONException
- Thrown if there is an errors while parsing the stringpublic static JSONObject toJSONObject(java.lang.String string, boolean keepStrings) throws JSONException
<[ [ ]]>
are ignored.
All values are converted as strings, for 1, 01, 29.0 will not be coerced to
numbers but will instead be the exact value as seen in the XML document.string
- The source string.keepStrings
- If true, then values will not be coerced into boolean
or numeric values and will instead be left as stringsJSONException
- Thrown if there is an errors while parsing the stringpublic static JSONObject toJSONObject(java.lang.String string, XMLParserConfiguration config) throws JSONException
<[ [ ]]>
are ignored.
All values are converted as strings, for 1, 01, 29.0 will not be coerced to
numbers but will instead be the exact value as seen in the XML document.string
- The source string.config
- Configuration options for the parser.JSONException
- Thrown if there is an errors while parsing the stringpublic static java.lang.String toString(java.lang.Object object) throws JSONException
object
- A JSONObject.JSONException
- Thrown if there is an error parsing the stringpublic static java.lang.String toString(java.lang.Object object, java.lang.String tagName)
object
- A JSONObject.tagName
- The optional name of the enclosing tag.JSONException
- Thrown if there is an error parsing the stringpublic static java.lang.String toString(java.lang.Object object, java.lang.String tagName, XMLParserConfiguration config) throws JSONException
object
- A JSONObject.tagName
- The optional name of the enclosing tag.config
- Configuration that can control output to XML.JSONException
- Thrown if there is an error parsing the stringpublic static java.lang.String toString(java.lang.Object object, int indentFactor)
object
- A JSONObject.indentFactor
- The number of spaces to add to each level of indentation.JSONException
- Thrown if there is an error parsing the stringpublic static java.lang.String toString(java.lang.Object object, java.lang.String tagName, int indentFactor)
object
- A JSONObject.tagName
- The optional name of the enclosing tag.indentFactor
- The number of spaces to add to each level of indentation.JSONException
- Thrown if there is an error parsing the stringpublic static java.lang.String toString(java.lang.Object object, java.lang.String tagName, XMLParserConfiguration config, int indentFactor) throws JSONException
object
- A JSONObject.tagName
- The optional name of the enclosing tag.config
- Configuration that can control output to XML.indentFactor
- The number of spaces to add to each level of indentation.JSONException
- Thrown if there is an error parsing the stringCopyright © 2010 - 2023 Adobe. All Rights Reserved