當前位置: 首頁>>代碼示例>>Java>>正文


Java Opcodes.ACC_PUBLIC屬性代碼示例

本文整理匯總了Java中org.objectweb.asm.Opcodes.ACC_PUBLIC屬性的典型用法代碼示例。如果您正苦於以下問題:Java Opcodes.ACC_PUBLIC屬性的具體用法?Java Opcodes.ACC_PUBLIC怎麽用?Java Opcodes.ACC_PUBLIC使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.objectweb.asm.Opcodes的用法示例。


在下文中一共展示了Opcodes.ACC_PUBLIC屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: registerClassMemberVar

private void registerClassMemberVar(TContextClass class_ctx, Container container) throws CompileException {
  ClassWriter cw = class_ctx.getClassWriter();
  Debug.assertion(cw != null, "ClassWriter should not be null");

  AbsType field_type = container.getType();
  Debug.assertion(field_type != null, "Container Type should not be null");

  //// Compiled Instruction
  LOG.debug(
      "Adding Field(" + container.name + ":" + field_type.getMthdDscStr() + ") in (" + class_ctx.getName() + ")");

  int access = 0;
  access |= Opcodes.ACC_PUBLIC;
  // access |= Opcodes.ACC_PROTECTED;

  if (container.isSingleton()) {
    access |= Opcodes.ACC_STATIC;
  }

  cw.visitField(access, container.name, field_type.getMthdDscStr(), null, null).visitEnd();
  //// End
}
 
開發者ID:Samsung,項目名稱:MeziLang,代碼行數:22,代碼來源:ASTCompileVisitor.java

示例2: visitField

@Override
public FieldVisitor visitField(final int access, final String name,
        final String desc, final String signature, final Object value) {
    String s = remapper.mapFieldName(className, name, desc);
    if ("-".equals(s)) {
        return null;
    }
    if ((access & (Opcodes.ACC_PUBLIC | Opcodes.ACC_PROTECTED)) == 0) {
        if ((access & Opcodes.ACC_FINAL) != 0
                && (access & Opcodes.ACC_STATIC) != 0 && desc.length() == 1) {
            return null;
        }
        if ("org/objectweb/asm".equals(pkgName) && s.equals(name)) {
            System.out.println("INFO: " + clsName + "." + s
                    + " could be renamed");
        }
        super.visitField(access, name, desc, null, value);
    } else {
        if (!s.equals(name)) {
            throw new RuntimeException("The public or protected field "
                    + className + '.' + name + " must not be renamed.");
        }
        super.visitField(access, name, desc, null, value);
    }
    return null; // remove debug info
}
 
開發者ID:acmerli,項目名稱:fastAOP,代碼行數:26,代碼來源:ClassOptimizer.java

示例3: getAccess

public int getAccess() {
	if (asmNodes != null) {
		return asmNodes[0].access;
	} else {
		int ret = Opcodes.ACC_PUBLIC;

		if (!implementers.isEmpty()) {
			ret |= Opcodes.ACC_INTERFACE | Opcodes.ACC_ABSTRACT;
		} else if (superClass != null && superClass.id.equals("Ljava/lang/Enum;")) {
			ret |= Opcodes.ACC_ENUM;
			if (childClasses.isEmpty()) ret |= Opcodes.ACC_FINAL;
		} else if (interfaces.size() == 1 && interfaces.iterator().next().id.equals("Ljava/lang/annotation/Annotation;")) {
			ret |= Opcodes.ACC_ANNOTATION | Opcodes.ACC_INTERFACE | Opcodes.ACC_ABSTRACT;
		}

		return ret;
	}
}
 
開發者ID:sfPlayer1,項目名稱:Matcher,代碼行數:18,代碼來源:ClassInstance.java

示例4: transformClassAccessForInstantRun

public static int transformClassAccessForInstantRun(int access) {
    IncrementalVisitor.AccessRight accessRight = IncrementalVisitor.AccessRight.fromNodeAccess(access);
    int fixedVisibility = accessRight == IncrementalVisitor.AccessRight.PACKAGE_PRIVATE
            ? access | Opcodes.ACC_PUBLIC
            : access;

    // TODO: only do this on KitKat?
    return fixedVisibility | Opcodes.ACC_SUPER;
}
 
開發者ID:meili,項目名稱:Aceso,代碼行數:9,代碼來源:IncrementalTool.java

