public static Class findClass(VariableResolverFactory factory, String name, ParserContext pCtx) throws ClassNotFoundException { try { if (LITERALS.containsKey(name)) { return (Class) LITERALS.get(name); } else if (factory != null && factory.isResolveable(name)) { return (Class) factory.getVariableResolver(name).getValue(); } else if (pCtx != null && pCtx.hasImport(name)) { return pCtx.getImport(name); } else { return createClass(name, pCtx); } } catch (ClassNotFoundException e) { throw e; } catch (Exception e) { throw new RuntimeException("class not found: " + name, e); } }
public static Class findClass(VariableResolverFactory factory, String name, ParserContext pCtx) throws ClassNotFoundException { try { if (LITERALS.containsKey(name)) { return (Class) LITERALS.get(name); } else if (factory != null && factory.isResolveable(name)) { return (Class) factory.getVariableResolver(name).getValue(); } else if (pCtx != null && pCtx.hasImport(name)) { return pCtx.getImport(name); } else { return createClass(name, pCtx); } } catch (ClassNotFoundException e) { throw e; } catch (Exception e) { throw new RuntimeException("class not found: " + name, e); } }
public static Class findClass(VariableResolverFactory factory, String name, ParserContext ctx) throws ClassNotFoundException { try { if (LITERALS.containsKey(name)) { return (Class) LITERALS.get(name); } else if (factory != null && factory.isResolveable(name)) { return (Class) factory.getVariableResolver(name).getValue(); } else if (ctx != null && ctx.hasImport(name)) { return ctx.getImport(name); } else { return createClass(name, ctx); } } catch (ClassNotFoundException e) { throw e; } catch (Exception e) { throw new CompileException("class not found: " + name, e); } }
public static Class getClassReference(ParserContext ctx, TypeDescriptor tDescr) throws ClassNotFoundException { Class cls; if (ctx != null && ctx.hasImport(tDescr.className)) { cls = ctx.getImport(tDescr.className); if (tDescr.isArray()) { cls = cls.isPrimitive() ? toPrimitiveArrayType(cls) : findClass(null, repeatChar('[', tDescr.arraySize.length) + "L" + cls.getName() + ";", ctx); } } else if (ctx == null && hasContextFreeImport(tDescr.className)) { cls = getContextFreeImport(tDescr.className); if (tDescr.isArray()) { cls = cls.isPrimitive() ? toPrimitiveArrayType(cls) : findClass(null, repeatChar('[', tDescr.arraySize.length) + "L" + cls.getName() + ";", ctx); } } else { cls = createClass(tDescr.getClassName(), ctx); if (tDescr.isArray()) { cls = cls.isPrimitive() ? toPrimitiveArrayType(cls) : findClass(null, repeatChar('[', tDescr.arraySize.length) + "L" + cls.getName() + ";", ctx); } } return cls; }
public static Class getClassReference(ParserContext ctx, TypeDescriptor tDescr) throws ClassNotFoundException { Class cls; if (ctx != null && ctx.hasImport(tDescr.className)) { cls = ctx.getImport(tDescr.className); if (tDescr.isArray()) { cls = cls.isPrimitive() ? toPrimitiveArrayType(cls) : findClass(null, repeatChar('[', tDescr.arraySize.length) + "L" + cls.getName() + ";", ctx); } } else if (ctx == null && hasContextFreeImport(tDescr.className)) { cls = getContextFreeImport(tDescr.className); if (tDescr.isArray()) { cls = cls.isPrimitive() ? toPrimitiveArrayType(cls) : findClass(null, repeatChar('[', tDescr.arraySize.length) + "L" + cls.getName() + ";", ctx); } } else { cls = createClass(tDescr.getClassName(), ctx); if (tDescr.isArray()) { cls = cls.isPrimitive() ? toPrimitiveArrayType(cls) : findClass(null, repeatChar('[', tDescr.arraySize.length) + "L" + cls.getName() + ";", ctx); } } return cls; }
public static Class getClassReference(ParserContext ctx, TypeDescriptor tDescr) throws ClassNotFoundException { Class cls; if (ctx != null && ctx.hasImport(tDescr.className)) { cls = ctx.getImport(tDescr.className); if (tDescr.isArray()) { cls = findClass(null, repeatChar('[', tDescr.arraySize.length) + "L" + cls.getName() + ";", ctx); } } else if (ctx == null && hasContextFreeImport(tDescr.className)) { cls = getContextFreeImport(tDescr.className); if (tDescr.isArray()) { cls = findClass(null, repeatChar('[', tDescr.arraySize.length) + "L" + cls.getName() + ";", ctx); } } else { cls = createClass(tDescr.getClassName(), ctx); if (tDescr.isArray()) { cls = findClass(null, repeatChar('[', tDescr.arraySize.length) + "L" + cls.getName() + ";", ctx); } } return cls; }
try { if (instruction.cache == null) { instruction.cache = ParseTools.createClass(instruction.expr, pCtx);
try { if (instruction.cache == null) { instruction.cache = ParseTools.createClass(instruction.expr, pCtx);