public static Path compile(String path, final Predicate... filters) { try { CharacterIndex ci = new CharacterIndex(path); ci.trim(); if(!( ci.charAt(0) == DOC_CONTEXT) && !( ci.charAt(0) == EVAL_CONTEXT)){ ci = new CharacterIndex("$." + path); ci.trim(); } if(ci.lastCharIs('.')){ fail("Path must not end with a '.' or '..'"); } LinkedList<Predicate> filterStack = new LinkedList<Predicate>(asList(filters)); Path p = new PathCompiler(ci, filterStack).compile(); return p; } catch (Exception e) { InvalidPathException ipe; if (e instanceof InvalidPathException) { ipe = (InvalidPathException) e; } else { ipe = new InvalidPathException(e); } throw ipe; } }
case PATH: LinkedList<Predicate> predicates = new LinkedList<Predicate>(); PathCompiler compiler = new PathCompiler(parameter.toString(), predicates); param = new Parameter(compiler.compile()); break;
public static Path compile(String path, final Predicate... filters) { try { CharacterIndex ci = new CharacterIndex(path); ci.trim(); if(!( ci.charAt(0) == DOC_CONTEXT) && !( ci.charAt(0) == EVAL_CONTEXT)){ ci = new CharacterIndex("$." + path); ci.trim(); } if(ci.lastCharIs('.')){ fail("Path must not end with a '.' or '..'"); } LinkedList<Predicate> filterStack = new LinkedList<Predicate>(asList(filters)); Path p = new PathCompiler(ci, filterStack).compile(); return p; } catch (Exception e) { InvalidPathException ipe; if (e instanceof InvalidPathException) { ipe = (InvalidPathException) e; } else { ipe = new InvalidPathException(e); } throw ipe; } }
case PATH: LinkedList<Predicate> predicates = new LinkedList<Predicate>(); PathCompiler compiler = new PathCompiler(parameter.toString(), predicates); param = new Parameter(compiler.compile()); break;
case PATH: LinkedList<Predicate> predicates = new LinkedList<Predicate>(); PathCompiler compiler = new PathCompiler(parameter.toString(), predicates); param = new Parameter(compiler.compile()); break;
public static Path compile(String path, final Predicate... filters) { try { CharacterIndex ci = new CharacterIndex(path); ci.trim(); if(!( ci.charAt(0) == DOC_CONTEXT) && !( ci.charAt(0) == EVAL_CONTEXT)){ ci = new CharacterIndex("$." + path); ci.trim(); } if(ci.lastCharIs('.')){ fail("Path must not end with a '.' or '..'"); } LinkedList<Predicate> filterStack = new LinkedList<Predicate>(asList(filters)); Path p = new PathCompiler(ci, filterStack).compile(); return p; } catch (Exception e) { InvalidPathException ipe; if (e instanceof InvalidPathException) { ipe = (InvalidPathException) e; } else { ipe = new InvalidPathException(e); } throw ipe; } }