示例5: checkForPublicConstructor

private static void checkForPublicConstructor(ClassNode node)
{
    for (MethodNode method : node.methods)
    {
        if (method.name.equals("<init>") && (method.access & Opcodes.ACC_PUBLIC) == Opcodes.ACC_PUBLIC)
            return;
    }

    throw new RuntimeException(" Block Class " + node.name + " has no public constructor");
}
 
開發者ID:cubex2,項目名稱:customstuff4,代碼行數:10,代碼來源:BlockFactory.java

示例6: visitField

@Override
public FieldVisitor visitField(final int access, final String name,
        final String desc, final String signature, final Object value) {
    if (computeSVUID) {
        if ("serialVersionUID".equals(name)) {
            // since the class already has SVUID, we won't be computing it.
            computeSVUID = false;
            hasSVUID = true;
        }
        /*
         * Remember field for SVUID computation For field modifiers, only
         * the ACC_PUBLIC, ACC_PRIVATE, ACC_PROTECTED, ACC_STATIC,
         * ACC_FINAL, ACC_VOLATILE, and ACC_TRANSIENT flags are used when
         * computing serialVersionUID values.
         */
        if ((access & Opcodes.ACC_PRIVATE) == 0
                || (access & (Opcodes.ACC_STATIC | Opcodes.ACC_TRANSIENT)) == 0) {
            int mods = access
                    & (Opcodes.ACC_PUBLIC | Opcodes.ACC_PRIVATE
                            | Opcodes.ACC_PROTECTED | Opcodes.ACC_STATIC
                            | Opcodes.ACC_FINAL | Opcodes.ACC_VOLATILE | Opcodes.ACC_TRANSIENT);
            svuidFields.add(new Item(name, mods, desc));
        }
    }

    return super.visitField(access, name, desc, signature, value);
}
 
開發者ID:acmerli,項目名稱:fastAOP,代碼行數:27,代碼來源:SerialVersionUIDAdder.java

示例7: getScore

@Override
public double getScore(MethodInstance methodA, MethodInstance methodB, ClassEnvironment env) {
	if (!checkAsmNodes(methodA, methodB)) return compareAsmNodes(methodA, methodB);

	int mask = (Opcodes.ACC_PUBLIC | Opcodes.ACC_PROTECTED | Opcodes.ACC_PRIVATE) | Opcodes.ACC_FINAL | Opcodes.ACC_SYNCHRONIZED | Opcodes.ACC_BRIDGE | Opcodes.ACC_VARARGS | Opcodes.ACC_STRICT | Opcodes.ACC_SYNTHETIC;
	int resultA = methodA.getAsmNode().access & mask;
	int resultB = methodB.getAsmNode().access & mask;

	return 1 - Integer.bitCount(resultA ^ resultB) / 8.;
}
 
開發者ID:sfPlayer1,項目名稱:Matcher,代碼行數:10,代碼來源:MethodClassifier.java

示例8: getAccess

@Override
public int getAccess() {
	if (asmNode == null) {
		int ret = Opcodes.ACC_PUBLIC;
		if (isStatic) ret |= Opcodes.ACC_STATIC;

		return ret;
	} else {
		return asmNode.access;
	}
}
 
開發者ID:sfPlayer1,項目名稱:Matcher,代碼行數:11,代碼來源:MethodInstance.java

示例9: visitMethod

@Override
public MethodVisitor visitMethod(final int access, final String name,
        final String desc, final String signature, final String[] exceptions) {
    if (computeSVUID) {
        if ("<clinit>".equals(name)) {
            hasStaticInitializer = true;
        }
        /*
         * Remembers non private constructors and methods for SVUID
         * computation For constructor and method modifiers, only the
         * ACC_PUBLIC, ACC_PRIVATE, ACC_PROTECTED, ACC_STATIC, ACC_FINAL,
         * ACC_SYNCHRONIZED, ACC_NATIVE, ACC_ABSTRACT and ACC_STRICT flags
         * are used.
         */
        int mods = access
                & (Opcodes.ACC_PUBLIC | Opcodes.ACC_PRIVATE
                        | Opcodes.ACC_PROTECTED | Opcodes.ACC_STATIC
                        | Opcodes.ACC_FINAL | Opcodes.ACC_SYNCHRONIZED
                        | Opcodes.ACC_NATIVE | Opcodes.ACC_ABSTRACT | Opcodes.ACC_STRICT);

        // all non private methods
        if ((access & Opcodes.ACC_PRIVATE) == 0) {
            if ("<init>".equals(name)) {
                svuidConstructors.add(new Item(name, mods, desc));
            } else if (!"<clinit>".equals(name)) {
                svuidMethods.add(new Item(name, mods, desc));
            }
        }
    }

    return super.visitMethod(access, name, desc, signature, exceptions);
}
 
