public boolean isResolveable(String name) { return isTarget(name) || isNextResolveable(name); }
public StaticMethodImportResolverFactory(ParserContext ctx) { this.variableResolvers = new HashMap<String, VariableResolver>(); for (Map.Entry<String, Object> entry : ctx.getImports().entrySet()) { if (entry.getValue() instanceof Method) { createVariable(entry.getKey(), entry.getValue()); } } }
public void testStrictTypingCompilation2() throws Exception { ParserContext ctx = new ParserContext(); //noinspection RedundantArrayCreation ctx.addImport("getRuntime", new MethodStub(Runtime.class.getMethod("getRuntime", new Class[]{}))); ctx.setStrictTypeEnforcement(true); ExpressionCompiler compiler = new ExpressionCompiler("getRuntime()", ctx); StaticMethodImportResolverFactory si = new StaticMethodImportResolverFactory(ctx); Serializable expression = compiler.compile(); serializationTest(expression); assertTrue(executeExpression(expression, si) instanceof Runtime); }
public StaticMethodImportResolverFactory(ParserContext ctx) { this.variableResolvers = new HashMap<String, VariableResolver>(); for (Map.Entry<String, Object> entry : ctx.getImports().entrySet()) { if (entry.getValue() instanceof Method) { createVariable(entry.getKey(), entry.getValue()); } } }
public boolean isResolveable(String name) { return isTarget(name) || isNextResolveable(name); }
public StaticMethodImportResolverFactory(ParserContext ctx) { this.variableResolvers = new HashMap<String, VariableResolver>(); for (Map.Entry<String, Object> entry : ctx.getImports().entrySet()) { if (entry.getValue() instanceof Method) { createVariable(entry.getKey(), entry.getValue()); } } }
public boolean isResolveable(String name) { return isTarget(name) || isNextResolveable(name); }