Package org.eclipse.jdt.core.util

Examples of org.eclipse.jdt.core.util.IConstantPoolEntry


      this.startPC = u2At(classFileBytes, 0, offset);
      this.length = u2At(classFileBytes, 2, offset);
      this.nameIndex = u2At(classFileBytes, 4, offset);
      this.signatureIndex = u2At(classFileBytes, 6, offset);
      this.index = u2At(classFileBytes, 8, offset);
      IConstantPoolEntry constantPoolEntry = constantPool.decodeEntry(this.nameIndex);
      if (constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Utf8) {
        throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY);
      }
      this.name = constantPoolEntry.getUtf8Value();
      constantPoolEntry = constantPool.decodeEntry(this.signatureIndex);
      if (constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Utf8) {
        throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY);
      }
      this.signature = constantPoolEntry.getUtf8Value();
    }
View Full Code Here


    switch(t) {
      case IVerificationTypeInfo.ITEM_OBJECT :
        final int constantIndex = u2At(classFileBytes, 1, offset);
        this.constantPoolIndex = constantIndex;
        if (constantIndex != 0) {
          IConstantPoolEntry constantPoolEntry = constantPool.decodeEntry(constantIndex);
          if (constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Class) {
            throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY);
          }
          this.classTypeName = constantPoolEntry.getClassInfoName();
        }
        this.readOffset += 2;
        break;
      case IVerificationTypeInfo.ITEM_UNINITIALIZED :
        this.offset = u2At(classFileBytes, 1, offset);
View Full Code Here

      case 'Z' :
      case 's' :
        final int constantIndex = u2At(classFileBytes, this.readOffset, offset);
        this.constantValueIndex = constantIndex;
        if (constantIndex != 0) {
          IConstantPoolEntry constantPoolEntry = constantPool.decodeEntry(constantIndex);
          switch(constantPoolEntry.getKind()) {
            case IConstantPoolConstant.CONSTANT_Long :
            case IConstantPoolConstant.CONSTANT_Float :
            case IConstantPoolConstant.CONSTANT_Double :
            case IConstantPoolConstant.CONSTANT_Integer :
            case IConstantPoolConstant.CONSTANT_Utf8 :
              break;
            default :
              throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY);
          }
          this.constantValue = constantPoolEntry;
        }
        this.readOffset += 2;
        break;
      case 'e' :
        int index = u2At(classFileBytes, this.readOffset, offset);
        this.enumConstantTypeNameIndex = index;
        if (index != 0) {
          IConstantPoolEntry constantPoolEntry = constantPool.decodeEntry(index);
          if (constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Utf8) {
            throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY);
          }
          this.enumConstantTypeName = constantPoolEntry.getUtf8Value();
        }
        this.readOffset += 2;
        index = u2At(classFileBytes, this.readOffset, offset);
        this.enumConstantNameIndex = index;
        if (index != 0) {
          IConstantPoolEntry constantPoolEntry = constantPool.decodeEntry(index);
          if (constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Utf8) {
            throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY);
          }
          this.enumConstantName = constantPoolEntry.getUtf8Value();
        }
        this.readOffset += 2;
        break;
      case 'c' :
        final int classFileIndex = u2At(classFileBytes, this.readOffset, offset);
        this.classFileInfoIndex = classFileIndex;
        if (classFileIndex != 0) {
          IConstantPoolEntry constantPoolEntry = constantPool.decodeEntry(classFileIndex);
          if (constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Utf8) {
            throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY);
          }
          this.classInfo = constantPoolEntry;
        }
        this.readOffset += 2;
View Full Code Here

    if (exceptionLength != 0) {
      this.exceptionNames = new char[exceptionLength][];
      this.exceptionIndexes = new int[exceptionLength];
    }
    int readOffset = 8;
    IConstantPoolEntry constantPoolEntry;
    for (int i = 0; i < exceptionLength; i++) {
      this.exceptionIndexes[i] = u2At(classFileBytes, readOffset, offset);
      constantPoolEntry = constantPool.decodeEntry(this.exceptionIndexes[i]);
      if (constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Class) {
        throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY);
      }
      this.exceptionNames[i] = constantPoolEntry.getClassInfoName();
      readOffset += 2;
    }
  }
