Errai 3.0.1-SNAPSHOT

org.jboss.errai.codegen.meta
Class MetaClass

java.lang.Object
  extended by org.jboss.errai.codegen.meta.MetaClass
All Implemented Interfaces:
HasAnnotations, MetaGenericDeclaration, MetaType
Direct Known Subclasses:
AbstractMetaClass

public abstract class MetaClass
extends Object
implements HasAnnotations, MetaType, MetaGenericDeclaration

Author:
Mike Brock

Constructor Summary
MetaClass()
           
 
Method Summary
abstract  MetaClass asArrayOf(int dimensions)
           
abstract  MetaClass asBoxed()
           
abstract  Class<?> asClass()
           
abstract  MetaClass asUnboxed()
           
abstract  BeanDescriptor getBeanDescriptor()
           
abstract  MetaConstructor getBestMatchingConstructor(Class... parameters)
           
abstract  MetaConstructor getBestMatchingConstructor(MetaClass... parameters)
           
abstract  MetaMethod getBestMatchingMethod(String name, Class... parameters)
           
abstract  MetaMethod getBestMatchingMethod(String name, MetaClass... parameters)
           
abstract  MetaMethod getBestMatchingStaticMethod(String name, Class... parameters)
           
abstract  MetaMethod getBestMatchingStaticMethod(String name, MetaClass... parameters)
           
abstract  String getCanonicalName()
           
abstract  MetaClass getComponentType()
           
abstract  MetaConstructor getConstructor(Class... parameters)
           
abstract  MetaConstructor getConstructor(MetaClass... parameters)
           
abstract  MetaConstructor[] getConstructors()
           
abstract  MetaClass[] getDeclaredClasses()
           
abstract  MetaConstructor getDeclaredConstructor(Class... parameters)
           
abstract  MetaConstructor[] getDeclaredConstructors()
           
abstract  MetaField getDeclaredField(String name)
           
abstract  MetaField[] getDeclaredFields()
           
abstract  MetaMethod getDeclaredMethod(String name, Class... parameters)
           
abstract  MetaMethod getDeclaredMethod(String name, MetaClass... parameters)
           
abstract  MetaMethod[] getDeclaredMethods()
           
abstract  MetaClass getErased()
          Returns a MetaClass that represents the same class as this one, but guaranteed to have no type parameters.
abstract  MetaField getField(String name)
           
abstract  MetaField[] getFields()
           
abstract  List<MetaField> getFieldsAnnotatedWith(Class<? extends Annotation> annotation)
          Returns all declared and inherited fields on this class that have the given annotation targeting them.
abstract  List<MetaField> getFieldsWithMetaAnnotations(Class<? extends Annotation> annotations)
           
abstract  String getFullyQualifiedName()
           
abstract  String getFullyQualifiedNameWithTypeParms()
           
abstract  MetaParameterizedType getGenericSuperClass()
           
abstract  MetaField getInheritedField(String name)
          Searches for the named field in this type, its superinterfaces, and its superclasses.
abstract  MetaClass[] getInterfaces()
           
abstract  String getInternalName()
           
abstract  MetaMethod getMethod(String name, Class... parameters)
           
abstract  MetaMethod getMethod(String name, MetaClass... parameters)
           
abstract  MetaMethod[] getMethods()
          Returns all declared and inherited public, protected, and package-private methods available on this class.
abstract  List<MetaMethod> getMethodsAnnotatedWith(Class<? extends Annotation> annotation)
          Returns all declared and inherited methods on this class that have the given annotation targeting them.
abstract  List<MetaMethod> getMethodsWithMetaAnnotations(Class<? extends Annotation> annotation)
           
abstract  String getName()
          Returns the name of this type as it was written in the original source code.
abstract  MetaClass getOuterComponentType()
           
abstract  String getPackageName()
           
abstract  MetaParameterizedType getParameterizedType()
           
abstract  List<MetaParameter> getParametersAnnotatedWith(Class<? extends Annotation> annotation)
           
abstract  MetaClass getSuperClass()
           
abstract  boolean isAbstract()
           
abstract  boolean isAnnotation()
           
abstract  boolean isAnonymousClass()
           
abstract  boolean isArray()
           
abstract  boolean isAssignableFrom(Class clazz)
          Reports if the type represented by this MetaClass is a supertype of (or the same class as) the given class.
