atjava.lang.annotation
Class AnnotatedExpression

java.lang.Object
  extended by atjava.lang.annotation.AnnotatedExpression

public class AnnotatedExpression
extends java.lang.Object

This class represents a part of code annotated by an Expression Annotation.

In this example:
@MyExpressionAnnotation("Assignement"){a=1}
the associated ExpressionAnnotation will allow you to retrieve:


Method Summary
 boolean areExpressionAnnotationsPresent()
          Returns true if there are AnnotatedExpressions nested in the AnnotatedExpressions
 boolean areExpressionAnnotationsPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
          Returns true if there are AnnotatedExpressions nested in the AnnotatedExpression having the specified type.
 boolean areExpressionAnnotationsPresentAtSomeLevel(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
          Returns true if there are ExpressionAnnotations nested in the ExpressionAnnotation having the specified type.
 int endSourceColumn()
          The column number in the source code where the annotation ends
 int endSourceLine()
          The line number in the source code where the annotation ends
 AnnotatedExpression[] getAnnotatedExpressions()
          Returns all the AnnotatedExpressions that appears in the AnnotatedExpression (if any)
 AnnotatedExpression[] getAnnotatedExpressions(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
          Returns all the AnnotatedExpressions that appears in the AnnotatedExpression (if any) having the specified type.
 java.lang.annotation.Annotation getAnnotation()
          Returns the annotation associated with the AnnotatedExpression
 java.lang.String getAnnotationType()
          Returns the type of the annotation of this AnnotatedExpression
 java.lang.String getBodySourceCode()
          Returns the source code associated with the AnnotatedExpression
 byte[] getBytecode()
          Returns the bytecode associated with the AnnotatedExpression
 java.lang.annotation.Annotation[] getExpressionAnnotations()
          Returns all the Annotations applied to the AnnotatedExpressions that appears in the AnnotatedExpression (if any).
<T extends java.lang.annotation.Annotation>
T[]
getExpressionAnnotations(java.lang.Class<T> annotationClass)
          Returns all the Annotations applied to the AnnotatedExpressions that appears in the AnnotatedExpression (if any) having the specified type
Only the AnnotatedExpressions at level 0 (that is, not the nested ones) are taken in consideration.
 int getLevel()
          Returns the level of this AnnotatedExpression
 java.lang.String getSourceCode()
          Returns the source code associated with the AnnotatedExpression
 int startSourceColumn()
          The column number in the source code where the annotation begins
 int startSourceLine()
          The line number in the source code where the annotation begins
 java.lang.String toBinBytecodeString()
          Converts the AnnotatedExpression to a String containing the binary representation of the bytecode annotated
 java.lang.String toHexBytecodeString()
          Converts the AnnotatedExpression to a String containing the hexadecimal representation of the bytecode annotated
 java.lang.String toIntBytecodeString()
          Converts the AnnotatedExpression to a String containing the decimal representation of the bytecode annotated
 java.lang.String toString()
          Converts the AnnotatedExpression to a String
 java.lang.String toStringWithInnerAnnotatedExpression()
          Converts the AnnotatedBlock to a String including the list of the Expression Annotation that it contains (if any)
 java.lang.String toSymBytecodeString()
          Converts the AnnotatedExpression to a String containing the symbolic representation of the bytecode annotated
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

startSourceLine

public int startSourceLine()
The line number in the source code where the annotation begins


startSourceColumn

public int startSourceColumn()
The column number in the source code where the annotation begins


endSourceLine

public int endSourceLine()
The line number in the source code where the annotation ends


endSourceColumn

public int endSourceColumn()
The column number in the source code where the annotation ends


getExpressionAnnotations

public java.lang.annotation.Annotation[] getExpressionAnnotations()
Returns all the Annotations applied to the AnnotatedExpressions that appears in the AnnotatedExpression (if any).
Only the AnnotatedExpressions at level 0 (that is, not the nested ones) are taken in consideration.

Returns:
an array of Annotation

getExpressionAnnotations

public <T extends java.lang.annotation.Annotation> T[] getExpressionAnnotations(java.lang.Class<T> annotationClass)
Returns all the Annotations applied to the AnnotatedExpressions that appears in the AnnotatedExpression (if any) having the specified type
Only the AnnotatedExpressions at level 0 (that is, not the nested ones) are taken in consideration.

Returns:
an array of annotation of type T

areExpressionAnnotationsPresent

public boolean areExpressionAnnotationsPresent()
Returns true if there are AnnotatedExpressions nested in the AnnotatedExpressions


areExpressionAnnotationsPresent

public boolean areExpressionAnnotationsPresent(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
Returns true if there are AnnotatedExpressions nested in the AnnotatedExpression having the specified type.
Only the AnnotatedExpressions at level 0 (that is, not the nested ones) are taken in consideration.

Parameters:
annotationClass - the desired type of Annotation

areExpressionAnnotationsPresentAtSomeLevel

public boolean areExpressionAnnotationsPresentAtSomeLevel(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
Returns true if there are ExpressionAnnotations nested in the ExpressionAnnotation having the specified type.
ExpressionAnnotation at any level are taken in consideration (that is, nested ExpressionAnnotation too).

Parameters:
annotationClass - the desired type of Annotation

getAnnotatedExpressions

public AnnotatedExpression[] getAnnotatedExpressions()
Returns all the AnnotatedExpressions that appears in the AnnotatedExpression (if any)

Returns:
an array of AnnotatedExpression

getAnnotatedExpressions

public AnnotatedExpression[] getAnnotatedExpressions(java.lang.Class<? extends java.lang.annotation.Annotation> annotationClass)
Returns all the AnnotatedExpressions that appears in the AnnotatedExpression (if any) having the specified type.

Parameters:
annotationClass - the desired type of Annotation
Returns:
an array of AnnotatedBlocks

getBytecode

public byte[] getBytecode()
Returns the bytecode associated with the AnnotatedExpression

Returns:
A byte array representing the bytecode

getAnnotation

public java.lang.annotation.Annotation getAnnotation()
Returns the annotation associated with the AnnotatedExpression

Returns:
the annotation associated with the AnnotatedExpression

getSourceCode

public java.lang.String getSourceCode()
                               throws SourceNotAvailableException,
                                      InvalidReferenceException
Returns the source code associated with the AnnotatedExpression


getBodySourceCode

public java.lang.String getBodySourceCode()
                                   throws SourceNotAvailableException,
                                          InvalidReferenceException
Returns the source code associated with the AnnotatedExpression

Returns:
A string representing the source code
Throws:
SourceNotAvailableException
InvalidReferenceException

getLevel

public int getLevel()
Returns the level of this AnnotatedExpression

Returns:
the level of this AnnotatedExpression

getAnnotationType

public java.lang.String getAnnotationType()
Returns the type of the annotation of this AnnotatedExpression

Returns:
the type of the annotation

toString

public java.lang.String toString()
Converts the AnnotatedExpression to a String

Overrides:
toString in class java.lang.Object
Returns:
a string representation of the object.

toStringWithInnerAnnotatedExpression

public java.lang.String toStringWithInnerAnnotatedExpression()
Converts the AnnotatedBlock to a String including the list of the Expression Annotation that it contains (if any)


toBinBytecodeString

public java.lang.String toBinBytecodeString()
Converts the AnnotatedExpression to a String containing the binary representation of the bytecode annotated


toIntBytecodeString

public java.lang.String toIntBytecodeString()
Converts the AnnotatedExpression to a String containing the decimal representation of the bytecode annotated


toHexBytecodeString

public java.lang.String toHexBytecodeString()
Converts the AnnotatedExpression to a String containing the hexadecimal representation of the bytecode annotated


toSymBytecodeString

public java.lang.String toSymBytecodeString()
Converts the AnnotatedExpression to a String containing the symbolic representation of the bytecode annotated