JML

org.multijava.util.classfile
Class RuntimeVisibleParameterAnnotationsAttribute

java.lang.Object
  extended byorg.multijava.util.classfile.Attribute
      extended byorg.multijava.util.classfile.RuntimeVisibleParameterAnnotationsAttribute

public class RuntimeVisibleParameterAnnotationsAttribute
extends Attribute

A class representing a RuntimeVisibleParameterAnnotations attribute. VMS 4.8.16

Author:
AHS

Field Summary
private  ArrayList[] annotations
          the parameter annotations
private static AsciiConstant attr
           
(package private) static String tagString
           
 
Constructor Summary
RuntimeVisibleParameterAnnotationsAttribute(DataInput in, ConstantPool cp)
          Constructs a RuntimeVisibleParameterAnnotations attribute from a classfile stream.
RuntimeVisibleParameterAnnotationsAttribute(ArrayList[] annotations)
          Create a new RuntimeVisibleParameterAnnotations attribute for a given array of annotations.
 
Method Summary
 Annotation get(int param, String name)
          Return the annotation of a given type for the specified parameter given by its index, or null if no such annotation has been attached to the parameter.
 int getParameterCount()
          Get the number of parameters as given in this attribute.
protected  int getSize()
          Return the space in bytes used by this attribute in the classfile.
protected  int getTag()
          Return the attribute's tag.
protected  void resolveConstants(ConstantPool cp)
          Insert or check location of constant value on constant pool.
protected  void write(ConstantPool cp, DataOutput out)
          Write this attribute into the file (out) getting data position from the constant pool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tagString

static final String tagString

attr

private static AsciiConstant attr

annotations

private ArrayList[] annotations
the parameter annotations

Constructor Detail

RuntimeVisibleParameterAnnotationsAttribute

public RuntimeVisibleParameterAnnotationsAttribute(ArrayList[] annotations)
Create a new RuntimeVisibleParameterAnnotations attribute for a given array of annotations. Every i-th element of the array is a list of annotations for the i-th parameter. The number of parameters is equal to the length of the array.

Parameters:
annotations - parameter annotations, reference is captured

RuntimeVisibleParameterAnnotationsAttribute

public RuntimeVisibleParameterAnnotationsAttribute(DataInput in,
                                                   ConstantPool cp)
                                            throws IOException,
                                                   ClassFileFormatException
Constructs a RuntimeVisibleParameterAnnotations attribute from a classfile stream.

Parameters:
in - the stream to read from
cp - the constant pool
Throws:
IOException - an IO problem has occured
ClassFileFormatException - the classfile is malformed
Method Detail

getParameterCount

public int getParameterCount()
Get the number of parameters as given in this attribute.


get

public Annotation get(int param,
                      String name)
Return the annotation of a given type for the specified parameter given by its index, or null if no such annotation has been attached to the parameter.

Parameters:
param - the index of the desired parameter
name - the name of the annotation (i.e. the interface type)

getTag

protected int getTag()
Return the attribute's tag.


getSize

protected int getSize()
Return the space in bytes used by this attribute in the classfile.


resolveConstants

protected void resolveConstants(ConstantPool cp)
                         throws ClassFileFormatException
Insert or check location of constant value on constant pool.

Parameters:
cp - the constant pool for this class
Throws:
ClassFileFormatException

write

protected void write(ConstantPool cp,
                     DataOutput out)
              throws IOException
Write this attribute into the file (out) getting data position from the constant pool.

Parameters:
cp - the constant pool that contain all data
out - the file where to write this object info
Throws:
IOException - an io problem has occured

JML

JML is Copyright (C) 1998-2002 by Iowa State University and is distributed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This release depends on code from the MultiJava project and is based in part on the Kopi project Copyright (C) 1990-99 DMS Decision Management Systems Ges.m.b.H.