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


Java ConstPool.addClassInfo方法代碼示例

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


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

示例1: writeInnerClass

import javassist.bytecode.ConstPool; //導入方法依賴的package包/類
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,代碼行數:34,代碼來源:InnerClassWriter.java

示例2: replace

import javassist.bytecode.ConstPool; //導入方法依賴的package包/類
private int replace(ConstPool cp, CodeIterator iterator, int pos,
        int opcode, String signature) throws BadBytecode {
    String castType = null;
    String methodName = getMethodName(opcode);
    if (methodName != null) {
        // See if the object must be cast
        if (opcode == AALOAD) {
            castType = getTopType(iterator.lookAhead());
            // Do not replace an AALOAD instruction that we do not have a type for
            // This happens when the state is guaranteed to be null (Type.UNINIT)
            // So we don't really care about this case.
            if (castType == null)
                return pos;
            if ("java/lang/Object".equals(castType))
                castType = null;
        }

        // The gap may include extra padding
        // Write a nop in case the padding pushes the instruction forward
        iterator.writeByte(NOP, pos);
        CodeIterator.Gap gap
            = iterator.insertGapAt(pos, castType != null ? 5 : 2, false);
        pos = gap.position;
        int mi = cp.addClassInfo(methodClassname);
        int methodref = cp.addMethodrefInfo(mi, methodName, signature);
        iterator.writeByte(INVOKESTATIC, pos);
        iterator.write16bit(methodref, pos + 1);

        if (castType != null) {
            int index = cp.addClassInfo(castType);
            iterator.writeByte(CHECKCAST, pos + 3);
            iterator.write16bit(index, pos + 4);
        }

        pos = updatePos(pos, gap.length);
    }

    return pos;
}
 
開發者ID:AndreJCL,項目名稱:JCL,代碼行數:40,代碼來源:TransformAccessArrayField.java

示例3: writeInnerClass

import javassist.bytecode.ConstPool; //導入方法依賴的package包/類
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,代碼行數:34,代碼來源:InnerClassWriter.java

示例4: addGetter

import javassist.bytecode.ConstPool; //導入方法依賴的package包/類
private void addGetter(ClassFile classfile, final Method[] getters) throws CannotCompileException {
	ConstPool cp = classfile.getConstPool();
	int target_type_index = cp.addClassInfo( this.targetBean.getName() );
	String desc = GET_SETTER_DESC;
	MethodInfo mi = new MethodInfo( cp, GENERATED_GETTER_NAME, desc );

	Bytecode code = new Bytecode( cp, 6, 4 );
	/* | this | bean | args | raw bean | */
	if ( getters.length >= 0 ) {
		// aload_1 // load bean
		code.addAload( 1 );
		// checkcast // cast bean
		code.addCheckcast( this.targetBean.getName() );
		// astore_3 // store bean
		code.addAstore( 3 );
		for ( int i = 0; i < getters.length; ++i ) {
			if ( getters[i] != null ) {
				Method getter = getters[i];
				// aload_2 // args
				code.addAload( 2 );
				// iconst_i // continue to aastore
				code.addIconst( i ); // growing stack is 1
				Class returnType = getter.getReturnType();
				int typeIndex = -1;
				if ( returnType.isPrimitive() ) {
					typeIndex = FactoryHelper.typeIndex( returnType );
					// new
					code.addNew( FactoryHelper.wrapperTypes[typeIndex] );
					// dup
					code.addOpcode( Opcode.DUP );
				}

				// aload_3 // load the raw bean
				code.addAload( 3 );
				String getter_desc = RuntimeSupport.makeDescriptor( getter );
				String getterName = getter.getName();
				if ( this.targetBean.isInterface() ) {
					// invokeinterface
					code.addInvokeinterface( target_type_index, getterName, getter_desc, 1 );
				}
				else {
					// invokevirtual
					code.addInvokevirtual( target_type_index, getterName, getter_desc );
				}

				if ( typeIndex >= 0 ) {       // is a primitive type
					// invokespecial
					code.addInvokespecial(
							FactoryHelper.wrapperTypes[typeIndex],
					        MethodInfo.nameInit,
					        FactoryHelper.wrapperDesc[typeIndex]
					);
				}

				// aastore // args
				code.add( Opcode.AASTORE );
				code.growStack( -3 );
			}
		}
	}
	// return
	code.addOpcode( Opcode.RETURN );

	mi.setCodeAttribute( code.toCodeAttribute() );
	mi.setAccessFlags( AccessFlag.PUBLIC );
	classfile.addMethod( mi );
}
 
