Errai 3.0.1-SNAPSHOT

org.jboss.errai.codegen.meta.impl.build
Class BuildMetaMethod

java.lang.Object
  extended by org.jboss.errai.codegen.meta.MetaMethod
      extended by org.jboss.errai.codegen.meta.impl.build.BuildMetaMethod
All Implemented Interfaces:
Builder, HasAnnotations, MetaClassMember, MetaGenericDeclaration
Direct Known Subclasses:
ShadowBuildMetaMethod

public class BuildMetaMethod
extends MetaMethod
implements Builder

Author:
Mike Brock , Christian Sadilek

Constructor Summary
BuildMetaMethod(BuildMetaClass declaringClass, BlockStatement body, Scope scope, DefModifiers modifiers, String name, MetaClass returnType, DefParameters defParameters, ThrowsDeclaration throwsDeclaration)
           
 
Method Summary
 void addAnnotations(Annotation... annotations)
           
 void addAnnotations(Collection<Annotation> annotations)
           
 Annotation[] getAnnotations()
           
 BlockStatement getBody()
           
 MetaClass[] getCheckedExceptions()
           
 MetaClass getDeclaringClass()
           
 MetaType[] getGenericParameterTypes()
           
 MetaType getGenericReturnType()
          Returns the MetaType representing the return type of the method.
 String getName()
           
 MetaParameter[] getParameters()
           
 MetaMethod getReifiedFormOf()
           
 MetaClass getReturnType()
          Returns the MetaClass representing this method's return type.
 MetaTypeVariable[] getTypeParameters()
          Returns the array of type variables declared on this generic declaration site, in the order they were declared in the source code.
 boolean isAbstract()
           
 boolean isFinal()
           
 boolean isPrivate()
           
 boolean isProtected()
           
 boolean isPublic()
           
 boolean isReifiedForm()
           
 boolean isStatic()
           
 boolean isSynchronized()
           
 boolean isSynthetic()
           
 boolean isTransient()
           
 boolean isVarArgs()
           
 boolean isVolatile()
           
 void setBody(BlockStatement body)
           
 void setDeclaringClass(BuildMetaClass declaringClass)
           
 void setDefParameters(DefParameters defParameters)
           
 void setGenericParameterTypes(List<MetaType> genericParameterTypes)
           
 void setGenericReturnType(MetaType genericReturnType)
           
 void setMethodComment(String methodComment)
           
 void setName(String name)
           
 void setReifiedFormOf(MetaMethod reifiedFormOf)
           
 void setReturnType(MetaClass returnType)
           
 void setScope(Scope scope)
           
 void setThrowsDeclaration(ThrowsDeclaration throwsDeclaration)
           
 String toJavaString()
          Validates the statement and generates the String representation.
 String toString()
           
 
Methods inherited from class org.jboss.errai.codegen.meta.MetaMethod
asMethod, equals, getAnnotation, getParametersAnnotatedWith, hashCode, hashString, isAnnotationPresent
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BuildMetaMethod

public BuildMetaMethod(BuildMetaClass declaringClass,
                       BlockStatement body,
                       Scope scope,
                       DefModifiers modifiers,
                       String name,
                       MetaClass returnType,
                       DefParameters defParameters,
                       ThrowsDeclaration throwsDeclaration)
Method Detail

getName

public String getName()
Specified by:
getName in interface MetaClassMember
Specified by:
getName in class MetaMethod

getReturnType

public MetaClass getReturnType()
Description copied from class: MetaMethod
Returns the MetaClass representing this method's return type. The returned MetaClass may have had its generic information erased.

Specified by:
getReturnType in class MetaMethod
Returns:

getGenericReturnType

public MetaType getGenericReturnType()
Description copied from class: MetaMethod
Returns the MetaType representing the return type of the method. In the case of a plain, non-parameterized return type, this will return a MetaClass equivalent to the one returned by MetaMethod.getReturnType(). Other possible types could be MetaWildcardType, MetaParameterizedType, and MetaTypeVariable.

As of Errai 2.2, some implementations of this method are incomplete and will return null if they cannot make sense of the method's return type.

Specified by:
getGenericReturnType in class MetaMethod
Returns:

getGenericParameterTypes

public MetaType[] getGenericParameterTypes()
Specified by:
getGenericParameterTypes in class MetaMethod

getParameters

public MetaParameter[] getParameters()
Specified by:
getParameters in class MetaMethod

getDeclaringClass

public MetaClass getDeclaringClass()
Specified by:
getDeclaringClass in interface MetaClassMember

isAbstract

public boolean isAbstract()
Specified by:
isAbstract in interface MetaClassMember

isPublic

public boolean isPublic()
Specified by:
isPublic in interface MetaClassMember

isPrivate

public boolean isPrivate()
Specified by:
isPrivate in interface MetaClassMember

isProtected

public boolean isProtected()
Specified by:
isProtected in interface MetaClassMember

isFinal

public boolean isFinal()
Specified by:
isFinal in interface MetaClassMember

isStatic

public boolean isStatic()
Specified by:
isStatic in interface MetaClassMember

isTransient

public boolean isTransient()
Specified by:
isTransient in interface MetaClassMember

isSynthetic

public boolean isSynthetic()
Specified by:
isSynthetic in interface MetaClassMember

isVolatile

public boolean isVolatile()
Specified by:
isVolatile in interface MetaClassMember

isSynchronized

public boolean isSynchronized()
Specified by:
isSynchronized in interface MetaClassMember

addAnnotations

public void addAnnotations(Annotation... annotations)

addAnnotations

public void addAnnotations(Collection<Annotation> annotations)

getAnnotations

public Annotation[] getAnnotations()
Specified by:
getAnnotations in interface HasAnnotations

getTypeParameters

public MetaTypeVariable[] getTypeParameters()
Description copied from interface: MetaGenericDeclaration
Returns the array of type variables declared on this generic declaration site, in the order they were declared in the source code.

Specified by:
getTypeParameters in interface MetaGenericDeclaration
Returns:
the type variables declared at this site. The returned array is never null, but it will be empty if no type variable are declared at this site.

getCheckedExceptions

public MetaClass[] getCheckedExceptions()
Specified by:
getCheckedExceptions in class MetaMethod

setDeclaringClass

public void setDeclaringClass(BuildMetaClass declaringClass)

setScope

public void setScope(Scope scope)

setName

public void setName(String name)

setReturnType

public void setReturnType(MetaClass returnType)

setGenericReturnType

public void setGenericReturnType(MetaType genericReturnType)

setGenericParameterTypes

public void setGenericParameterTypes(List<MetaType> genericParameterTypes)

setBody

public void setBody(BlockStatement body)

setDefParameters

public void setDefParameters(DefParameters defParameters)

setThrowsDeclaration

public void setThrowsDeclaration(ThrowsDeclaration throwsDeclaration)

getBody

public BlockStatement getBody()

isVarArgs

public boolean isVarArgs()
Specified by:
isVarArgs in class MetaMethod

isReifiedForm

public boolean isReifiedForm()

getReifiedFormOf

public MetaMethod getReifiedFormOf()

setReifiedFormOf

public void setReifiedFormOf(MetaMethod reifiedFormOf)

setMethodComment

public void setMethodComment(String methodComment)

toJavaString

public String toJavaString()
Description copied from interface: Builder
Validates the statement and generates the String representation.

Specified by:
toJavaString in interface Builder
Returns:
Java String representation

toString

public String toString()
Overrides:
toString in class Object

Errai 3.0.1-SNAPSHOT

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