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