Java Utililty Methods XML Parse String

List of utility methods to do XML Parse String

Description

The list of methods to do XML Parse String are organized into topic(s).

Method

String[]parse(final String content)

parses the argument text into an array of individual arguments using the space character as the delimiter.

An individual argument containing spaces must have a double quote (") at the start and end.

String[] result = new String[0];
if (content != null && content.length() > 0) {
    List<String> alResult = new ArrayList<String>();
    boolean inQuotes = false;
    int start = 0;
    int end = content.length();
    StringBuffer buffer = new StringBuffer(end);
    while (start < end) {
...
String[]parse(final String line)
Parses a single line (String) of comma-separated values.
return parse(line, false);
Documentparse(final String xmlContent)
parse
try {
    final DocumentBuilder builder = getDocumentBuilder();
    return builder.parse(new ByteArrayInputStream(xmlContent.getBytes()));
} catch (SAXException e) {
    throw new RuntimeException(e);
} catch (IOException e) {
    throw new RuntimeException(e);
Documentparse(String input)
parse
return parse(new StringReader(input), null);
Listparse(String input, char delim, char esc)
parse
assert delim != esc : "Delimiter is the same as escaping character: " + delim;
List<String> ret = new ArrayList<String>();
StringBuilder cur = new StringBuilder();
boolean escflag = false;
for (int i = 0; i < input.length(); i++) {
    char c = input.charAt(i);
    if (c == esc) {
        if (escflag) {
...
String[]parse(String line)
parse
line = line.trim();
if (line.length() == 0)
    return new String[0];
List<String> args = new ArrayList<>();
int i = 0;
while (i < line.length() && line.charAt(i) != ' ')
    i++;
args.add("-" + line.substring(0, i));
...
String[]parse(String line)
parse
if (line == null || line.length() == 0)
    return new String[0];
List<String> out = new ArrayList<String>();
String rest = line.trim();
int lastpos = 0;
while (rest.length() > 0) {
    if (rest.length() < 28) {
        out.add(rest);
...
Documentparse(String s)
parse
return parse(s, false);
Documentparse(String text)
parse
Document document = null;
exception = null;
try {
    document = riskyParse(text);
} catch (Exception e) {
    exception = e;
return document;
...
Documentparse(String xml)
parse
return DocumentBuilderFactory.newInstance().newDocumentBuilder()
        .parse(new InputSource(new StringReader(xml)));