public static ArrayIndexOperation parse(String operation) { //check valid chars for (int i = 0; i < operation.length(); i++) { char c = operation.charAt(i); if (!isDigit(c) && c != ',' && c != ' ' && c != '-') { throw new InvalidPathException("Failed to parse ArrayIndexOperation: " + operation); } } String[] tokens = COMMA.split(operation, -1); List<Integer> tempIndexes = new ArrayList<Integer>(tokens.length); for (String token : tokens) { tempIndexes.add(parseInteger(token)); } return new ArrayIndexOperation(tempIndexes); }
@Override public void evaluate(String currentPath, PathRef parent, Object model, EvaluationContextImpl ctx) { if (!checkArrayModel(currentPath, model, ctx)) return; if (arrayIndexOperation.isSingleIndexOperation()) { handleArrayIndex(arrayIndexOperation.indexes().get(0), currentPath, model, ctx); } else { for (Integer index : arrayIndexOperation.indexes()) { handleArrayIndex(index, currentPath, model, ctx); } } }
@Override public String getPathFragment() { return arrayIndexOperation.toString(); }
@Override public boolean isTokenDefinite() { return arrayIndexOperation.isSingleIndexOperation(); }
appender.appendPathToken(PathTokenFactory.createSliceArrayPathToken(arraySliceOperation)); } else { ArrayIndexOperation arrayIndexOperation = ArrayIndexOperation.parse(expression); appender.appendPathToken(PathTokenFactory.createIndexArrayPathToken(arrayIndexOperation));
@Override public boolean isTokenDefinite() { if(arrayIndexOperation != null){ return arrayIndexOperation.isSingleIndexOperation(); } else { return false; } }
appender.appendPathToken(PathTokenFactory.createSliceArrayPathToken(arraySliceOperation)); } else { ArrayIndexOperation arrayIndexOperation = ArrayIndexOperation.parse(expression); appender.appendPathToken(PathTokenFactory.createIndexArrayPathToken(arrayIndexOperation));
public void evaluateIndexOperation(String currentPath, PathRef parent, Object model, EvaluationContextImpl ctx) { if (! checkArrayModel(currentPath, model, ctx)) return; if(arrayIndexOperation.isSingleIndexOperation()){ handleArrayIndex(arrayIndexOperation.indexes().get(0), currentPath, model, ctx); } else { for (Integer index : arrayIndexOperation.indexes()) { handleArrayIndex(index, currentPath, model, ctx); } } }
public static ArrayIndexOperation parse(String operation) { //check valid chars for (int i = 0; i < operation.length(); i++) { char c = operation.charAt(i); if (!isDigit(c) && c != ',' && c != ' ' && c != '-') { throw new InvalidPathException("Failed to parse ArrayIndexOperation: " + operation); } } String[] tokens = COMMA.split(operation, -1); List<Integer> tempIndexes = new ArrayList<Integer>(tokens.length); for (String token : tokens) { tempIndexes.add(parseInteger(token)); } return new ArrayIndexOperation(tempIndexes); }
@Override public String getPathFragment() { if(arrayIndexOperation != null){ return arrayIndexOperation.toString(); } else { return arraySliceOperation.toString(); } }
@Override public boolean isTokenDefinite() { if(arrayIndexOperation != null){ return arrayIndexOperation.isSingleIndexOperation(); } else { return false; } }
appender.appendPathToken(PathTokenFactory.createSliceArrayPathToken(arraySliceOperation)); } else { ArrayIndexOperation arrayIndexOperation = ArrayIndexOperation.parse(expression); appender.appendPathToken(PathTokenFactory.createIndexArrayPathToken(arrayIndexOperation));
public void evaluateIndexOperation(String currentPath, PathRef parent, Object model, EvaluationContextImpl ctx) { if (! checkArrayModel(currentPath, model, ctx)) return; if(arrayIndexOperation.isSingleIndexOperation()){ handleArrayIndex(arrayIndexOperation.indexes().get(0), currentPath, model, ctx); } else { for (Integer index : arrayIndexOperation.indexes()) { handleArrayIndex(index, currentPath, model, ctx); } } }
public static ArrayIndexOperation parse(String operation) { //check valid chars for (int i = 0; i < operation.length(); i++) { char c = operation.charAt(i); if (!isDigit(c) && c != ',' && c != ' ' && c != '-') { throw new InvalidPathException("Failed to parse ArrayIndexOperation: " + operation); } } String[] tokens = COMMA.split(operation, -1); List<Integer> tempIndexes = new ArrayList<Integer>(tokens.length); for (String token : tokens) { tempIndexes.add(parseInteger(token)); } return new ArrayIndexOperation(tempIndexes); }
@Override public String getPathFragment() { if(arrayIndexOperation != null){ return arrayIndexOperation.toString(); } else { return arraySliceOperation.toString(); } }