Source code

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