abstract  boolean isAssignableFrom(MetaClass clazz)
          Reports if the type represented by this MetaClass is a supertype of (or the same class as) the type represented by the given MetaClass.
abstract  boolean isAssignableTo(Class clazz)
           
abstract  boolean isAssignableTo(MetaClass clazz)
           
 boolean isConcrete()
           
abstract  boolean isDefaultInstantiable()
           
abstract  boolean isEnum()
           
abstract  boolean isFinal()
           
abstract  boolean isInterface()
           
abstract  boolean isPrimitive()
           
abstract  boolean isPrimitiveWrapper()
           
abstract  boolean isPrivate()
           
abstract  boolean isProtected()
           
abstract  boolean isPublic()
           
abstract  boolean isStatic()
           
abstract  boolean isSynthetic()
           
abstract  boolean isVoid()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.errai.codegen.meta.HasAnnotations
getAnnotation, getAnnotations, isAnnotationPresent
 
Methods inherited from interface org.jboss.errai.codegen.meta.MetaGenericDeclaration
getTypeParameters
 

Constructor Detail

MetaClass

public MetaClass()
Method Detail

getName

public abstract String getName()
Description copied from interface: MetaType
Returns the name of this type as it was written in the original source code.

Specified by:
getName in interface MetaType
Returns:
The name of this type as it was written in the original source code.

getFullyQualifiedName

public abstract String getFullyQualifiedName()

getFullyQualifiedNameWithTypeParms

public abstract String getFullyQualifiedNameWithTypeParms()

getCanonicalName

public abstract String getCanonicalName()

getInternalName

public abstract String getInternalName()

getPackageName

public abstract String getPackageName()

getMethods

public abstract MetaMethod[] getMethods()
Returns all declared and inherited public, protected, and package-private methods available on this class.


getMethodsAnnotatedWith

public abstract List<MetaMethod> getMethodsAnnotatedWith(Class<? extends Annotation> annotation)
Returns all declared and inherited methods on this class that have the given annotation targeting them.

TODO: the returned collection should not include overridden methods from superclasses.

Parameters:
annotation - The annotation to scan this class's methods for. Must not be null.
Returns:
An unmodifiable list of all declared and inherited methods of this class that are annotated with the given annotation.
Throws:
NullPointerException - if annotation is null.

getMethodsWithMetaAnnotations

public abstract List<MetaMethod> getMethodsWithMetaAnnotations(Class<? extends Annotation> annotation)

getDeclaredMethods

public abstract MetaMethod[] getDeclaredMethods()

getMethod

public abstract MetaMethod getMethod(String name,
                                     Class... parameters)

getMethod

public abstract MetaMethod getMethod(String name,
                                     MetaClass... parameters)

getBestMatchingMethod

public abstract MetaMethod getBestMatchingMethod(String name,
                                                 Class... parameters)

getBestMatchingMethod

public abstract MetaMethod getBestMatchingMethod(String name,
                                                 MetaClass... parameters)

getBestMatchingStaticMethod

public abstract MetaMethod getBestMatchingStaticMethod(String name,
                                                       Class... parameters)

getBestMatchingStaticMethod

public abstract MetaMethod getBestMatchingStaticMethod(String name,
                                                       MetaClass... parameters)

getDeclaredMethod

public abstract MetaMethod getDeclaredMethod(String name,
                                             Class... parameters)

getDeclaredMethod

public abstract MetaMethod getDeclaredMethod(String name,
                                             MetaClass... parameters)

getFields

public abstract MetaField[] getFields()

getFieldsAnnotatedWith

public abstract List<MetaField> getFieldsAnnotatedWith(Class<? extends Annotation> annotation)
Returns all declared and inherited fields on this class that have the given annotation targeting them.

Parameters:
annotation - The annotation to scan this class's fields for. Must not be null.
Returns:
An unmodifiable list of all declared and inherited fields of this class that are annotated with the given annotation.
Throws:
NullPointerException - if annotation is null.

getFieldsWithMetaAnnotations

public abstract List<MetaField> getFieldsWithMetaAnnotations(Class<? extends Annotation> annotations)

getParametersAnnotatedWith

public abstract List<MetaParameter> getParametersAnnotatedWith(Class<? extends Annotation> annotation)

getDeclaredFields

public abstract MetaField[] getDeclaredFields()

getField

public abstract MetaField getField(String name)

getDeclaredField

