public boolean isInterface() { return Modifier.isInterface(getModifiers()); }
public boolean isAnnotation() { return Modifier.isAnnotation(getModifiers()); }
public boolean isEnum() { return Modifier.isEnum(getModifiers()); }
@Override public boolean isInterface() { return Modifier.isInterface(getModifiers()); }
@Override public boolean isAnnotation() { return Modifier.isAnnotation(getModifiers()); }
@Override public boolean isEnum() { return Modifier.isEnum(getModifiers()); }
buffer.append("pruned "); buffer.append(Modifier.toString(getModifiers())); buffer.append(" class "); buffer.append(getName());
private void makeMemberList(HashMap table) { int mod = getModifiers(); if (Modifier.isAbstract(mod) || Modifier.isInterface(mod)) try {
buffer.append("pruned "); buffer.append(Modifier.toString(getModifiers())); buffer.append(" class "); buffer.append(getName());
public void addMethod(CtMethod m) throws CannotCompileException { checkModify(); if (m.getDeclaringClass() != this) throw new CannotCompileException("bad declaring class"); int mod = m.getModifiers(); if ((getModifiers() & Modifier.INTERFACE) != 0) { if (Modifier.isProtected(mod) || Modifier.isPrivate(mod)) throw new CannotCompileException( "an interface method must be public: " + m.toString()); m.setModifiers(mod | Modifier.PUBLIC); } getMembers().addMethod(m); getClassFile2().addMethod(m.getMethodInfo2()); if ((mod & Modifier.ABSTRACT) != 0) setModifiers(getModifiers() | Modifier.ABSTRACT); }
@Override public void addMethod(CtMethod m) throws CannotCompileException { checkModify(); if (m.getDeclaringClass() != this) throw new CannotCompileException("bad declaring class"); int mod = m.getModifiers(); if ((getModifiers() & Modifier.INTERFACE) != 0) { if (Modifier.isProtected(mod) || Modifier.isPrivate(mod)) throw new CannotCompileException( "an interface method must be public: " + m.toString()); m.setModifiers(mod | Modifier.PUBLIC); } getMembers().addMethod(m); getClassFile2().addMethod(m.getMethodInfo2()); if ((mod & Modifier.ABSTRACT) != 0) setModifiers(getModifiers() | Modifier.ABSTRACT); }
private void makeMemberList(Map<Object,CtClassType> table) { int mod = getModifiers(); if (Modifier.isAbstract(mod) || Modifier.isInterface(mod)) try { CtClass[] ifs = getInterfaces(); for (CtClass ic : ifs) if (ic != null && ic instanceof CtClassType) ((CtClassType)ic).makeMemberList(table); } catch (NotFoundException e) {} try { CtClass s = getSuperclass(); if (s != null && s instanceof CtClassType) ((CtClassType)s).makeMemberList(table); } catch (NotFoundException e) {} List<MethodInfo> methods = getClassFile2().getMethods(); for (MethodInfo minfo:methods) table.put(minfo.getName(), this); List<FieldInfo> fields = getClassFile2().getFields(); for (FieldInfo finfo:fields) table.put(finfo.getName(), this); } }
public boolean isInterface() { return Modifier.isInterface(getModifiers()); }
public boolean isEnum() { return Modifier.isEnum(getModifiers()); }
public boolean isInterface() { return Modifier.isInterface(getModifiers()); }
public boolean isAnnotation() { return Modifier.isAnnotation(getModifiers()); }
public boolean isInterface() { return Modifier.isInterface(getModifiers()); }
public void addMethod(CtMethod m) throws CannotCompileException { checkModify(); if (m.getDeclaringClass() != this) throw new CannotCompileException("bad declaring class"); int mod = m.getModifiers(); if ((getModifiers() & Modifier.INTERFACE) != 0) { m.setModifiers(mod | Modifier.PUBLIC); if ((mod & Modifier.ABSTRACT) == 0) throw new CannotCompileException( "an interface method must be abstract: " + m.toString()); } getMembers().addMethod(m); getClassFile2().addMethod(m.getMethodInfo2()); if ((mod & Modifier.ABSTRACT) != 0) setModifiers(getModifiers() | Modifier.ABSTRACT); }
public void addMethod(CtMethod m) throws CannotCompileException { checkModify(); if (m.getDeclaringClass() != this) throw new CannotCompileException("bad declaring class"); int mod = m.getModifiers(); if ((getModifiers() & Modifier.INTERFACE) != 0) { m.setModifiers(mod | Modifier.PUBLIC); if ((mod & Modifier.ABSTRACT) == 0) throw new CannotCompileException( "an interface method must be abstract: " + m.toString()); } getMembers().addMethod(m); getClassFile2().addMethod(m.getMethodInfo2()); if ((mod & Modifier.ABSTRACT) != 0) setModifiers(getModifiers() | Modifier.ABSTRACT); }
public void addMethod(CtMethod m) throws CannotCompileException { checkModify(); if (m.getDeclaringClass() != this) throw new CannotCompileException("cannot add"); getMembers().addMethod(m); getClassFile2().addMethod(m.getMethodInfo2()); if ((m.getModifiers() & Modifier.ABSTRACT) != 0) setModifiers(getModifiers() | Modifier.ABSTRACT); }