< prev index next >

src/java.xml/share/classes/com/sun/org/apache/bcel/internal/classfile/Annotations.java

Print this page




  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 import java.io.DataInput;
  25 import java.io.DataOutputStream;
  26 import java.io.IOException;
  27 
  28 /**
  29  * base class for annotations
  30  *
  31  * @version $Id: Annotations
  32  * @since 6.0
  33  */
  34 public abstract class Annotations extends Attribute {
  35 
  36     private AnnotationEntry[] annotation_table;
  37     private final boolean isRuntimeVisible;
  38 
  39     /**
  40      * @param annotation_type the subclass type of the annotation
  41      * @param name_index Index pointing to the name <em>Code</em>
  42      * @param length Content length in bytes
  43      * @param input Input stream
  44      * @param constant_pool Array of constants
  45      */
  46     Annotations(final byte annotation_type, final int name_index, final int length, final DataInput input,
  47             final ConstantPool constant_pool, final boolean isRuntimeVisible) throws IOException {
  48         this(annotation_type, name_index, length, (AnnotationEntry[]) null, constant_pool, isRuntimeVisible);
  49         final int annotation_table_length = input.readUnsignedShort();
  50         annotation_table = new AnnotationEntry[annotation_table_length];
  51         for (int i = 0; i < annotation_table_length; i++) {




  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 import java.io.DataInput;
  25 import java.io.DataOutputStream;
  26 import java.io.IOException;
  27 
  28 /**
  29  * base class for annotations
  30  *

  31  * @since 6.0
  32  */
  33 public abstract class Annotations extends Attribute {
  34 
  35     private AnnotationEntry[] annotation_table;
  36     private final boolean isRuntimeVisible;
  37 
  38     /**
  39      * @param annotation_type the subclass type of the annotation
  40      * @param name_index Index pointing to the name <em>Code</em>
  41      * @param length Content length in bytes
  42      * @param input Input stream
  43      * @param constant_pool Array of constants
  44      */
  45     Annotations(final byte annotation_type, final int name_index, final int length, final DataInput input,
  46             final ConstantPool constant_pool, final boolean isRuntimeVisible) throws IOException {
  47         this(annotation_type, name_index, length, (AnnotationEntry[]) null, constant_pool, isRuntimeVisible);
  48         final int annotation_table_length = input.readUnsignedShort();
  49         annotation_table = new AnnotationEntry[annotation_table_length];
  50         for (int i = 0; i < annotation_table_length; i++) {


< prev index next >