View Full Code Here

      int offset) throws ClassFormatException {

    final int index = u2At(classFileBytes, 0, offset);
    this.typeIndex = index;
    if (index != 0) {
      IConstantPoolEntry constantPoolEntry = constantPool.decodeEntry(index);
      if (constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Utf8) {
        throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY);
      }
      this.typeName = constantPoolEntry.getUtf8Value();
    } else {
      throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY);
    }
    final int length = u2At(classFileBytes, 2, offset);
    this.componentsNumber = length;
View Full Code Here

      IConstantPool constantPool,
      int offset) throws ClassFormatException {
    final int nameIndex = u2At(classFileBytes, 0, offset);
    this.componentNameIndex = nameIndex;
    if (nameIndex != 0) {
      IConstantPoolEntry constantPoolEntry = constantPool.decodeEntry(nameIndex);
      if (constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Utf8) {
        throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY);
      }
      this.componentName = constantPoolEntry.getUtf8Value();
    }
    this.readOffset = 2;
    AnnotationComponentValue value = new AnnotationComponentValue(classFileBytes, constantPool, offset + this.readOffset);
    this.componentValue = value;
    this.readOffset += value.sizeInBytes();
View Full Code Here

  SignatureAttribute(byte[] classFileBytes, IConstantPool constantPool, int offset) throws ClassFormatException {
    super(classFileBytes, constantPool, offset);
    final int index = u2At(classFileBytes, 6, offset);
    this.signatureIndex = index;
    IConstantPoolEntry constantPoolEntry = constantPool.decodeEntry(index);
    if (constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Utf8) {
      throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY);
    }
    this.signature = constantPoolEntry.getUtf8Value();
  }
View Full Code Here

    this.startPC = u2At(classFileBytes, 0, offset);
    this.endPC = u2At(classFileBytes, 2, offset);
    this.handlerPC = u2At(classFileBytes, 4, offset);
    this.catchTypeIndex = u2At(classFileBytes, 6, offset);
    if (this.catchTypeIndex != 0) {
      IConstantPoolEntry constantPoolEntry = constantPool.decodeEntry(this.catchTypeIndex);
      if (constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Class) {
        throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY);
      }
      this.catchType = constantPoolEntry.getClassInfoName();
    }
  }
View Full Code Here

    throws ClassFormatException {
    this.innerClassNameIndex = u2At(classFileBytes, 0, offset);
    this.outerClassNameIndex = u2At(classFileBytes, 2, offset);
    this.innerNameIndex = u2At(classFileBytes, 4, offset);
    this.accessFlags = u2At(classFileBytes, 6, offset);
    IConstantPoolEntry constantPoolEntry;
    if (this.innerClassNameIndex != 0) {
      constantPoolEntry = constantPool.decodeEntry(this.innerClassNameIndex);
      if (constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Class) {
        throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY);
      }
      this.innerClassName = constantPoolEntry.getClassInfoName();
    }
    if (this.outerClassNameIndex != 0) {
      constantPoolEntry = constantPool.decodeEntry(this.outerClassNameIndex);
      if (constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Class) {
        throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY);
      }
      this.outerClassName = constantPoolEntry.getClassInfoName();
    }
    if (this.innerNameIndex != 0) {
      constantPoolEntry = constantPool.decodeEntry(this.innerNameIndex);
      if (constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Utf8) {
        throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY);
      }
      this.innerName = constantPoolEntry.getUtf8Value();
    }
  }
View Full Code Here

      for (int i = 0; i < length; i++) {
        int nameIndex = u2At(classFileBytes, 0, readOffset);
        int mask = u2At(classFileBytes, 2, readOffset);
        readOffset += 4;
        if (nameIndex != 0) {
          IConstantPoolEntry constantPoolEntry = constantPool.decodeEntry(nameIndex);
          if (constantPoolEntry.getKind() != IConstantPoolConstant.CONSTANT_Utf8) {
            throw new ClassFormatException(ClassFormatException.INVALID_CONSTANT_POOL_ENTRY);
          }
          this.names[i] = constantPoolEntry.getUtf8Value();
        } else {
          this.names[i] = null;
        }
        this.accessFlags[i] = (short) (mask & 0xFFFF);
      }
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.core.util.IConstantPoolEntry

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.