開發者ID:ItzSomebody,項目名稱:DirectLeaks-AntiReleak-Remover,代碼行數:32,代碼來源:SerialVersionUIDAdder.java

示例10: transformAccessForInstantRun

public static int transformAccessForInstantRun(int access) {
    IncrementalVisitor.AccessRight accessRight = IncrementalVisitor.AccessRight.fromNodeAccess(access);
    if (accessRight != IncrementalVisitor.AccessRight.PRIVATE) {
        access &= ~Opcodes.ACC_PROTECTED;
        access &= ~Opcodes.ACC_PRIVATE;
        return access | Opcodes.ACC_PUBLIC;
    }
    return access;
}
 
開發者ID:meili,項目名稱:Aceso,代碼行數:9,代碼來源:IncrementalTool.java

示例11: appendAccess

/**
 * Appends a string representation of the given access modifiers to
 * {@link #buf buf}.
 *
 * @param access
 *            some access modifiers.
 */
private void appendAccess(final int access) {
    if ((access & Opcodes.ACC_PUBLIC) != 0) {
        buf.append("public ");
    }
    if ((access & Opcodes.ACC_PRIVATE) != 0) {
        buf.append("private ");
    }
    if ((access & Opcodes.ACC_PROTECTED) != 0) {
        buf.append("protected ");
    }
    if ((access & Opcodes.ACC_FINAL) != 0) {
        buf.append("final ");
    }
    if ((access & Opcodes.ACC_STATIC) != 0) {
        buf.append("static ");
    }
    if ((access & Opcodes.ACC_SYNCHRONIZED) != 0) {
        buf.append("synchronized ");
    }
    if ((access & Opcodes.ACC_VOLATILE) != 0) {
        buf.append("volatile ");
    }
    if ((access & Opcodes.ACC_TRANSIENT) != 0) {
        buf.append("transient ");
    }
    if ((access & Opcodes.ACC_ABSTRACT) != 0) {
        buf.append("abstract ");
    }
    if ((access & Opcodes.ACC_STRICT) != 0) {
        buf.append("strictfp ");
    }
    if ((access & Opcodes.ACC_SYNTHETIC) != 0) {
        buf.append("synthetic ");
    }
    if ((access & Opcodes.ACC_MANDATED) != 0) {
        buf.append("mandated ");
    }
    if ((access & Opcodes.ACC_ENUM) != 0) {
        buf.append("enum ");
    }
}
 
開發者ID:acmerli,項目名稱:fastAOP,代碼行數:48,代碼來源:Textifier.java

示例12: isPublic

private static boolean isPublic(MethodNode m) {
    return (m.access & Opcodes.ACC_PUBLIC) != 0;
}
 
開發者ID:yutian-tianpl,項目名稱:byte-cobweb,代碼行數:3,代碼來源:MethodModifier.java

示例13: ConstructedNestedClass

public ConstructedNestedClass(ClassNode outer, String inner) {
    super(outer.getName() + "$" + replacePoints(inner), Opcodes.ACC_PUBLIC, ClassHelper.OBJECT_TYPE);
    this.knownEnclosingType = outer;
    this.isPrimaryNode = false;
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:5,代碼來源:GradleResolveVisitor.java

示例14: LowerCaseClass

public LowerCaseClass(String name) {
    super(name, Opcodes.ACC_PUBLIC, ClassHelper.OBJECT_TYPE);
    isPrimaryNode = false;
    this.className = name;
}
 
開發者ID:lxxlxx888,項目名稱:Reer,代碼行數:5,代碼來源:GradleResolveVisitor.java

示例15: isPublic

public static ClassAccessMatcher isPublic() {
    return new ClassAccessMatcher(Opcodes.ACC_PUBLIC);
}
 
開發者ID:yutian-tianpl,項目名稱:byte-cobweb,代碼行數:3,代碼來源:ClassMatchers.java


注:本文中的org.objectweb.asm.Opcodes.ACC_PUBLIC屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。