開發者ID:cacheonix,項目名稱:cacheonix-core,代碼行數:68,代碼來源:BulkAccessorFactory.java

示例5: addGetter

import javassist.bytecode.ConstPool; //導入方法依賴的package包/類
private void addGetter(ClassFile classfile, final Method[] getters) throws CannotCompileException {
	final ConstPool constPool = classfile.getConstPool();
	final int targetBeanConstPoolIndex = constPool.addClassInfo( this.targetBean.getName() );
	final String desc = GET_SETTER_DESC;
	final MethodInfo getterMethodInfo = new MethodInfo( constPool, GENERATED_GETTER_NAME, desc );

	final Bytecode code = new Bytecode( constPool, 6, 4 );
	/* | this | bean | args | raw bean | */
	if ( getters.length >= 0 ) {
		// aload_1 // load bean
		code.addAload( 1 );
		// checkcast // cast bean
		code.addCheckcast( this.targetBean.getName() );
		// astore_3 // store bean
		code.addAstore( 3 );
		for ( int i = 0; i < getters.length; ++i ) {
			if ( getters[i] != null ) {
				final Method getter = getters[i];
				// aload_2 // args
				code.addAload( 2 );
				// iconst_i // continue to aastore
				// growing stack is 1
				code.addIconst( i );
				final Class returnType = getter.getReturnType();
				int typeIndex = -1;
				if ( returnType.isPrimitive() ) {
					typeIndex = FactoryHelper.typeIndex( returnType );
					// new
					code.addNew( FactoryHelper.wrapperTypes[typeIndex] );
					// dup
					code.addOpcode( Opcode.DUP );
				}

				// aload_3 // load the raw bean
				code.addAload( 3 );
				final String getterSignature = RuntimeSupport.makeDescriptor( getter );
				final String getterName = getter.getName();
				if ( this.targetBean.isInterface() ) {
					// invokeinterface
					code.addInvokeinterface( targetBeanConstPoolIndex, getterName, getterSignature, 1 );
				}
				else {
					// invokevirtual
					code.addInvokevirtual( targetBeanConstPoolIndex, getterName, getterSignature );
				}

				if ( typeIndex >= 0 ) {
					// is a primitive type
					// invokespecial
					code.addInvokespecial(
							FactoryHelper.wrapperTypes[typeIndex],
							MethodInfo.nameInit,
							FactoryHelper.wrapperDesc[typeIndex]
					);
				}

				// aastore // args
				code.add( Opcode.AASTORE );
				code.growStack( -3 );
			}
		}
	}
	// return
	code.addOpcode( Opcode.RETURN );

	getterMethodInfo.setCodeAttribute( code.toCodeAttribute() );
	getterMethodInfo.setAccessFlags( AccessFlag.PUBLIC );
	classfile.addMethod( getterMethodInfo );
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:70,代碼來源:BulkAccessorFactory.java

示例6: addReadMethod

import javassist.bytecode.ConstPool; //導入方法依賴的package包/類
private void addReadMethod(ClassFile classfile, FieldInfo finfo) throws CannotCompileException, BadBytecode {
	final ConstPool constPool = classfile.getConstPool();
	final int thisClassInfo = constPool.getThisClassInfo();
	final String readMethodDescriptor = "()" + finfo.getDescriptor();
	final MethodInfo readMethodInfo = new MethodInfo(
			constPool,
			EACH_READ_METHOD_PREFIX + finfo.getName(),
			readMethodDescriptor
	);

	/* local variables | target obj | each oldvalue | */
	final Bytecode code = new Bytecode(constPool, 5, 3);
	// aload_0
	code.addAload( 0 );
	// getfield // get each field
	code.addOpcode( Opcode.GETFIELD );
	final int baseFieldIndex = constPool.addFieldrefInfo( thisClassInfo, finfo.getName(), finfo.getDescriptor() );
	code.addIndex( baseFieldIndex );
	// aload_0
	code.addAload( 0 );
	// invokeinterface : invoke Enabled.getInterceptFieldCallback()
	final int enabledClassIndex = constPool.addClassInfo( FIELD_HANDLED_TYPE_NAME );
	code.addInvokeinterface(
			enabledClassIndex,
			GETFIELDHANDLER_METHOD_NAME,
			GETFIELDHANDLER_METHOD_DESCRIPTOR,
			1
	);
	// ifnonnull
	code.addOpcode( Opcode.IFNONNULL );
	code.addIndex( 4 );
	// *return // each type
	addTypeDependDataReturn( code, finfo.getDescriptor() );
	// *store_1 // each type
	addTypeDependDataStore( code, finfo.getDescriptor(), 1 );
	// aload_0
	code.addAload( 0 );
	// invokeinterface // invoke Enabled.getInterceptFieldCallback()
	code.addInvokeinterface(
			enabledClassIndex,
			GETFIELDHANDLER_METHOD_NAME, GETFIELDHANDLER_METHOD_DESCRIPTOR,
			1
	);
	// aload_0
	code.addAload( 0 );
	// ldc // name of the field
	code.addLdc( finfo.getName() );
	// *load_1 // each type
	addTypeDependDataLoad( code, finfo.getDescriptor(), 1 );
	// invokeinterface // invoke Callback.read*() // each type
	addInvokeFieldHandlerMethod(
			classfile, code, finfo.getDescriptor(),
			true
	);
	// *return // each type
	addTypeDependDataReturn( code, finfo.getDescriptor() );

	readMethodInfo.setCodeAttribute( code.toCodeAttribute() );
	readMethodInfo.setAccessFlags( AccessFlag.PUBLIC );
	final CodeAttribute codeAttribute = readMethodInfo.getCodeAttribute();
	if ( codeAttribute != null ) {
		final StackMapTable smt = MapMaker.make( classPool, readMethodInfo );
		codeAttribute.setAttribute( smt );
	}
	classfile.addMethod( readMethodInfo );
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:67,代碼來源:FieldTransformer.java

示例7: addWriteMethod

import javassist.bytecode.ConstPool; //導入方法依賴的package包/類
private void addWriteMethod(ClassFile classfile, FieldInfo finfo) throws CannotCompileException, BadBytecode {
	final ConstPool constPool = classfile.getConstPool();
	final int thisClassInfo = constPool.getThisClassInfo();
	final String writeMethodDescriptor = "(" + finfo.getDescriptor() + ")V";
	final MethodInfo writeMethodInfo = new MethodInfo(
			constPool,
			EACH_WRITE_METHOD_PREFIX+ finfo.getName(),
			writeMethodDescriptor
	);

	/* local variables | target obj | each oldvalue | */
	final Bytecode code = new Bytecode(constPool, 6, 3);
	// aload_0
	code.addAload( 0 );
	// invokeinterface : enabled.getInterceptFieldCallback()
	final int enabledClassIndex = constPool.addClassInfo( FIELD_HANDLED_TYPE_NAME );
	code.addInvokeinterface(
			enabledClassIndex,
			GETFIELDHANDLER_METHOD_NAME, GETFIELDHANDLER_METHOD_DESCRIPTOR,
			1
	);
	// ifnonnull (label1)
	code.addOpcode( Opcode.IFNONNULL );
	code.addIndex( 9 );
	// aload_0
	code.addAload( 0 );
	// *load_1
	addTypeDependDataLoad( code, finfo.getDescriptor(), 1 );
	// putfield
	code.addOpcode( Opcode.PUTFIELD );
	final int baseFieldIndex = constPool.addFieldrefInfo( thisClassInfo, finfo.getName(), finfo.getDescriptor() );
	code.addIndex( baseFieldIndex );
	code.growStack( -Descriptor.dataSize( finfo.getDescriptor() ) );
	// return ;
	code.addOpcode( Opcode.RETURN );
	// aload_0
	code.addAload( 0 );
	// dup
	code.addOpcode( Opcode.DUP );
	// invokeinterface // enabled.getInterceptFieldCallback()
	code.addInvokeinterface(
			enabledClassIndex,
			GETFIELDHANDLER_METHOD_NAME,
			GETFIELDHANDLER_METHOD_DESCRIPTOR,
			1
	);
	// aload_0
	code.addAload( 0 );
	// ldc // field name
	code.addLdc( finfo.getName() );
	// aload_0
	code.addAload( 0 );
	// getfield // old value of the field
	code.addOpcode( Opcode.GETFIELD );
	code.addIndex( baseFieldIndex );
	code.growStack( Descriptor.dataSize( finfo.getDescriptor() ) - 1 );
	// *load_1
	addTypeDependDataLoad( code, finfo.getDescriptor(), 1 );
	// invokeinterface // callback.write*(..)
	addInvokeFieldHandlerMethod( classfile, code, finfo.getDescriptor(), false );
	// putfield // new value of the field
	code.addOpcode( Opcode.PUTFIELD );
	code.addIndex( baseFieldIndex );
	code.growStack( -Descriptor.dataSize( finfo.getDescriptor() ) );
	// return
	code.addOpcode( Opcode.RETURN );

	writeMethodInfo.setCodeAttribute( code.toCodeAttribute() );
	writeMethodInfo.setAccessFlags( AccessFlag.PUBLIC );
	final CodeAttribute codeAttribute = writeMethodInfo.getCodeAttribute();
	if ( codeAttribute != null ) {
		final StackMapTable smt = MapMaker.make( classPool, writeMethodInfo );
		codeAttribute.setAttribute( smt );
	}
	classfile.addMethod( writeMethodInfo );
}
 
開發者ID:lamsfoundation,項目名稱:lams,代碼行數:77,代碼來源:FieldTransformer.java

示例8: getTypeData2

import javassist.bytecode.ConstPool; //導入方法依賴的package包/類
protected int getTypeData2(ConstPool cp, String type) {
    return cp.addClassInfo(type);
}
 
開發者ID:AndreJCL,項目名稱:JCL,代碼行數:4,代碼來源:TypeData.java

示例9: addReadMethod

import javassist.bytecode.ConstPool; //導入方法依賴的package包/類
private void addReadMethod(ClassFile classfile, FieldInfo finfo)
		throws CannotCompileException {
	ConstPool cp = classfile.getConstPool();
	int this_class_index = cp.getThisClassInfo();
	String desc = "()" + finfo.getDescriptor();
	MethodInfo minfo = new MethodInfo(cp, EACH_READ_METHOD_PREFIX
	                                      + finfo.getName(), desc);
	/* local variables | target obj | each oldvalue | */
	Bytecode code = new Bytecode(cp, 5, 3);
	// aload_0
	code.addAload(0);
	// getfield // get each field
	code.addOpcode(Opcode.GETFIELD);
	int base_field_index = cp.addFieldrefInfo(this_class_index, finfo
			.getName(), finfo.getDescriptor());
	code.addIndex(base_field_index);
	// aload_0
	code.addAload(0);
	// invokeinterface // invoke Enabled.getInterceptFieldCallback()
	int enabled_class_index = cp.addClassInfo(FIELD_HANDLED_TYPE_NAME);
	code.addInvokeinterface(enabled_class_index,
	                        GETFIELDHANDLER_METHOD_NAME, GETFIELDHANDLER_METHOD_DESCRIPTOR,
	                        1);
	// ifnonnull
	code.addOpcode(Opcode.IFNONNULL);
	code.addIndex(4);
	// *return // each type
	addTypeDependDataReturn(code, finfo.getDescriptor());
	// *store_1 // each type
	addTypeDependDataStore(code, finfo.getDescriptor(), 1);
	// aload_0
	code.addAload(0);
	// invokeinterface // invoke Enabled.getInterceptFieldCallback()
	code.addInvokeinterface(enabled_class_index,
	                        GETFIELDHANDLER_METHOD_NAME, GETFIELDHANDLER_METHOD_DESCRIPTOR,
	                        1);
	// aload_0
	code.addAload(0);
	// ldc // name of the field
	code.addLdc(finfo.getName());
	// *load_1 // each type
	addTypeDependDataLoad(code, finfo.getDescriptor(), 1);
	// invokeinterface // invoke Callback.read*() // each type
	addInvokeFieldHandlerMethod(classfile, code, finfo.getDescriptor(),
	                            true);
	// *return // each type
	addTypeDependDataReturn(code, finfo.getDescriptor());

	minfo.setCodeAttribute(code.toCodeAttribute());
	minfo.setAccessFlags(AccessFlag.PUBLIC);
	classfile.addMethod(minfo);
}
 
開發者ID:cacheonix,項目名稱:cacheonix-core,代碼行數:53,代碼來源:FieldTransformer.java

示例10: addWriteMethod

import javassist.bytecode.ConstPool; //導入方法依賴的package包/類
private void addWriteMethod(ClassFile classfile, FieldInfo finfo)
		throws CannotCompileException {
	ConstPool cp = classfile.getConstPool();
	int this_class_index = cp.getThisClassInfo();
	String desc = "(" + finfo.getDescriptor() + ")V";
	MethodInfo minfo = new MethodInfo(cp, EACH_WRITE_METHOD_PREFIX
	                                      + finfo.getName(), desc);
	/* local variables | target obj | each oldvalue | */
	Bytecode code = new Bytecode(cp, 6, 3);
	// aload_0
	code.addAload(0);
	// invokeinterface // enabled.getInterceptFieldCallback()
	int enabled_class_index = cp.addClassInfo(FIELD_HANDLED_TYPE_NAME);
	code.addInvokeinterface(enabled_class_index,
	                        GETFIELDHANDLER_METHOD_NAME, GETFIELDHANDLER_METHOD_DESCRIPTOR,
	                        1);
	// ifnonnull (label1)
	code.addOpcode(Opcode.IFNONNULL);
	code.addIndex(9);
	// aload_0
	code.addAload(0);
	// *load_1
	addTypeDependDataLoad(code, finfo.getDescriptor(), 1);
	// putfield
	code.addOpcode(Opcode.PUTFIELD);
	int base_field_index = cp.addFieldrefInfo(this_class_index, finfo
			.getName(), finfo.getDescriptor());
	code.addIndex(base_field_index);
	code.growStack(-Descriptor.dataSize(finfo.getDescriptor()));
	// return ;
	code.addOpcode(Opcode.RETURN);
	// aload_0
	code.addAload(0);
	// dup
	code.addOpcode(Opcode.DUP);
	// invokeinterface // enabled.getInterceptFieldCallback()
	code.addInvokeinterface(enabled_class_index,
	                        GETFIELDHANDLER_METHOD_NAME, GETFIELDHANDLER_METHOD_DESCRIPTOR,
	                        1);
	// aload_0
	code.addAload(0);
	// ldc // field name
	code.addLdc(finfo.getName());
	// aload_0
	code.addAload(0);
	// getfield // old value of the field
	code.addOpcode(Opcode.GETFIELD);
	code.addIndex(base_field_index);
	code.growStack(Descriptor.dataSize(finfo.getDescriptor()) - 1);
	// *load_1
	addTypeDependDataLoad(code, finfo.getDescriptor(), 1);
	// invokeinterface // callback.write*(..)
	addInvokeFieldHandlerMethod(classfile, code, finfo.getDescriptor(),
	                            false);
	// putfield // new value of the field
	code.addOpcode(Opcode.PUTFIELD);
	code.addIndex(base_field_index);
	code.growStack(-Descriptor.dataSize(finfo.getDescriptor()));
	// return
	code.addOpcode(Opcode.RETURN);

	minfo.setCodeAttribute(code.toCodeAttribute());
	minfo.setAccessFlags(AccessFlag.PUBLIC);
	classfile.addMethod(minfo);
}
 
開發者ID:cacheonix,項目名稱:cacheonix-core,代碼行數:66,代碼來源:FieldTransformer.java

示例11: writeInnerClass

import javassist.bytecode.ConstPool; //導入方法依賴的package包/類
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,代碼行數:43,代碼來源:InnerClassWriter.java

示例12: getTypeData

import javassist.bytecode.ConstPool; //導入方法依賴的package包/類
public int getTypeData(ConstPool cp) {
    return cp.addClassInfo(getName());
}
 
開發者ID:MeRPG2,項目名稱:EndHQ-Libraries,代碼行數:4,代碼來源:TypeData.java


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