    001/*
    002 * Licensed to the Apache Software Foundation (ASF) under one or more
    003 * contributor license agreements.  See the NOTICE file distributed with
    004 * this work for additional information regarding copyright ownership.
    005 * The ASF licenses this file to You under the Apache License, Version 2.0
    006 * (the "License"); you may not use this file except in compliance with
    007 * the License.  You may obtain a copy of the License at
    008 *
    009 *      http://www.apache.org/licenses/LICENSE-2.0
    010 *
    011 *  Unless required by applicable law or agreed to in writing, software
    012 *  distributed under the License is distributed on an "AS IS" BASIS,
    013 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    014 *  See the License for the specific language governing permissions and
    015 *  limitations under the License.
    016 *
    017 */
    018package org.apache.bcel.classfile;
    019
    020import java.io.DataInput;
    021import java.io.DataOutputStream;
    022import java.io.IOException;
    023
    024import org.apache.bcel.Const;
    025
    026/**
    027 * represents an annotation that is represented in the class file and is
    028 * provided to the JVM.
    029 *
    030 * @version $Id: RuntimeVisibleAnnotations
    031 * @since 6.0
    032 */
    033public class RuntimeVisibleAnnotations extends Annotations
    034{
    035    /**
    036     * @param name_index
    037     *            Index pointing to the name <em>Code</em>
    038     * @param length
    039     *            Content length in bytes
    040     * @param input
    041     *            Input stream
    042     * @param constant_pool
    043     *            Array of constants
    044     */
    045    public RuntimeVisibleAnnotations(final int name_index, final int length, final DataInput input, final ConstantPool constant_pool) throws IOException
    046    {
    047        super(Const.ATTR_RUNTIME_VISIBLE_ANNOTATIONS, name_index, length, input, constant_pool, true);
    048    }
    049
    050    /**
    051     * @return deep copy of this attribute
    052     */
    053    @Override
    054    public Attribute copy(final ConstantPool constant_pool)
    055    {
    056        return (Attribute) clone();
    057    }
    058
    059    @Override
    060    public final void dump(final DataOutputStream dos) throws IOException
    061    {
    062        super.dump(dos);
    063        writeAnnotations(dos);
    064    }
    065}