当前位置: 首页>>代码示例>>Java>>正文


Java AccessFlag.PUBLIC属性代码示例

本文整理汇总了Java中javassist.bytecode.AccessFlag.PUBLIC属性的典型用法代码示例。如果您正苦于以下问题:Java AccessFlag.PUBLIC属性的具体用法?Java AccessFlag.PUBLIC怎么用?Java AccessFlag.PUBLIC使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在javassist.bytecode.AccessFlag的用法示例。


在下文中一共展示了AccessFlag.PUBLIC属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: writeInnerClass

private void writeInnerClass(InnerClassesAttribute attr, List<ClassEntry> obfClassChain, ClassEntry obfClassEntry) {
	
	// get the new inner class name
	ClassEntry obfInnerClassEntry = obfClassEntry.buildClassEntry(obfClassChain);
	ClassEntry obfOuterClassEntry = obfInnerClassEntry.getOuterClassEntry();
	
	// here's what the JVM spec says about the InnerClasses attribute
	// append(inner, parent, 0 if anonymous else simple name, flags);
	
	// update the attribute with this inner class
	ConstPool constPool = attr.getConstPool();
	int innerClassIndex = constPool.addClassInfo(obfInnerClassEntry.getName());
	int parentClassIndex = constPool.addClassInfo(obfOuterClassEntry.getName());
	int innerClassNameIndex = 0;
	int accessFlags = AccessFlag.PUBLIC;
	// TODO: need to figure out if we can put static or not
	if (!m_index.isAnonymousClass(obfClassEntry)) {
		innerClassNameIndex = constPool.addUtf8Info(obfInnerClassEntry.getInnermostClassName());
	}
	
	attr.append(innerClassIndex, parentClassIndex, innerClassNameIndex, accessFlags);
	
	/* DEBUG 
	System.out.println(String.format("\tOBF: %s -> ATTR: %s,%s,%s (replace %s with %s)",
		obfClassEntry,
		attr.innerClass(attr.tableLength() - 1),
		attr.outerClass(attr.tableLength() - 1),
		attr.innerName(attr.tableLength() - 1),
		Constants.NonePackage + "/" + obfInnerClassName,
		obfClassEntry.getName()
	));
	*/
}
 
开发者ID:cccssw,项目名称:enigma-vk,代码行数:33,代码来源:InnerClassWriter.java

示例2: getModifier

public static String getModifier(CtMethod m){
	switch (m.getModifiers()) {
	case AccessFlag.PRIVATE:
		return "private";
	case AccessFlag.PUBLIC:
		return "public";
	case AccessFlag.PROTECTED:
		return "protected";		
	default:
		return "";
	}
}
 
开发者ID:rernas35,项目名称:ezmbus,代码行数:12,代码来源:JavassistUtil.java

示例3: writeInnerClass

private void writeInnerClass(InnerClassesAttribute attr, List<ClassEntry> obfClassChain, ClassEntry obfClassEntry) {

        // get the new inner class name
        ClassEntry obfInnerClassEntry = obfClassEntry.buildClassEntry(obfClassChain);
        ClassEntry obfOuterClassEntry = obfInnerClassEntry.getOuterClassEntry();

        // here's what the JVM spec says about the InnerClasses attribute
        // append(inner, parent, 0 if anonymous else simple name, flags);

        // update the attribute with this inner class
        ConstPool constPool = attr.getConstPool();
        int innerClassIndex = constPool.addClassInfo(obfInnerClassEntry.getName());
        int parentClassIndex = constPool.addClassInfo(obfOuterClassEntry.getName());
        int innerClassNameIndex = 0;
        int accessFlags = AccessFlag.PUBLIC;
        // TODO: need to figure out if we can put static or not
        if (!this.index.isAnonymousClass(obfClassEntry)) {
            innerClassNameIndex = constPool.addUtf8Info(obfInnerClassEntry.getInnermostClassName());
        }

        attr.append(innerClassIndex, parentClassIndex, innerClassNameIndex, accessFlags);

		/* DEBUG 
        System.out.println(String.format("\tOBF: %s -> ATTR: %s,%s,%s (replace %s with %s)",
			obfClassEntry,
			attr.innerClass(attr.tableLength() - 1),
			attr.outerClass(attr.tableLength() - 1),
			attr.innerName(attr.tableLength() - 1),
			Constants.NonePackage + "/" + obfInnerClassName,
			obfClassEntry.getName()
		));
		*/
    }
 
开发者ID:OpenModLoader,项目名称:Enigma,代码行数:33,代码来源:InnerClassWriter.java

示例4: writeInnerClass

private void writeInnerClass(InnerClassesAttribute attr,
	List<ClassEntry> obfClassChain, ClassEntry obfClassEntry)
{
	
	// get the new inner class name
	ClassEntry obfInnerClassEntry =
		obfClassEntry.buildClassEntry(obfClassChain);
	ClassEntry obfOuterClassEntry = obfInnerClassEntry.getOuterClassEntry();
	
	// here's what the JVM spec says about the InnerClasses attribute
	// append(inner, parent, 0 if anonymous else simple name, flags);
	
	// update the attribute with this inner class
	ConstPool constPool = attr.getConstPool();
	int innerClassIndex =
		constPool.addClassInfo(obfInnerClassEntry.getName());
	int parentClassIndex =
		constPool.addClassInfo(obfOuterClassEntry.getName());
	int innerClassNameIndex = 0;
	int accessFlags = AccessFlag.PUBLIC;
	// TODO: need to figure out if we can put static or not
	if(!m_index.isAnonymousClass(obfClassEntry))
		innerClassNameIndex =
			constPool.addUtf8Info(obfInnerClassEntry
				.getInnermostClassName());
	
	attr.append(innerClassIndex, parentClassIndex, innerClassNameIndex,
		accessFlags);
	
	/*
	 * DEBUG
	 * System.out.println(String.format(
	 * "\tOBF: %s -> ATTR: %s,%s,%s (replace %s with %s)",
	 * obfClassEntry,
	 * attr.innerClass(attr.tableLength() - 1),
	 * attr.outerClass(attr.tableLength() - 1),
	 * attr.innerName(attr.tableLength() - 1),
	 * Constants.NonePackage + "/" + obfInnerClassName,
	 * obfClassEntry.getName()
	 * ));
	 */
}
 
开发者ID:Wurst-Imperium,项目名称:Wurst-Enigma,代码行数:42,代码来源:InnerClassWriter.java


注:本文中的javassist.bytecode.AccessFlag.PUBLIC属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。