net.sf.daileon.notsupported
Class AbstractTemplateAnnotationsCollector

java.lang.Object
  extended by org.objectweb.asm.ClassAdapter
      extended by net.sf.daileon.notsupported.AbstractTemplateAnnotationsCollector
All Implemented Interfaces:
org.objectweb.asm.ClassVisitor
Direct Known Subclasses:
EquivalentAnnotationsCollector, TemplateAnnotationsCollector

abstract class AbstractTemplateAnnotationsCollector
extends org.objectweb.asm.ClassAdapter

The AbstractTemplateAnnotationsCollector class is responsible for collecting the annotations of the elements indicated in template annotations, such as FieldTemplate or MethodTemplate.

Version:
1.0 01/01/2010
Author:
Roberto Perillo

Field Summary
private  org.objectweb.asm.attrs.RuntimeVisibleAnnotations annotations
          The element that keeps the annotations that are collected from a particular element, which is indicated in a template annotation
private static String DOCUMENTED
          The fully-qualified name of the Documented annotation
private static String DOMAIN_ANNOTATION
          The fully-qualified name of the DomainAnnotation annotation
private static String RETENTION
          The fully-qualified name of the Retention annotation
private static String TARGET
          The fully-qualified name of the Target annotation
 
Fields inherited from class org.objectweb.asm.ClassAdapter
cv
 
Constructor Summary
AbstractTemplateAnnotationsCollector(org.objectweb.asm.ClassVisitor classVisitor)
          Class constructor.
 
Method Summary
(package private)  void collectAnnotations(org.objectweb.asm.Attribute attribute)
          Collects the annotations of a given Attribute, which can contain one or several annotations.
(package private)  org.objectweb.asm.attrs.RuntimeVisibleAnnotations getAnnotations()
          Gets the object that keeps the annotations indicated in a class or class element of a template annotation.
private  boolean isValidAnnotation(org.objectweb.asm.attrs.Annotation annotation)
          Informs whether an annotation is valid or not.
(package private)  void setAnnotations(org.objectweb.asm.attrs.RuntimeVisibleAnnotations annotations)
          Sets the object that keeps the annotations indicated in a class or class element of a template annotation.
 
Methods inherited from class org.objectweb.asm.ClassAdapter
visit, visitAttribute, visitEnd, visitField, visitInnerClass, visitMethod
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DOCUMENTED

private static final String DOCUMENTED
The fully-qualified name of the Documented annotation

See Also:
Constant Field Values

RETENTION

private static final String RETENTION
The fully-qualified name of the Retention annotation

See Also:
Constant Field Values

TARGET

private static final String TARGET
The fully-qualified name of the Target annotation

See Also:
Constant Field Values

DOMAIN_ANNOTATION

private static final String DOMAIN_ANNOTATION
The fully-qualified name of the DomainAnnotation annotation

See Also:
Constant Field Values

annotations

private org.objectweb.asm.attrs.RuntimeVisibleAnnotations annotations
The element that keeps the annotations that are collected from a particular element, which is indicated in a template annotation

Constructor Detail

AbstractTemplateAnnotationsCollector

AbstractTemplateAnnotationsCollector(org.objectweb.asm.ClassVisitor classVisitor)
Class constructor.

Parameters:
classVisitor - The ClassVisitor object that visits the class.
Method Detail

getAnnotations

org.objectweb.asm.attrs.RuntimeVisibleAnnotations getAnnotations()
Gets the object that keeps the annotations indicated in a class or class element of a template annotation.

Returns:
The object that keeps the annotations indicated in a class or class element of a template annotation.

setAnnotations

void setAnnotations(org.objectweb.asm.attrs.RuntimeVisibleAnnotations annotations)
Sets the object that keeps the annotations indicated in a class or class element of a template annotation.

Parameters:
annotations - The object that keeps the annotations indicated in a class or class element of a template annotation.

collectAnnotations

void collectAnnotations(org.objectweb.asm.Attribute attribute)
Collects the annotations of a given Attribute, which can contain one or several annotations.

Parameters:
attribute - The Attribute object, containing one or several annotations to be collected. This object always corresponds to the annotations of an element indicated in a template annotation.

isValidAnnotation

private boolean isValidAnnotation(org.objectweb.asm.attrs.Annotation annotation)
Informs whether an annotation is valid or not. If it is the Documented, or Retention, or Target or DomainAnnotation, then it is not valid.

Parameters:
annotation - The Annotation object to be verified.
Returns:
A boolean value that can be:
  • true if the annotation is valid;
  • false if the annotation is not valid.