Java Code Examples for proguard.classfile.constant.Constant#accept()
The following examples show how to use
proguard.classfile.constant.Constant#accept() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MemberReferenceFixer.java From java-n-IDE-for-Android with Apache License 2.0 | 6 votes |
public void visitProgramClass(ProgramClass programClass) { stackSizesMayHaveChanged = false; // Fix the constant pool entries. for (int index = 1; index < programClass.u2constantPoolCount; index++) { Constant constant = programClass.constantPool[index]; if (constant != null) { // Fix the entry, replacing it entirely if needed. this.constantIndex = index; constant.accept(programClass, this); } } // Fix the class members. programClass.fieldsAccept(this); programClass.methodsAccept(this); // Fix the attributes. programClass.attributesAccept(this); }
Example 2
Source File: ConstantTagFilter.java From java-n-IDE-for-Android with Apache License 2.0 | 5 votes |
public void visitAnyConstant(Clazz clazz, Constant constant) { if (constant.getTag() == constantTag) { constant.accept(clazz, constantVisitor); } }
Example 3
Source File: ConstantAdder.java From java-n-IDE-for-Android with Apache License 2.0 | 5 votes |
/** * Adds a copy of the given constant in the given class and returns * its index. */ public int addConstant(Clazz clazz, Constant constant) { constant.accept(clazz, this); return this.constantIndex; }
Example 4
Source File: ProgramClassWriter.java From java-n-IDE-for-Android with Apache License 2.0 | 5 votes |
public void visitAnyConstant(Clazz clazz, Constant constant) { // Write the tag. dataOutput.writeByte(constant.getTag()); // Write the actual body. constant.accept(clazz, constantBodyWriter); }
Example 5
Source File: ConstantTagFilter.java From proguard with GNU General Public License v2.0 | 5 votes |
public void visitAnyConstant(Clazz clazz, Constant constant) { if (((1 << constant.getTag()) & constantTagMask) != 0) { constant.accept(clazz, constantVisitor); } }
Example 6
Source File: ConstantTagFilter.java From bazel with Apache License 2.0 | 5 votes |
public void visitAnyConstant(Clazz clazz, Constant constant) { if (((1 << constant.getTag()) & constantTagMask) != 0) { constant.accept(clazz, constantVisitor); } }
Example 7
Source File: ProgramClassReader.java From java-n-IDE-for-Android with Apache License 2.0 | 4 votes |
public void visitProgramClass(ProgramClass programClass) { // Read and check the magic number. programClass.u4magic = dataInput.readInt(); ClassUtil.checkMagicNumber(programClass.u4magic); // Read and check the version numbers. int u2minorVersion = dataInput.readUnsignedShort(); int u2majorVersion = dataInput.readUnsignedShort(); programClass.u4version = ClassUtil.internalClassVersion(u2majorVersion, u2minorVersion); ClassUtil.checkVersionNumbers(programClass.u4version); // Read the constant pool. Note that the first entry is not used. programClass.u2constantPoolCount = dataInput.readUnsignedShort(); programClass.constantPool = new Constant[programClass.u2constantPoolCount]; for (int index = 1; index < programClass.u2constantPoolCount; index++) { Constant constant = createConstant(); constant.accept(programClass, this); programClass.constantPool[index] = constant; // Long constants and double constants take up two entries in the // constant pool. int tag = constant.getTag(); if (tag == ClassConstants.CONSTANT_Long || tag == ClassConstants.CONSTANT_Double) { programClass.constantPool[++index] = null; } } // Read the general class information. programClass.u2accessFlags = dataInput.readUnsignedShort(); programClass.u2thisClass = dataInput.readUnsignedShort(); programClass.u2superClass = dataInput.readUnsignedShort(); // Read the interfaces. programClass.u2interfacesCount = dataInput.readUnsignedShort(); programClass.u2interfaces = new int[programClass.u2interfacesCount]; for (int index = 0; index < programClass.u2interfacesCount; index++) { programClass.u2interfaces[index] = dataInput.readUnsignedShort(); } // Read the fields. programClass.u2fieldsCount = dataInput.readUnsignedShort(); programClass.fields = new ProgramField[programClass.u2fieldsCount]; for (int index = 0; index < programClass.u2fieldsCount; index++) { ProgramField programField = new ProgramField(); this.visitProgramField(programClass, programField); programClass.fields[index] = programField; } // Read the methods. programClass.u2methodsCount = dataInput.readUnsignedShort(); programClass.methods = new ProgramMethod[programClass.u2methodsCount]; for (int index = 0; index < programClass.u2methodsCount; index++) { ProgramMethod programMethod = new ProgramMethod(); this.visitProgramMethod(programClass, programMethod); programClass.methods[index] = programMethod; } // Read the class attributes. programClass.u2attributesCount = dataInput.readUnsignedShort(); programClass.attributes = new Attribute[programClass.u2attributesCount]; for (int index = 0; index < programClass.u2attributesCount; index++) { Attribute attribute = createAttribute(programClass); attribute.accept(programClass, this); programClass.attributes[index] = attribute; } }