org.springframework.roo.classpath.details.annotations.populator
Class AbstractAnnotationValues

java.lang.Object
  extended by org.springframework.roo.classpath.details.annotations.populator.AbstractAnnotationValues

public abstract class AbstractAnnotationValues
extends Object

Abstract class that provides a convenience parser and holder for annotation values. Useful if an add-on needs to share annotation parsing outcomes between its provider and metadata instances.

Since:
1.0
Author:
Ben Alex

Field Summary
protected  AnnotationMetadata annotationMetadata
           
protected  boolean classParsed
          Indicates whether the class was able to be parsed at all (ie the metadata was properly formed)
protected  ClassOrInterfaceTypeDetails governorTypeDetails
           
 
Constructor Summary
AbstractAnnotationValues(PhysicalTypeMetadata governorPhysicalTypeMetadata, org.springframework.roo.model.JavaType annotationType)
          Parses the PhysicalTypeMetadata for the requested annotation JavaType.
 
Method Summary
 ClassOrInterfaceTypeDetails getGovernorTypeDetails()
           
 boolean isAnnotationFound()
           
 boolean isClassParsed()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

classParsed

protected boolean classParsed
Indicates whether the class was able to be parsed at all (ie the metadata was properly formed)


annotationMetadata

protected AnnotationMetadata annotationMetadata

governorTypeDetails

protected ClassOrInterfaceTypeDetails governorTypeDetails
Constructor Detail

AbstractAnnotationValues

public AbstractAnnotationValues(PhysicalTypeMetadata governorPhysicalTypeMetadata,
                                org.springframework.roo.model.JavaType annotationType)
Parses the PhysicalTypeMetadata for the requested annotation JavaType. If found, makes the annotation available via the annotationMetadata field. Subclasses will then generally use AutoPopulationUtils.populate(Object, AnnotationMetadata) to complete the configuration of the subclass (we don't invoke AutoPopulationUtils from this constructor because the subclass is likely to have set default values for each field, and these will be overwritten when the control flow returns to the subclass constructor).

If the PhysicalTypeMetadata cannot be parsed or does not internally contain a ClassOrInterfaceTypeDetails, no attempt will be made to populate the values.

Parameters:
governorPhysicalTypeMetadata - to parse (required)
annotationType - to locate and parse (required)
Method Detail

getGovernorTypeDetails

public ClassOrInterfaceTypeDetails getGovernorTypeDetails()
Returns:
the type which declared the annotation (ie the governor; never returns null)

isClassParsed

public boolean isClassParsed()

isAnnotationFound

public boolean isAnnotationFound()


Copyright © 2009-2010 VMware, Inc. All Rights Reserved.