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 /** 26 * Unknown (non-standard) attributes may be read via user-defined factory 27 * objects that can be registered with the Attribute.addAttributeReader 28 * method. These factory objects should implement this interface. 29 30 * @see Attribute 31 * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A> 32 */ 33 public interface AttributeReader { 34 /** 35 When this attribute reader is added via the static method 36 Attribute.addAttributeReader, an attribute name is associated with it. 37 As the class file parser parses attributes, it will call various 38 AttributeReaders based on the name of the attributes it is 39 constructing. 40 41 @param name_index An index into the constant pool, indexing a 42 ConstantUtf8 that represents the name of the attribute. 43 44 @param length The length of the data contained in the attribute. This 45 is written into the constant pool and should agree with what the 46 factory expects the length to be. 47 48 @param file This is the data input stream that the factory needs to read 49 its data from. 50 51 @param constant_pool This is the constant pool associated with the 52 Attribute that we are constructing. 53 54 @return The user-defined AttributeReader should take this data and use 55 it to construct an attribute. In the case of errors, a null can be 56 returned which will cause the parsing of the class file to fail. 57 58 @see Attribute#addAttributeReader( String, AttributeReader ) 59 */ 60 public Attribute createAttribute(int name_index, 61 int length, 62 java.io.DataInputStream file, 63 ConstantPool constant_pool); 64 } | 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 * @version $Id: AttributeReader.java 1748467 2016-06-14 21:05:14Z ggregory $ 31 * 32 * @deprecated Use UnknownAttributeReader instead 33 */ 34 @java.lang.Deprecated 35 public interface AttributeReader { 36 37 /** 38 When this attribute reader is added via the static method 39 Attribute.addAttributeReader, an attribute name is associated with it. 40 As the class file parser parses attributes, it will call various 41 AttributeReaders based on the name of the attributes it is 42 constructing. 43 44 @param name_index An index into the constant pool, indexing a 45 ConstantUtf8 that represents the name of the attribute. 46 47 @param length The length of the data contained in the attribute. This 48 is written into the constant pool and should agree with what the 49 factory expects the length to be. 50 51 @param file This is the data input stream that the factory needs to read 52 its data from. 53 54 @param constant_pool This is the constant pool associated with the 55 Attribute that we are constructing. 56 57 @return The user-defined AttributeReader should take this data and use 58 it to construct an attribute. In the case of errors, a null can be 59 returned which will cause the parsing of the class file to fail. 60 61 @see Attribute#addAttributeReader( String, AttributeReader ) 62 */ 63 Attribute createAttribute( int name_index, int length, java.io.DataInputStream file, ConstantPool constant_pool ); 64 } |