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[]parseArgsString(String args)
parse Args String
if (args == null) {
    return new String[0];
ArrayList listRes = new ArrayList();
int pos0 = 0;
int len = args.length();
while (pos0 < len) {
    int pos1 = pos0;
...
String[]parseArgsToVmArgs(String[] args, String prefixOfVmArgs)
parse Args To Vm Args
if (prefixOfVmArgs == null)
    return args;
args = args.clone();
List<String> argList = new ArrayList<String>();
for (int i = 0; i < args.length; ++i) {
    if (args[i] != null && !args[i].startsWith("-D")) {
        if (args[i].startsWith("--"))
            args[i] = args[i].substring(2);
...
String[]parseArguments(final String command)
Parses the specified command into an array of arguments.
final List<String> args = new ArrayList<>();
final StringBuilder builder = new StringBuilder();
boolean inquote = false;
for (String word : command.split(" ")) {
    if (word.endsWith("\"") && inquote) {
        args.add(builder.toString() + ' ' + word.substring(0, word.length() - 1));
        builder.delete(0, builder.length());
        inquote = false;
...
String[]parseArguments(String args)
parse Arguments
List<String> arguments = new ArrayList<String>();
boolean quoted = false;
String currentArg = "";
for (int i = 0; i < args.length(); i++) {
    char c = args.charAt(i);
    if (!quoted && c == ' ') {
        arguments.add(currentArg);
        currentArg = "";
...
String[]parseArguments(String[] arguments, String delimiter)
Parses an array of string arguments so that things wrapped in quotes count as one element in the array.
List<String> sanitized = new ArrayList<>();
for (int i = 0; i < arguments.length; i++) {
    if (arguments[i].startsWith("\"")) {
        StringBuilder buffer = new StringBuilder();
        buffer.append(arguments[i].substring("\"".length()));
        buffer.append(delimiter);
        for (i++; i < arguments.length; i++) {
            if (arguments[i].endsWith("\"")) {
...
String[]parseArgumentString(String argStr)
parse Argument String
boolean quote = false;
List<String> params = new ArrayList<>();
List<String> temp = new ArrayList<>();
String[] split = argStr.split(" ");
for (int i = 0; i < split.length; i++) {
    String str = split[i];
    char first = str.isEmpty() ? '\u0000' : str.charAt(0);
    char last = str.isEmpty() ? '\u0000' : str.charAt(str.length() - 1);
...
String[]parseArgumentString(String command)
Convert an argument string into a list of arguments.
List<String> args = new ArrayList<String>();
StringBuilder builder = new StringBuilder();
boolean inQuote = false;
boolean prevWasSlash = false;
for (final char c : command.toCharArray()) {
    if (!prevWasSlash && (c == '\'' || c == '"')) {
        inQuote = !inQuote;
        prevWasSlash = false;
...
ListparseArray(String array)
Parse an SQL array.
char[] input = array.substring(1, array.length() - 1).replace("\\\\", "\\").toCharArray();
List<String> output = new ArrayList<>();
StringBuilder elem = new StringBuilder();
boolean inQuotes = false;
boolean escaped = false;
for (char c : input) {
    if (escaped) {
        elem.append(c);
...
ListparseArray(String array)
Parse an SQL array.
if (array.startsWith("{") && array.endsWith("}")) {
    array = array.substring(1, array.length() - 1);
array = array.replace("\\\\", "\\"); 
char[] input = array.toCharArray();
List<String> output = new ArrayList<>();
StringBuilder elem = new StringBuilder();
boolean inQuotes = false;
...
String[]parseArray(String inputArray)
parse Array
ArrayList<String> result = new ArrayList<String>();
int start = 0;
boolean quote = false;
for (int x = 0; x < inputArray.length(); x++) {
    if (inputArray.charAt(x) == '\"')
        quote = !quote;
    boolean lastChar = (x == inputArray.length() - 1);
    if (lastChar) {
...