/** * Evaluate a script from a file, against a context object and return the resultant value. * * @param file The file to process * @param ctx The context to evaluate the script against. * @return The resultant value * @throws IOException Exception thrown if there is an IO problem accessing the file. */ public static Object evalFile(File file, Object ctx) throws IOException { return _evalFile(file, ctx, new CachedMapVariableResolverFactory(new HashMap())); }
public VariableResolver createVariable(String name, Object value) { VariableResolver vr; try { (vr = getVariableResolver(name)).setValue(value); return vr; } catch (UnresolveablePropertyException e) { addResolver(name, vr = new MapVariableResolver(variables, name)).setValue(value); return vr; } }
public VariableResolver createVariable(String name, Object value) { VariableResolver vr; try { (vr = getVariableResolver(name)).setValue(value); return vr; } catch (UnresolveablePropertyException e) { addResolver(name, vr = new MapVariableResolver(variables, name)).setValue(value); return vr; } }
public VariableResolver createVariable(String name, Object value) { VariableResolver vr; try { (vr = getVariableResolver(name)).setValue(value); return vr; } catch (UnresolveablePropertyException e) { addResolver(name, vr = new MapVariableResolver(variables, name)).setValue(value); return vr; } }
/** * Evaluate a script from a file and return the resultant value. * * @param file The file to process * @return The resultant value * @throws IOException Exception thrown if there is an IO problem accessing the file. */ public static Object evalFile(File file) throws IOException { return _evalFile(file, null, new CachedMapVariableResolverFactory(new HashMap())); }
public VariableResolver createVariable(String name, Object value, Class<?> type) { VariableResolver vr; try { vr = getVariableResolver(name); } catch (UnresolveablePropertyException e) { vr = null; } if (vr != null && vr.getType() != null) { throw new RuntimeException("variable already defined within scope: " + vr.getType() + " " + name); } else { addResolver(name, vr = new MapVariableResolver(variables, name, type)).setValue(value); return vr; } }
/** * Evaluate a script from a file and return the resultant value. * * @param file The file to process * @return The resultant value * @throws IOException Exception thrown if there is an IO problem accessing the file. */ public static Object evalFile(File file) throws IOException { return _evalFile(file, null, new CachedMapVariableResolverFactory(new HashMap())); }
public VariableResolver createVariable(String name, Object value, Class<?> type) { VariableResolver vr; try { vr = getVariableResolver(name); } catch (UnresolveablePropertyException e) { vr = null; } if (vr != null && vr.getType() != null) { throw new RuntimeException("variable already defined within scope: " + vr.getType() + " " + name); } else { addResolver(name, vr = new MapVariableResolver(variables, name, type)).setValue(value); return vr; } }
/** * Evaluate a script from a file, against a context object and return the resultant value. * * @param file The file to process * @param ctx The context to evaluate the script against. * @return The resultant value * @throws IOException Exception thrown if there is an IO problem accessing the file. */ public static Object evalFile(File file, Object ctx) throws IOException { return _evalFile(file, ctx, new CachedMapVariableResolverFactory(new HashMap())); }
public VariableResolver createVariable(String name, Object value, Class<?> type) { VariableResolver vr; try { vr = getVariableResolver(name); } catch (UnresolveablePropertyException e) { vr = null; } if (vr != null && vr.getType() != null) { throw new CompileException("variable already defined within scope: " + vr.getType() + " " + name); } else { addResolver(name, vr = new MapVariableResolver(variables, name, type)).setValue(value); return vr; } }
public static Object evalFile(File file, String encoding, Object ctx) throws IOException { return _evalFile(file, encoding, ctx, new CachedMapVariableResolverFactory(new HashMap())); }
public static Object evalFile(File file, String encoding) throws IOException { return _evalFile(file, encoding, null, new CachedMapVariableResolverFactory(new HashMap())); }
public static Object evalFile(File file, String encoding) throws IOException { return _evalFile(file, encoding, null, new CachedMapVariableResolverFactory(new HashMap())); }
public static Object evalFile(File file, String encoding, Object ctx) throws IOException { return _evalFile(file, encoding, ctx, new CachedMapVariableResolverFactory(new HashMap())); }