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 provided to the JVM.
028 *
029 * @since 6.0
030 */
031public class RuntimeVisibleAnnotations extends Annotations {
032    /**
033     * @param name_index Index pointing to the name <em>Code</em>
034     * @param length Content length in bytes
035     * @param input Input stream
036     * @param constant_pool Array of constants
037     */
038    public RuntimeVisibleAnnotations(final int name_index, final int length, final DataInput input, final ConstantPool constant_pool) throws IOException {
039        super(Const.ATTR_RUNTIME_VISIBLE_ANNOTATIONS, name_index, length, input, constant_pool, true);
040    }
041
042    /**
043     * @return deep copy of this attribute
044     */
045    @Override
046    public Attribute copy(final ConstantPool constant_pool) {
047        return (Attribute) clone();
048    }
049
050    @Override
051    public final void dump(final DataOutputStream dos) throws IOException {
052        super.dump(dos);
053        writeAnnotations(dos);
054    }
055}