static List/*<String>*/ parseCommaSeparatedList(String value) throws ParseException { List/*<String>*/ valuesList = new ArrayList(); String[] values = StringUtil.split(value, ','); for (int i = 0; i < values.length; i++) { final String s = values[i].trim(); if (s.length() != 0) { valuesList.add(s); } else if (i != values.length - 1) { throw new ParseException("Missing list item berfore a comma", -1); } } return valuesList; }
private String[] splitToLines(String s) { s = StringUtil.replace(s, "\r\n", "\n"); s = StringUtil.replace(s, "\r", "\n"); String[] lines = StringUtil.split(s, '\n'); return lines; }
paramTypes = new Class[0]; } else { String [] paramsArray = StringUtil.split(params, ','); paramTypes = new Class[paramsArray.length]; String token = null;
public Object exec(List args) throws TemplateModelException { int argCnt = args.size(); checkMethodArgCount(argCnt, 1, 2); String splitString = (String) args.get(0); long flags = argCnt > 1 ? RegexpHelper.parseFlagString((String) args.get(1)) : 0; String[] result = null; if ((flags & RegexpHelper.RE_FLAG_REGEXP) == 0) { RegexpHelper.checkNonRegexpFlags(key, flags); result = StringUtil.split(s, splitString, (flags & RegexpHelper.RE_FLAG_CASE_INSENSITIVE) != 0); } else { Pattern pattern = RegexpHelper.getPattern(splitString, (int) flags); result = pattern.split(s); } return ObjectWrapper.DEFAULT_WRAPPER.wrap(result); } }
static List/*<String>*/ parseCommaSeparatedList(String value) throws ParseException { List/*<String>*/ valuesList = new ArrayList(); String[] values = StringUtil.split(value, ','); for (int i = 0; i < values.length; i++) { final String s = values[i].trim(); if (s.length() != 0) { valuesList.add(s); } else if (i != values.length - 1) { throw new ParseException("Missing list item berfore a comma", -1); } } return valuesList; }
static List/*<String>*/ parseCommaSeparatedList(String value) throws ParseException { List/*<String>*/ valuesList = new ArrayList(); String[] values = StringUtil.split(value, ','); for (int i = 0; i < values.length; i++) { final String s = values[i].trim(); if (s.length() != 0) { valuesList.add(s); } else if (i != values.length - 1) { throw new ParseException("Missing list item berfore a comma", -1); } } return valuesList; }
private String[] splitToLines(String s) { s = StringUtil.replace(s, "\r\n", "\n"); s = StringUtil.replace(s, "\r", "\n"); String[] lines = StringUtil.split(s, '\n'); return lines; }
public Object exec(List args) throws TemplateModelException { int numArgs = args.size(); if (numArgs != 1 && numArgs !=2) { throw new TemplateModelException( "?split(...) expects 1 or 2 arguments."); } String splitString = (String) args.get(0); String flags = numArgs ==2 ? (String) args.get(1) : ""; boolean caseInsensitive = flags.indexOf('i') >=0; if (flags.indexOf('r') >=0) { throw new TemplateModelException("regular expression classes not available"); } return new StringArraySequence(StringUtil.split( s, splitString, caseInsensitive)); } }
private String[] splitToLines(String s) { s = StringUtil.replace(s, "\r\n", "\n"); s = StringUtil.replace(s, "\r", "\n"); String[] lines = StringUtil.split(s, '\n'); return lines; }
public Object exec(List args) throws TemplateModelException { int numArgs = args.size(); if (numArgs < 1 || numArgs >2 ) { throw new TemplateModelException( "?replace(...) needs 1 or 2 arguments."); } String splitString = (String) args.get(0); long flags = numArgs > 1 ? parseFlagString((String) args.get(1)) : 0; String[] result = null; if ((flags & RE_FLAG_REGEXP) == 0) { checkNonRegexpFlags("split", flags); result = StringUtil.split(s, splitString, (flags & RE_FLAG_CASE_INSENSITIVE) != 0); } else { Pattern pattern = getPattern(splitString, (int) flags); result = pattern.split(s); } return ObjectWrapper.DEFAULT_WRAPPER.wrap(result); } }
paramTypes = new Class[0]; } else { String [] paramsArray = StringUtil.split(params, ','); paramTypes = new Class[paramsArray.length]; String token = null;
paramTypes = new Class[0]; } else { String [] paramsArray = StringUtil.split(params, ','); paramTypes = new Class[paramsArray.length]; String token = null;
public Object exec(List args) throws TemplateModelException { int argCnt = args.size(); checkMethodArgCount(argCnt, 1, 2); String splitString = (String) args.get(0); long flags = argCnt > 1 ? RegexpHelper.parseFlagString((String) args.get(1)) : 0; String[] result = null; if ((flags & RegexpHelper.RE_FLAG_REGEXP) == 0) { RegexpHelper.checkNonRegexpFlags(key, flags); result = StringUtil.split(s, splitString, (flags & RegexpHelper.RE_FLAG_CASE_INSENSITIVE) != 0); } else { Pattern pattern = RegexpHelper.getPattern(splitString, (int) flags); result = pattern.split(s); } return ObjectWrapper.DEFAULT_WRAPPER.wrap(result); } }
public Object exec(List args) throws TemplateModelException { int argCnt = args.size(); checkMethodArgCount(argCnt, 1, 2); String splitString = (String) args.get(0); long flags = argCnt > 1 ? RegexpHelper.parseFlagString((String) args.get(1)) : 0; String[] result = null; if ((flags & RegexpHelper.RE_FLAG_REGEXP) == 0) { RegexpHelper.checkNonRegexpFlags(key, flags); result = StringUtil.split(s, splitString, (flags & RegexpHelper.RE_FLAG_CASE_INSENSITIVE) != 0); } else { Pattern pattern = RegexpHelper.getPattern(splitString, (int) flags); result = pattern.split(s); } return ObjectWrapper.DEFAULT_WRAPPER.wrap(result); } }
String[] formatNames = StringUtil.split(qrCodeFormatSupported, '|'); List<String> formatsSupported = Arrays.asList(formatNames); if (!formatsSupported.contains(format)) {