AttributeReader (Apache Commons BCEL 6.6.1 API)

org.apache.bcel.classfile

## Interface AttributeReader

- Deprecated.
  Use UnknownAttributeReader instead

      @Deprecated
      public interface AttributeReader

  Unknown (non-standard) attributes may be read via user-defined factory objects that can be registered with the Attribute.addAttributeReader method. These factory objects should implement this interface.
  See Also:
    `Attribute`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `Attribute` | `createAttribute(int nameIndex, int length, DataInputStream file, ConstantPool constantPool)` Deprecated. When this attribute reader is added via the static method Attribute.addAttributeReader, an attribute name is associated with it.

- - ### Method Detail

    - #### createAttribute

          Attribute createAttribute(int nameIndex,
                                    int length,
                                    DataInputStream file,
                                    ConstantPool constantPool)

      Deprecated.
      When this attribute reader is added via the static method Attribute.addAttributeReader, an attribute name is associated with it. As the class file parser parses attributes, it will call various AttributeReaders based on the name of the attributes it is constructing.
      Parameters:
        `nameIndex` - An index into the constant pool, indexing a ConstantUtf8 that represents the name of the attribute.
        `length` - The length of the data contained in the attribute. This is written into the constant pool and should agree with what the factory expects the length to be.
        `file` - This is the data input stream that the factory needs to read its data from.
        `constantPool` - This is the constant pool associated with the Attribute that we are constructing.
      Returns:
        The user-defined AttributeReader should take this data and use it to construct an attribute. In the case of errors, a null can be returned which will cause the parsing of the class file to fail.
      See Also:
        `Attribute.addAttributeReader( String, AttributeReader )`

Copyright © 2004–2022 The Apache Software Foundation. All rights reserved.