/** * This will handle the strings like properties. Means a string without separator will be * stored as value with an increasing key as integer, e.g. [val1, val2, a=b] will be 0=val1, 1=val2, a=b * @param properties * @param keySeparator * @param typeSeparator * @return The MProperties */ public static MProperties explodeToMProperties(String[] properties, char keySeparator, char typeSeparator) { return explodeToMProperties(properties, keySeparator, typeSeparator, 0, Integer.MAX_VALUE); }
@Override protected IProperties loadValue(String value) { return MProperties.explodeToMProperties(value.split("\n")); }
/** * This will handle the strings like properties. Means a string without separator will be * stored as value with an increasing key as integer, e.g. [val1, val2, a=b] will be 0=val1, 1=val2, a=b * @param properties * @return The MProperties */ public static MProperties explodeToMProperties(String[] properties) { if (properties == null) return new MProperties(); return explodeToMProperties(properties, '=', ':', 0, properties.length); }
public static MProperties explodeToMProperties(String[] properties, int offset, int length) { if (properties == null) return new MProperties(); return explodeToMProperties(properties, '=', ':', offset, length); }
/** * This will handle the strings like properties. Means a string without separator will be * stored as value with an increasing key as integer, e.g. val1&val2&a=b will be 0=val1, 1=val2, a=b * @param properties Rfc1738 (Url Encoded) encoded string * @return The MProperties */ public static MProperties explodeToMProperties(String properties) { return explodeToMProperties(MUri.explodeArray(properties), '=', ':', 0, Integer.MAX_VALUE); }
public SearchCriterias(String[] parameters) { this(parameters == null? new MProperties() : MProperties.explodeToMProperties(parameters)); }
public ConsoleTable(String options) { if (options != null) { options = options.trim(); MProperties o = MProperties.explodeToMProperties(options); setFull(o.getBoolean("full", false)); //TODO more options ... } else { fitToConsole(); } }
public ParameterDefinition(String line) { if (MString.isIndex(line, ',')) { name = MString.beforeIndex(line, ','); line = MString.afterIndex(line, ','); properties = MProperties.explodeToMProperties(line.split(","), ':', (char)0); } else { name = line; if (name.startsWith("*")) { mandatory = true; name = name.substring(1); } type = "string"; return; } if (name.startsWith("*")) { mandatory = true; name = name.substring(1); } type = properties.getString("type", ""); mandatory = properties.getBoolean("mandatory", mandatory); def = properties.getString("default", null); mapping = properties.getString("mapping",null); format = properties.getString("format", null); }