1 /*
   2  * reserved comment block
   3  * DO NOT REMOVE OR ALTER!
   4  */
   5 /*
   6  * Licensed to the Apache Software Foundation (ASF) under one or more
   7  * contributor license agreements.  See the NOTICE file distributed with
   8  * this work for additional information regarding copyright ownership.
   9  * The ASF licenses this file to You under the Apache License, Version 2.0
  10  * (the "License"); you may not use this file except in compliance with
  11  * the License.  You may obtain a copy of the License at
  12  *
  13  *      http://www.apache.org/licenses/LICENSE-2.0
  14  *
  15  * Unless required by applicable law or agreed to in writing, software
  16  * distributed under the License is distributed on an "AS IS" BASIS,
  17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  18  * See the License for the specific language governing permissions and
  19  * limitations under the License.
  20  */
  21 
  22 package com.sun.org.apache.bcel.internal.classfile;
  23 
  24 /**
  25  * Unknown (non-standard) attributes may be read via user-defined factory
  26  * objects that can be registered with the Attribute.addAttributeReader
  27  * method. These factory objects should implement this interface.
  28 
  29  * @see Attribute
  30  *
  31  * @deprecated Use UnknownAttributeReader instead
  32  */
  33 @java.lang.Deprecated
  34 public interface AttributeReader {
  35 
  36     /**
  37      When this attribute reader is added via the static method
  38      Attribute.addAttributeReader, an attribute name is associated with it.
  39      As the class file parser parses attributes, it will call various
  40      AttributeReaders based on the name of the attributes it is
  41      constructing.
  42 
  43      @param name_index An index into the constant pool, indexing a
  44      ConstantUtf8 that represents the name of the attribute.
  45 
  46      @param length The length of the data contained in the attribute.  This
  47      is written into the constant pool and should agree with what the
  48      factory expects the length to be.
  49 
  50      @param file This is the data input stream that the factory needs to read
  51      its data from.
  52 
  53      @param constant_pool This is the constant pool associated with the
  54      Attribute that we are constructing.
  55 
  56      @return The user-defined AttributeReader should take this data and use
  57      it to construct an attribute.  In the case of errors, a null can be
  58      returned which will cause the parsing of the class file to fail.
  59 
  60      @see Attribute#addAttributeReader( String, AttributeReader )
  61      */
  62     Attribute createAttribute( int name_index, int length, java.io.DataInputStream file, ConstantPool constant_pool );
  63 }