org.aspectj.weaver.bcel
Class FakeAnnotation

java.lang.Object
  extended by org.aspectj.apache.bcel.classfile.annotation.AnnotationGen
      extended by org.aspectj.weaver.bcel.FakeAnnotation

public class FakeAnnotation
extends AnnotationGen

For implementing declare @type interacting with declare @parents during compilation - we need to be able to add an annotation to 'binary type binding' (this is how types are seen during incremental compilation). Unlike a SourceTypeBinding - a BinaryTypeBinding does not allow easy interaction with its annotations - so what we do is take the eclipse annotation, suck out the name/signature and visibility and put that information in a 'FakeAnnotation'. The FakeAnnotation is attached to the BCEL delegate for the binary type binding - this will allow type resolution to succeed correctly. The FakeAnnotation never makes it to disk, since the weaver does the job properly, attaching a real annotation.


Field Summary
 
Fields inherited from class org.aspectj.apache.bcel.classfile.annotation.AnnotationGen
NO_ANNOTATIONS
 
Constructor Summary
FakeAnnotation(java.lang.String name, java.lang.String sig, boolean isRuntimeVisible)
           
 
Method Summary
 void addElementNameValuePair(NameValuePair evp)
           
 void dump(java.io.DataOutputStream dos)
           
 int getTypeIndex()
           
 java.lang.String getTypeName()
           
 java.lang.String getTypeSignature()
           
 java.util.List getValues()
           
 boolean isRuntimeVisible()
           
protected  void setIsRuntimeVisible(boolean b)
           
 java.lang.String toShortString()
           
 java.lang.String toString()
           
 
Methods inherited from class org.aspectj.apache.bcel.classfile.annotation.AnnotationGen
hasNamedValue, hasNameValuePair, read
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FakeAnnotation

public FakeAnnotation(java.lang.String name,
                      java.lang.String sig,
                      boolean isRuntimeVisible)
Method Detail

getTypeName

public java.lang.String getTypeName()
Overrides:
getTypeName in class AnnotationGen

getTypeSignature

public java.lang.String getTypeSignature()
Overrides:
getTypeSignature in class AnnotationGen

addElementNameValuePair

public void addElementNameValuePair(NameValuePair evp)
Overrides:
addElementNameValuePair in class AnnotationGen

dump

public void dump(java.io.DataOutputStream dos)
          throws java.io.IOException
Overrides:
dump in class AnnotationGen
Throws:
java.io.IOException

getTypeIndex

public int getTypeIndex()
Overrides:
getTypeIndex in class AnnotationGen

getValues

public java.util.List getValues()
Overrides:
getValues in class AnnotationGen

isRuntimeVisible

public boolean isRuntimeVisible()
Overrides:
isRuntimeVisible in class AnnotationGen

setIsRuntimeVisible

protected void setIsRuntimeVisible(boolean b)

toShortString

public java.lang.String toShortString()
Overrides:
toShortString in class AnnotationGen

toString

public java.lang.String toString()
Overrides:
toString in class AnnotationGen