Package org.gjt.jclasslib.structures.constants

Examples of org.gjt.jclasslib.structures.constants.ConstantUtf8Info


        Get the name of the class member.
        @return the name
        @throws InvalidByteCodeException if the entry is invalid
     */
    public String getName() throws InvalidByteCodeException {
        ConstantUtf8Info cpinfo = classFile.getConstantPoolUtf8Entry(nameIndex);
        if (cpinfo == null) {
            return "invalid constant pool index";
        } else {
            return cpinfo.getString();
        }
    }
View Full Code Here


        Get the verbose descriptor of the class member.
        @return the descriptor
        @throws InvalidByteCodeException if the entry is invalid
     */
    public String getDescriptor() throws InvalidByteCodeException {
        ConstantUtf8Info cpinfo = classFile.getConstantPoolUtf8Entry(descriptorIndex);
        if (cpinfo == null) {
            return "invalid constant pool index";
        } else {
            return cpinfo.getString();
        }
    }
View Full Code Here

    public void show(TreePath treePath) {
       
        int constantPoolIndex = constantPoolIndex(treePath);

        try {
            ConstantUtf8Info entry = services.getClassFile().getConstantPoolUtf8Entry(constantPoolIndex);
            lblByteLength.setText(entry.getBytes().length);
            lblStringLength.setText(entry.getString().length());
            lblString.setText(getConstantPoolEntryName(constantPoolIndex));
        } catch (InvalidByteCodeException ex) {
            lblByteLength.setText(-1);
            lblStringLength.setText(-1);
            lblByteLengthComment.setText(MESSAGE_INVALID_CONSTANT_POOL_ENTRY);
View Full Code Here

            in.skipBytes(in.readInt());
        } else {
            int attributeNameIndex = in.readUnsignedShort();
            int attributeLength = in.readInt();

            ConstantUtf8Info cpInfoName = classFile.getConstantPoolUtf8Entry(attributeNameIndex);
            String attributeName = null;

            if (cpInfoName == null) {
                return null;
            }

            attributeName = cpInfoName.getString();

            if (ConstantValueAttribute.ATTRIBUTE_NAME.equals(attributeName)) {
                attributeInfo = new ConstantValueAttribute();

            } else if (CodeAttribute.ATTRIBUTE_NAME.equals(attributeName)) {
View Full Code Here

            in.skipBytes(in.readInt());
        } else {
            int attributeNameIndex = in.readUnsignedShort();
            int attributeLength = in.readInt();

            ConstantUtf8Info cpInfoName = classFile.getConstantPoolUtf8Entry(attributeNameIndex);
            String attributeName;

            if (cpInfoName == null) {
                return null;
            }

            attributeName = cpInfoName.getString();

            if (ConstantValueAttribute.ATTRIBUTE_NAME.equals(attributeName)) {
                attributeInfo = new ConstantValueAttribute();
            } else if (CodeAttribute.ATTRIBUTE_NAME.equals(attributeName)) {
                attributeInfo = new CodeAttribute();
View Full Code Here

        Get the name of the class member.
        @return the name
        @throws InvalidByteCodeException if the entry is invalid
     */
    public String getName() throws InvalidByteCodeException {
        ConstantUtf8Info cpinfo = classFile.getConstantPoolUtf8Entry(nameIndex);
        if (cpinfo == null) {
            return "invalid constant pool index";
        } else {
            return cpinfo.getString();
        }
    }
View Full Code Here

        Get the verbose descriptor of the class member.
        @return the descriptor
        @throws InvalidByteCodeException if the entry is invalid
     */
    public String getDescriptor() throws InvalidByteCodeException {
        ConstantUtf8Info cpinfo = classFile.getConstantPoolUtf8Entry(descriptorIndex);
        if (cpinfo == null) {
            return "invalid constant pool index";
        } else {
            return cpinfo.getString();
        }
    }
View Full Code Here

    public void show(TreePath treePath) {
       
        int constantPoolIndex = constantPoolIndex(treePath);

        try {
            ConstantUtf8Info entry = services.getClassFile().getConstantPoolUtf8Entry(constantPoolIndex);
            lblByteLength.setText(entry.getBytes().length);
            lblStringLength.setText(entry.getString().length());
            lblString.setText(getConstantPoolEntryName(constantPoolIndex));
        } catch (InvalidByteCodeException ex) {
            lblByteLength.setText(-1);
            lblStringLength.setText(-1);
            lblByteLengthComment.setText(MESSAGE_INVALID_CONSTANT_POOL_ENTRY);
View Full Code Here

TOP

Related Classes of org.gjt.jclasslib.structures.constants.ConstantUtf8Info

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.