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

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

public 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, AnnotationMetadata... annotations)
          Constructor that accepts a vararg array of annotations
AnnotatedJavaType(org.springframework.roo.model.JavaType javaType, Collection<AnnotationMetadata> annotations)
          Constructor that accepts an optional list of annotations
 
Method Summary
static org.springframework.roo.model.JavaType convertFromAnnotatedJavaType(AnnotatedJavaType annotatedJavaType)
          Converts a non-null AnnotatedJavaType into an equivalent JavaType.
static List<org.springframework.roo.model.JavaType> convertFromAnnotatedJavaTypes(List<AnnotatedJavaType> annotatedJavaTypes)
          Converts a non-null List of AnnotatedJavaTypes into a List of equivalent JavaTypes.
static AnnotatedJavaType convertFromJavaType(org.springframework.roo.model.JavaType javaType)
          Converts a JavaType into an equivalent AnnotatedJavaType.
static List<AnnotatedJavaType> convertFromJavaTypes(Iterable<? extends org.springframework.roo.model.JavaType> javaTypes)
          Converts a non-null bag of JavaTypes into a List of equivalent AnnotatedJavaTypes.
static List<AnnotatedJavaType> convertFromJavaTypes(org.springframework.roo.model.JavaType... javaTypes)
          Converts a non-null bag of JavaTypes into a List of equivalent AnnotatedJavaTypes.
 List<AnnotationMetadata> getAnnotations()
          Returns the annotations on this type
 org.springframework.roo.model.JavaType getJavaType()
           
 boolean isVarArgs()
           
 void setVarArgs(boolean varArgs)
           
 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,
                         AnnotationMetadata... annotations)
Constructor that accepts a vararg array of annotations

Parameters:
javaType - the type (required)
annotations - can be none
Since:
1.2.0

AnnotatedJavaType

public AnnotatedJavaType(org.springframework.roo.model.JavaType javaType,
                         Collection<AnnotationMetadata> annotations)
Constructor that accepts an optional list of annotations

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

convertFromAnnotatedJavaType

public static org.springframework.roo.model.JavaType convertFromAnnotatedJavaType(AnnotatedJavaType annotatedJavaType)
Converts a non-null AnnotatedJavaType into an equivalent JavaType. Note the annotation metadata will be discarded, as it cannot be stored inside a JavaType.

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

convertFromAnnotatedJavaTypes

public static List<org.springframework.roo.model.JavaType> convertFromAnnotatedJavaTypes(List<AnnotatedJavaType> annotatedJavaTypes)
Converts a non-null List of AnnotatedJavaTypes 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)

convertFromJavaType

public static AnnotatedJavaType convertFromJavaType(org.springframework.roo.model.JavaType javaType)
Converts a JavaType into an equivalent AnnotatedJavaType. Note that each returned AnnotatedJavaTypewill have no annotation metadata, as the input JavaType cannot store any such metadata.

Parameters:
javaType - to convert (required)
Returns:
the equivalent AnnotatedJavaType (never returns null)

convertFromJavaTypes

public static List<AnnotatedJavaType> convertFromJavaTypes(Iterable<? extends org.springframework.roo.model.JavaType> javaTypes)
Converts a non-null bag of JavaTypes 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 (can be null for none)
Returns:
the equivalent AnnotatedJavaTypes (never returns null)

convertFromJavaTypes

public static List<AnnotatedJavaType> convertFromJavaTypes(org.springframework.roo.model.JavaType... javaTypes)
Converts a non-null bag of JavaTypes 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
Returns:
the equivalent AnnotatedJavaTypes (never returns null)
Since:
1.2.0

getAnnotations

public List<AnnotationMetadata> getAnnotations()
Returns the annotations on this type

Returns:
a copy of this list (never null, but may be empty)

getJavaType

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

isVarArgs

public boolean isVarArgs()

setVarArgs

public void setVarArgs(boolean varArgs)

toString

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


Copyright © 2009–2015. All rights reserved.