/** * Makes a copy. Class names are replaced according to the * given <code>Map</code> object. * * @param newCp the constant pool table used by the new copy. * @param classnames pairs of replaced and substituted * class names. */ public AttributeInfo copy(ConstPool newCp, Map classnames) { if (methodIndex() == 0) return new EnclosingMethodAttribute(newCp, className()); else return new EnclosingMethodAttribute(newCp, className(), methodName(), methodDescriptor()); } }
/** * Makes a copy. Class names are replaced according to the * given <code>Map</code> object. * * @param newCp the constant pool table used by the new copy. * @param classnames pairs of replaced and substituted * class names. */ @Override public AttributeInfo copy(ConstPool newCp, Map<String,String> classnames) { if (methodIndex() == 0) return new EnclosingMethodAttribute(newCp, className()); return new EnclosingMethodAttribute(newCp, className(), methodName(), methodDescriptor()); } }
public CtBehavior getEnclosingBehavior() throws NotFoundException { ClassFile cf = getClassFile2(); EnclosingMethodAttribute ema = (EnclosingMethodAttribute)cf.getAttribute( EnclosingMethodAttribute.tag); if (ema == null) return null; else { CtClass enc = classPool.get(ema.className()); String name = ema.methodName(); if (MethodInfo.nameInit.equals(name)) return enc.getConstructor(ema.methodDescriptor()); else if(MethodInfo.nameClinit.equals(name)) return enc.getClassInitializer(); else return enc.getMethod(name, ema.methodDescriptor()); } }
public CtClass getDeclaringClass() throws NotFoundException { ClassFile cf = getClassFile2(); InnerClassesAttribute ica = (InnerClassesAttribute)cf.getAttribute( InnerClassesAttribute.tag); if (ica == null) return null; String name = getName(); int n = ica.tableLength(); for (int i = 0; i < n; ++i) if (name.equals(ica.innerClass(i))) { String outName = ica.outerClass(i); if (outName != null) return classPool.get(outName); else { // maybe anonymous or local class. EnclosingMethodAttribute ema = (EnclosingMethodAttribute)cf.getAttribute( EnclosingMethodAttribute.tag); if (ema != null) return classPool.get(ema.className()); } } return null; }
@Override public CtBehavior getEnclosingBehavior() throws NotFoundException { ClassFile cf = getClassFile2(); EnclosingMethodAttribute ema = (EnclosingMethodAttribute)cf.getAttribute( EnclosingMethodAttribute.tag); if (ema == null) return null; CtClass enc = classPool.get(ema.className()); String name = ema.methodName(); if (MethodInfo.nameInit.equals(name)) return enc.getConstructor(ema.methodDescriptor()); else if(MethodInfo.nameClinit.equals(name)) return enc.getClassInitializer(); else return enc.getMethod(name, ema.methodDescriptor()); }
@Override public CtClass getDeclaringClass() throws NotFoundException { ClassFile cf = getClassFile2(); InnerClassesAttribute ica = (InnerClassesAttribute)cf.getAttribute( InnerClassesAttribute.tag); if (ica == null) return null; String name = getName(); int n = ica.tableLength(); for (int i = 0; i < n; ++i) if (name.equals(ica.innerClass(i))) { String outName = ica.outerClass(i); if (outName != null) return classPool.get(outName); // maybe anonymous or local class. EnclosingMethodAttribute ema = (EnclosingMethodAttribute)cf.getAttribute( EnclosingMethodAttribute.tag); if (ema != null) return classPool.get(ema.className()); } return null; }
/** * Makes a copy. Class names are replaced according to the * given <code>Map</code> object. * * @param newCp the constant pool table used by the new copy. * @param classnames pairs of replaced and substituted * class names. */ public AttributeInfo copy(ConstPool newCp, Map classnames) { if (methodIndex() == 0) return new EnclosingMethodAttribute(newCp, className()); else return new EnclosingMethodAttribute(newCp, className(), methodName(), methodDescriptor()); } }
/** * Makes a copy. Class names are replaced according to the * given <code>Map</code> object. * * @param newCp the constant pool table used by the new copy. * @param classnames pairs of replaced and substituted * class names. */ public AttributeInfo copy(ConstPool newCp, Map classnames) { if (methodIndex() == 0) return new EnclosingMethodAttribute(newCp, className()); else return new EnclosingMethodAttribute(newCp, className(), methodName(), methodDescriptor()); } }
/** * Makes a copy. Class names are replaced according to the * given <code>Map</code> object. * * @param newCp the constant pool table used by the new copy. * @param classnames pairs of replaced and substituted * class names. */ public AttributeInfo copy(ConstPool newCp, Map classnames) { if (methodIndex() == 0) return new EnclosingMethodAttribute(newCp, className()); else return new EnclosingMethodAttribute(newCp, className(), methodName(), methodDescriptor()); } }
/** * Makes a copy. Class names are replaced according to the * given <code>Map</code> object. * * @param newCp the constant pool table used by the new copy. * @param classnames pairs of replaced and substituted * class names. */ public AttributeInfo copy(ConstPool newCp, Map classnames) { if (methodIndex() == 0) return new EnclosingMethodAttribute(newCp, className()); else return new EnclosingMethodAttribute(newCp, className(), methodName(), methodDescriptor()); } }
/** * Makes a copy. Class names are replaced according to the * given <code>Map</code> object. * * @param newCp the constant pool table used by the new copy. * @param classnames pairs of replaced and substituted * class names. */ public AttributeInfo copy(ConstPool newCp, Map classnames) { if (methodIndex() == 0) return new EnclosingMethodAttribute(newCp, className()); else return new EnclosingMethodAttribute(newCp, className(), methodName(), methodDescriptor()); } }
public CtMethod getEnclosingMethod() throws NotFoundException { ClassFile cf = getClassFile2(); EnclosingMethodAttribute ema = (EnclosingMethodAttribute)cf.getAttribute( EnclosingMethodAttribute.tag); if (ema != null) { CtClass enc = classPool.get(ema.className()); return enc.getMethod(ema.methodName(), ema.methodDescriptor()); } return null; }
public CtMethod getEnclosingMethod() throws NotFoundException { ClassFile cf = getClassFile2(); EnclosingMethodAttribute ema = (EnclosingMethodAttribute)cf.getAttribute( EnclosingMethodAttribute.tag); if (ema != null) { CtClass enc = classPool.get(ema.className()); return enc.getMethod(ema.methodName(), ema.methodDescriptor()); } return null; }
public CtMethod getEnclosingMethod() throws NotFoundException { ClassFile cf = getClassFile2(); EnclosingMethodAttribute ema = (EnclosingMethodAttribute)cf.getAttribute( EnclosingMethodAttribute.tag); if (ema != null) { CtClass enc = classPool.get(ema.className()); return enc.getMethod(ema.methodName(), ema.methodDescriptor()); } return null; }
public CtMethod getEnclosingMethod() throws NotFoundException { ClassFile cf = getClassFile2(); EnclosingMethodAttribute ema = (EnclosingMethodAttribute)cf.getAttribute( EnclosingMethodAttribute.tag); if (ema != null) { CtClass enc = classPool.get(ema.className()); return enc.getMethod(ema.methodName(), ema.methodDescriptor()); } return null; }
public CtMethod getEnclosingMethod() throws NotFoundException { ClassFile cf = getClassFile2(); EnclosingMethodAttribute ema = (EnclosingMethodAttribute)cf.getAttribute( EnclosingMethodAttribute.tag); if (ema != null) { CtClass enc = classPool.get(ema.className()); return enc.getMethod(ema.methodName(), ema.methodDescriptor()); } return null; }
public CtClass getDeclaringClass() throws NotFoundException { ClassFile cf = getClassFile2(); InnerClassesAttribute ica = (InnerClassesAttribute)cf.getAttribute( InnerClassesAttribute.tag); if (ica == null) return null; String name = getName(); int n = ica.tableLength(); for (int i = 0; i < n; ++i) if (name.equals(ica.innerClass(i))) { String outName = ica.outerClass(i); if (outName != null) return classPool.get(outName); else { // maybe anonymous or local class. EnclosingMethodAttribute ema = (EnclosingMethodAttribute)cf.getAttribute( EnclosingMethodAttribute.tag); if (ema != null) return classPool.get(ema.className()); } } return null; }
public CtClass getDeclaringClass() throws NotFoundException { ClassFile cf = getClassFile2(); InnerClassesAttribute ica = (InnerClassesAttribute)cf.getAttribute( InnerClassesAttribute.tag); if (ica == null) return null; String name = getName(); int n = ica.tableLength(); for (int i = 0; i < n; ++i) if (name.equals(ica.innerClass(i))) { String outName = ica.outerClass(i); if (outName != null) return classPool.get(outName); else { // maybe anonymous or local class. EnclosingMethodAttribute ema = (EnclosingMethodAttribute)cf.getAttribute( EnclosingMethodAttribute.tag); if (ema != null) return classPool.get(ema.className()); } } return null; }
public CtClass getDeclaringClass() throws NotFoundException { ClassFile cf = getClassFile2(); InnerClassesAttribute ica = (InnerClassesAttribute)cf.getAttribute( InnerClassesAttribute.tag); if (ica == null) return null; String name = getName(); int n = ica.tableLength(); for (int i = 0; i < n; ++i) if (name.equals(ica.innerClass(i))) { String outName = ica.outerClass(i); if (outName != null) return classPool.get(outName); else { // maybe anonymous or local class. EnclosingMethodAttribute ema = (EnclosingMethodAttribute)cf.getAttribute( EnclosingMethodAttribute.tag); if (ema != null) return classPool.get(ema.className()); } } return null; }
public CtClass getDeclaringClass() throws NotFoundException { ClassFile cf = getClassFile2(); InnerClassesAttribute ica = (InnerClassesAttribute)cf.getAttribute( InnerClassesAttribute.tag); if (ica == null) return null; String name = getName(); int n = ica.tableLength(); for (int i = 0; i < n; ++i) if (name.equals(ica.innerClass(i))) { String outName = ica.outerClass(i); if (outName != null) return classPool.get(outName); else { // maybe anonymous or local class. EnclosingMethodAttribute ema = (EnclosingMethodAttribute)cf.getAttribute( EnclosingMethodAttribute.tag); if (ema != null) return classPool.get(ema.className()); } } return null; }