Esempio n. 1
0
  /**
   * Creates the children elements for this class file adding the resulting new handles and info
   * objects to the newElements table. Returns true if successful, or false if an error is
   * encountered parsing the class file.
   *
   * @see Openable
   * @see Signature
   */
  protected boolean buildStructure(
      OpenableElementInfo info, IProgressMonitor pm, Map newElements, IResource underlyingResource)
      throws JavaModelException {
    IBinaryType typeInfo = getBinaryTypeInfo((IFile) underlyingResource);
    if (typeInfo == null) {
      // The structure of a class file is unknown if a class file format errors occurred
      // during the creation of the diet class file representative of this ClassFile.
      info.setChildren(new IJavaElement[] {});
      return false;
    }

    // Make the type
    IType type = getType();
    info.setChildren(new IJavaElement[] {type});
    newElements.put(type, typeInfo);

    // Read children
    ((ClassFileInfo) info).readBinaryChildren(this, (HashMap) newElements, typeInfo);

    return true;
  }