org.springframework.roo.classpath.details.annotations
Class AnnotatedJavaType

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

public final class AnnotatedJavaType
extends Object

Represents a JavaType with zero or more annotations.

Since:
1.0
Author:
Ben Alex

Constructor Summary
AnnotatedJavaType(org.springframework.roo.model.JavaType javaType, List<AnnotationMetadata> annotations)
          Constructs an AnnotatedJavaType.
 
Method Summary
static List<org.springframework.roo.model.JavaType> convertFromAnnotatedJavaTypes(List<AnnotatedJavaType> annotatedJavaTypes)
          Converts a non-null List of AnnotatedJavaTypess into a List of equivalent JavaTypes.
static List<AnnotatedJavaType> convertFromJavaTypes(List<org.springframework.roo.model.JavaType> javaTypes)
          Converts a non-null List of JavaTypess into a List of equivalent AnnotatedJavaTypes.
 List<AnnotationMetadata> getAnnotations()
           
 org.springframework.roo.model.JavaType getJavaType()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AnnotatedJavaType

public AnnotatedJavaType(org.springframework.roo.model.JavaType javaType,
                         List<AnnotationMetadata> annotations)
Constructs an AnnotatedJavaType.

Parameters:
javaType - the type (required)
annotations - any annotations for the type (null is acceptable)
Method Detail

getJavaType

public org.springframework.roo.model.JavaType getJavaType()
Returns:
the type (never returns null)

getAnnotations

public List<AnnotationMetadata> getAnnotations()
Returns:
the annotations (never returns null, but may return an empty list)

toString

public final String toString()
Overrides:
toString in class Object

convertFromJavaTypes

public static List<AnnotatedJavaType> convertFromJavaTypes(List<org.springframework.roo.model.JavaType> javaTypes)
Converts a non-null List of JavaTypess into a List of equivalent AnnotatedJavaTypes. Note that each returned AnnotatedJavaType will have no annotation metadata, as the input JavaTypes cannot store any such metadata.

Parameters:
javaTypes - to convert (required)
Returns:
the equivalent AnnotatedJavaTypes (never returns null)

convertFromAnnotatedJavaTypes

public static List<org.springframework.roo.model.JavaType> convertFromAnnotatedJavaTypes(List<AnnotatedJavaType> annotatedJavaTypes)
Converts a non-null List of AnnotatedJavaTypess into a List of equivalent JavaTypes. Note the annotation metadata will be discarded, as it cannot be stored inside a JavaType.

Parameters:
annotatedJavaTypes - to convert (required)
Returns:
the equivalent AnnotatedJavaTypes, but without any actual annotations (never returns null)


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