void createLocalReferences(OgnlContext context, ClassFab classFab, Class[] params) throws CannotCompileException, NotFoundException { Map referenceMap = context.getLocalReferences(); if (referenceMap == null || referenceMap.size() < 1) return; Iterator it = referenceMap.keySet().iterator(); while (it.hasNext()) { String key = (String) it.next(); LocalReference ref = (LocalReference) referenceMap.get(key); String widener = ref.getType().isPrimitive() ? " " : " ($w) "; String body = "{"; body += " return " + widener + ref.getExpression() + ";"; body += "}"; body = body.replaceAll("\\.\\.", "."); if (_log.isDebugEnabled()) _log.debug("createLocalReferences() body is:\n" + body); MethodSignature method = new MethodSignature(ref.getType(), ref.getName(), params, null); classFab.addMethod(Modifier.PUBLIC, method, body); it.remove(); } }
void createLocalReferences(OgnlContext context, ClassFab classFab, Class[] params) throws CannotCompileException, NotFoundException { Map referenceMap = context.getLocalReferences(); if (referenceMap == null || referenceMap.size() < 1) return; Iterator it = referenceMap.keySet().iterator(); while (it.hasNext()) { String key = (String) it.next(); LocalReference ref = (LocalReference) referenceMap.get(key); String widener = ref.getType().isPrimitive() ? " " : " ($w) "; String body = "{"; body += " return " + widener + ref.getExpression() + ";"; body += "}"; body = body.replaceAll("\\.\\.", "."); if (_log.isDebugEnabled()) _log.debug("createLocalReferences() body is:\n" + body); MethodSignature method = new MethodSignature(ref.getType(), ref.getName(), params, null); classFab.addMethod(Modifier.PUBLIC, method, body); it.remove(); } }
void createLocalReferences(OgnlContext context, ClassPool pool, CtClass clazz, CtClass objClass, CtClass[] params) throws CannotCompileException, NotFoundException Map referenceMap = context.getLocalReferences(); if (referenceMap == null || referenceMap.size() < 1) return;
void createLocalReferences(OgnlContext context, ClassPool pool, CtClass clazz, CtClass objClass, CtClass[] params) throws CannotCompileException, NotFoundException Map referenceMap = context.getLocalReferences(); if (referenceMap == null || referenceMap.size() < 1) return;