org.jboss.errai.codegen.meta.impl.build
Class BuildMetaField
java.lang.Object
org.jboss.errai.codegen.meta.MetaField
org.jboss.errai.codegen.meta.impl.build.BuildMetaField
- All Implemented Interfaces:
- Builder, HasAnnotations, MetaClassMember
- Direct Known Subclasses:
- ShadowBuildMetaField
public class BuildMetaField
- extends MetaField
- implements Builder
- Author:
- Mike Brock
Method Summary |
void |
addAnnotation(Annotation annotation)
|
|
getAnnotation(Class<A> annotation)
|
Annotation[] |
getAnnotations()
Returns the annotations present on this field. |
MetaClass |
getDeclaringClass()
|
MetaType |
getGenericType()
Returns the actual unerased type of this field, which could be a MetaClass
(class, enum, interface, array, primitive, etc), a bounded or unbounded
type variable, or a wildcard. |
String |
getName()
Returns this field's name without any type information or qualifiers. |
MetaClass |
getType()
Returns an actual MetaClass (a class, interface, primitive type, array, or
enum, but not a type variable or a wildcard) representing an erased
type that is assignable to this field. |
boolean |
isAbstract()
|
boolean |
isAnnotationPresent(Class<? extends Annotation> annotation)
|
boolean |
isFinal()
|
boolean |
isPrivate()
|
boolean |
isProtected()
|
boolean |
isPublic()
|
boolean |
isStatic()
|
boolean |
isSynchronized()
|
boolean |
isSynthetic()
|
boolean |
isTransient()
|
boolean |
isVolatile()
|
void |
setDeclaringClass(BuildMetaClass declaringClass)
|
void |
setFieldComment(String fieldComment)
|
void |
setFinal(boolean aFinal)
|
void |
setGenericType(MetaType genericType)
|
void |
setName(String name)
|
void |
setScope(Scope scope)
|
void |
setStatement(Statement statement)
|
void |
setStatic(boolean aStatic)
|
void |
setTransient(boolean aTransient)
|
void |
setType(MetaClass type)
|
void |
setVolatile(boolean aVolatile)
|
String |
toJavaString()
Validates the statement and generates the String representation. |
BuildMetaField
public BuildMetaField(BuildMetaClass declaringClass,
Statement statement,
Scope scope,
MetaClass type,
String name)
getType
public MetaClass getType()
- Description copied from class:
MetaField
- Returns an actual MetaClass (a class, interface, primitive type, array, or
enum, but not a type variable or a wildcard) representing an erased
type that is assignable to this field.
- Specified by:
getType
in class MetaField
- Returns:
- a MetaClass representing a type that is assignable to this field.
Never null.
- See Also:
MetaField.getGenericType()
getGenericType
public MetaType getGenericType()
- Description copied from class:
MetaField
- Returns the actual unerased type of this field, which could be a MetaClass
(class, enum, interface, array, primitive, etc), a bounded or unbounded
type variable, or a wildcard. Unlike with
MetaField.getType()
, any type
parameters on the field's type will be preserved in the returned MetaType
object.
- Specified by:
getGenericType
in class MetaField
- Returns:
- The field type as declared. Never null.
getName
public String getName()
- Description copied from class:
MetaField
- Returns this field's name without any type information or qualifiers.
- Specified by:
getName
in interface MetaClassMember
- Specified by:
getName
in class MetaField
- Returns:
- The field name. Never null.
getAnnotations
public Annotation[] getAnnotations()
- Description copied from class:
MetaField
- Returns the annotations present on this field.
- Specified by:
getAnnotations
in interface HasAnnotations
- Specified by:
getAnnotations
in class MetaField
- Returns:
- A shared reference to the array of the annotations on this field.
Returns an empty array (never null) if the field has no
annotations. Callers should refrain from modifying the returned
array.
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
isAnnotationPresent
public boolean isAnnotationPresent(Class<? extends Annotation> annotation)
- Specified by:
isAnnotationPresent
in interface HasAnnotations
getAnnotation
public <A extends Annotation> A getAnnotation(Class<A> annotation)
- Specified by:
getAnnotation
in interface HasAnnotations
setDeclaringClass
public void setDeclaringClass(BuildMetaClass declaringClass)
setScope
public void setScope(Scope scope)
setType
public void setType(MetaClass type)
setGenericType
public void setGenericType(MetaType genericType)
setName
public void setName(String name)
setFinal
public void setFinal(boolean aFinal)
setStatic
public void setStatic(boolean aStatic)
setTransient
public void setTransient(boolean aTransient)
setVolatile
public void setVolatile(boolean aVolatile)
addAnnotation
public void addAnnotation(Annotation annotation)
setStatement
public void setStatement(Statement statement)
setFieldComment
public void setFieldComment(String fieldComment)
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
Copyright © 2013-2014 JBoss, a division of Red Hat. All Rights Reserved.