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
protected AbstractAnnotationValues(MemberHoldingTypeDetails memberHoldingTypeDetails, org.springframework.roo.model.JavaType annotationType)
           
protected AbstractAnnotationValues(MemberHoldingTypeDetailsMetadataItem<?> governorMetadata, Class<?> annotationType)
          Convenience constructor that takes a Class for the annotation type
protected AbstractAnnotationValues(MemberHoldingTypeDetailsMetadataItem<?> governorMetadata, org.springframework.roo.model.JavaType annotationType)
          Parses the governor's metadata 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

annotationMetadata

protected AnnotationMetadata annotationMetadata

classParsed

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


governorTypeDetails

protected ClassOrInterfaceTypeDetails governorTypeDetails
Constructor Detail

AbstractAnnotationValues

protected AbstractAnnotationValues(MemberHoldingTypeDetails memberHoldingTypeDetails,
                                   org.springframework.roo.model.JavaType annotationType)

AbstractAnnotationValues

protected AbstractAnnotationValues(MemberHoldingTypeDetailsMetadataItem<?> governorMetadata,
                                   Class<?> annotationType)
Convenience constructor that takes a Class for the annotation type

Parameters:
governorMetadata - to parse (can be null)
annotationType - the annotation class (required)

AbstractAnnotationValues

protected AbstractAnnotationValues(MemberHoldingTypeDetailsMetadataItem<?> governorMetadata,
                                   org.springframework.roo.model.JavaType annotationType)
Parses the governor's metadata 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:
governorMetadata - to parse (can be null)
annotationType - to locate and parse (can be null)
Method Detail

getGovernorTypeDetails

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

isAnnotationFound

public boolean isAnnotationFound()

isClassParsed

public boolean isClassParsed()


Copyright © 2009–2015. All rights reserved.