public abstract MetaField getDeclaredField(String name)

getConstructors

public abstract MetaConstructor[] getConstructors()

getDeclaredConstructors

public abstract MetaConstructor[] getDeclaredConstructors()

getDeclaredClasses

public abstract MetaClass[] getDeclaredClasses()

getConstructor

public abstract MetaConstructor getConstructor(Class... parameters)

getConstructor

public abstract MetaConstructor getConstructor(MetaClass... parameters)

getBestMatchingConstructor

public abstract MetaConstructor getBestMatchingConstructor(Class... parameters)

getBestMatchingConstructor

public abstract MetaConstructor getBestMatchingConstructor(MetaClass... parameters)

getDeclaredConstructor

public abstract MetaConstructor getDeclaredConstructor(Class... parameters)

getParameterizedType

public abstract MetaParameterizedType getParameterizedType()

getGenericSuperClass

public abstract MetaParameterizedType getGenericSuperClass()

getInterfaces

public abstract MetaClass[] getInterfaces()

getSuperClass

public abstract MetaClass getSuperClass()

getComponentType

public abstract MetaClass getComponentType()

getOuterComponentType

public abstract MetaClass getOuterComponentType()

isAssignableFrom

public abstract boolean isAssignableFrom(MetaClass clazz)
Reports if the type represented by this MetaClass is a supertype of (or the same class as) the type represented by the given MetaClass. In other words, this method returns true if the following code would compile without error, where ThisType is the class represented by this MetaClass object, and GivenType is the class represented by the given "clazz" argument:
   GivenType given = ...;
   ThisType a = given;
 

Parameters:
clazz - The type to check for assignability to this MetaClass's type.
Returns:
True if the given type is assignable to this metaclass's type.

isAssignableTo

public abstract boolean isAssignableTo(MetaClass clazz)

isAssignableFrom

public abstract boolean isAssignableFrom(Class clazz)
Reports if the type represented by this MetaClass is a supertype of (or the same class as) the given class. In other words, this method returns true if the following code would compile without error, where ThisType is the class represented by this MetaClass object, and GivenType is the class represented by the given "clazz" argument:
   GivenType given = ...;
   ThisType a = given;
 

Parameters:
clazz - The type to check for assignability to this MetaClass's type.
Returns:
True if the given type is assignable to this metaclass's type.

isAssignableTo

public abstract boolean isAssignableTo(Class clazz)

isPrimitive

public abstract boolean isPrimitive()

isInterface

public abstract boolean isInterface()

isAbstract

public abstract boolean isAbstract()

isArray

public abstract boolean isArray()

isEnum

public abstract boolean isEnum()

isAnnotation

public abstract boolean isAnnotation()

isPublic

public abstract boolean isPublic()

isPrivate

public abstract boolean isPrivate()

isProtected

public abstract boolean isProtected()

isFinal

public abstract boolean isFinal()

isStatic

public abstract boolean isStatic()

isVoid

public abstract boolean isVoid()

isDefaultInstantiable

public abstract boolean isDefaultInstantiable()

isSynthetic

public abstract boolean isSynthetic()

isAnonymousClass

public abstract boolean isAnonymousClass()

isConcrete

public boolean isConcrete()

asBoxed

public abstract MetaClass asBoxed()

asUnboxed

public abstract MetaClass asUnboxed()

asArrayOf

public abstract MetaClass asArrayOf(int dimensions)

getErased

public abstract MetaClass getErased()
Returns a MetaClass that represents the same class as this one, but guaranteed to have no type parameters.

Returns:
A raw MetaClass representing the same class as this MetaClass. If this class has no type parameters in the first place, the receiving MetaClass instance is returned.

isPrimitiveWrapper

public abstract boolean isPrimitiveWrapper()

asClass

public abstract Class<?> asClass()

getInheritedField

public abstract MetaField getInheritedField(String name)
Searches for the named field in this type, its superinterfaces, and its superclasses.

The search proceeds as in getField(String), but includes all public, protected, default accessibility, and private fields. Whether a field is static or not does not affect this search.

Parameters:
name - The name of the field to search for. Not null.
Returns:
The first field with the given name that was encountered by the search.

getBeanDescriptor

public abstract BeanDescriptor getBeanDescriptor()

Errai 3.0.1-SNAPSHOT

Copyright © 2013-2014 JBoss, a division of Red Hat. All Rights Reserved.