List of utility methods to do XML Parse String
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);
|
Document | parse(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); |
Document | parse(String input) parse return parse(new StringReader(input), null); |
List | parse(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); ... |
Document | parse(String s) parse return parse(s, false);
|
Document | parse(String text) parse Document document = null; exception = null; try { document = riskyParse(text); } catch (Exception e) { exception = e; return document; ... |
Document | parse(String xml) parse return DocumentBuilderFactory.newInstance().newDocumentBuilder() .parse(new InputSource(new StringReader(xml))); |