Forge - Parent 1.0.6-SNAPSHOT

org.jboss.forge.parser.java.impl
Class FieldImpl<O extends JavaSource<O>>

java.lang.Object
  extended by org.jboss.forge.parser.java.impl.FieldImpl<O>
All Implemented Interfaces:
Internal, AnnotationTarget<O,Field<O>>, Field<O>, Member<O,Field<O>>, VisibilityScoped<Field<O>>, Origin<O>

public class FieldImpl<O extends JavaSource<O>>
extends Object
implements Field<O>

Author:
Lincoln Baxter, III

Constructor Summary
FieldImpl(O parent)
           
FieldImpl(O parent, Object internal)
           
FieldImpl(O parent, String declaration)
           
 
Method Summary
 Annotation<O> addAnnotation()
          Add a new annotation instance to this T.
 Annotation<O> addAnnotation(Class<? extends Annotation> clazz)
          Add a new annotation instance to this T, using the given Class as the annotation type.
 Annotation<O> addAnnotation(String className)
          Add a new annotation instance to this T, using the given String className as the annotation type.
 boolean equals(Object obj)
           
 Annotation<O> getAnnotation(Class<? extends Annotation> type)
           
 Annotation<O> getAnnotation(String type)
           
 List<Annotation<O>> getAnnotations()
           
 Object getInternal()
          Returns the implementation-specific Object representing this.
 String getLiteralInitializer()
           
 String getName()
           
 O getOrigin()
           
 String getQualifiedType()
          Get this field's fully qualified type.
 String getStringInitializer()
           
 String getType()
          Get this field's type.
 Type<O> getTypeInspector()
          Get this field's Type
 Visibility getVisibility()
           
 boolean hasAnnotation(Class<? extends Annotation> type)
           
 boolean hasAnnotation(String type)
           
 int hashCode()
           
 boolean isFinal()
           
 boolean isPackagePrivate()
           
 boolean isPrimitive()
           
 boolean isPrivate()
           
 boolean isProtected()
           
 boolean isPublic()
           
 boolean isStatic()
           
 boolean isType(Class<?> type)
          Attempt to determine if this field is of the same type as the given type.
 boolean isType(String name)
          Attempt to determine if this field is of the same type as the given type.
 Field<O> removeAnnotation(Annotation<O> annotation)
           
 Field<O> setFinal(boolean finl)
           
 Field<O> setLiteralInitializer(String value)
           
 Field<O> setName(String name)
           
 Field<O> setPackagePrivate()
           
 Field<O> setPrivate()
           
 Field<O> setProtected()
           
 Field<O> setPublic()
           
 Field<O> setStatic(boolean statc)
           
 Field<O> setStringInitializer(String value)
           
 Field<O> setType(Class<?> clazz)
          Set the type of this Field to the given Class type.
 Field<O> setType(JavaSource<?> source)
          Set the type of this Field to the given JavaSource type.
 Field<O> setType(String typeName)
          Set the type of this Field to the given type.
 Field<O> setVisibility(Visibility scope)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FieldImpl

public FieldImpl(O parent)

FieldImpl

public FieldImpl(O parent,
                 String declaration)

FieldImpl

public FieldImpl(O parent,
                 Object internal)
Method Detail

getOrigin

public O getOrigin()
Specified by:
getOrigin in interface Origin<O extends JavaSource<O>>
Returns:
the instance of the root ancestor.

getInternal

public Object getInternal()
Description copied from interface: Internal
Returns the implementation-specific Object representing this. Do not call this method unless you are willing to risk breaking backwards compatibility if future versions do not use the same internal object implementations.

Specified by:
getInternal in interface Internal

addAnnotation

public Annotation<O> addAnnotation()
Description copied from interface: AnnotationTarget
Add a new annotation instance to this T. (Note that an import statement must be added manually if required.)

Specified by:
addAnnotation in interface AnnotationTarget<O extends JavaSource<O>,Field<O extends JavaSource<O>>>

addAnnotation

public Annotation<O> addAnnotation(Class<? extends Annotation> clazz)
Description copied from interface: AnnotationTarget
Add a new annotation instance to this T, using the given Class as the annotation type. Attempt to add an import statement to this object's O if required.

Specified by:
addAnnotation in interface AnnotationTarget<O extends JavaSource<O>,Field<O extends JavaSource<O>>>

addAnnotation

public Annotation<O> addAnnotation(String className)
Description copied from interface: AnnotationTarget
Add a new annotation instance to this T, using the given String className as the annotation type. Attempt to add an import statement to this object's O if required. (Note that the given className must be fully-qualified in order to properly import required classes)

Specified by:
addAnnotation in interface AnnotationTarget<O extends JavaSource<O>,Field<O extends JavaSource<O>>>

getAnnotations

public List<Annotation<O>> getAnnotations()
Specified by:
getAnnotations in interface AnnotationTarget<O extends JavaSource<O>,Field<O extends JavaSource<O>>>

hasAnnotation

public boolean hasAnnotation(Class<? extends Annotation> type)
Specified by:
hasAnnotation in interface AnnotationTarget<O extends JavaSource<O>,Field<O extends JavaSource<O>>>

hasAnnotation

public boolean hasAnnotation(String type)
Specified by:
hasAnnotation in interface AnnotationTarget<O extends JavaSource<O>,Field<O extends JavaSource<O>>>

getAnnotation

public Annotation<O> getAnnotation(Class<? extends Annotation> type)
Specified by:
getAnnotation in interface AnnotationTarget<O extends JavaSource<O>,Field<O extends JavaSource<O>>>

getAnnotation

public Annotation<O> getAnnotation(String type)
Specified by:
getAnnotation in interface AnnotationTarget<O extends JavaSource<O>,Field<O extends JavaSource<O>>>

removeAnnotation

public Field<O> removeAnnotation(Annotation<O> annotation)
Specified by:
removeAnnotation in interface AnnotationTarget<O extends JavaSource<O>,Field<O extends JavaSource<O>>>

toString

public String toString()
Overrides:
toString in class Object

isFinal

public boolean isFinal()
Specified by:
isFinal in interface Member<O extends JavaSource<O>,Field<O extends JavaSource<O>>>

setFinal

public Field<O> setFinal(boolean finl)
Specified by:
setFinal in interface Member<O extends JavaSource<O>,Field<O extends JavaSource<O>>>

isStatic

public boolean isStatic()
Specified by:
isStatic in interface Member<O extends JavaSource<O>,Field<O extends JavaSource<O>>>

setStatic

public Field<O> setStatic(boolean statc)
Specified by:
setStatic in interface Member<O extends JavaSource<O>,Field<O extends JavaSource<O>>>

isPackagePrivate

public boolean isPackagePrivate()
Specified by:
isPackagePrivate in interface VisibilityScoped<Field<O extends JavaSource<O>>>

setPackagePrivate

public Field<O> setPackagePrivate()
Specified by:
setPackagePrivate in interface VisibilityScoped<Field<O extends JavaSource<O>>>

isPublic

public boolean isPublic()
Specified by:
isPublic in interface VisibilityScoped<Field<O extends JavaSource<O>>>

setPublic

public Field<O> setPublic()
Specified by:
setPublic in interface VisibilityScoped<Field<O extends JavaSource<O>>>

isPrivate

public boolean isPrivate()
Specified by:
isPrivate in interface VisibilityScoped<Field<O extends JavaSource<O>>>

setPrivate

public Field<O> setPrivate()
Specified by:
setPrivate in interface VisibilityScoped<Field<O extends JavaSource<O>>>

isProtected

public boolean isProtected()
Specified by:
isProtected in interface VisibilityScoped<Field<O extends JavaSource<O>>>

setProtected

public Field<O> setProtected()
Specified by:
setProtected in interface VisibilityScoped<Field<O extends JavaSource<O>>>

getVisibility

public Visibility getVisibility()
Specified by:
getVisibility in interface VisibilityScoped<Field<O extends JavaSource<O>>>

setVisibility

public Field<O> setVisibility(Visibility scope)
Specified by:
setVisibility in interface VisibilityScoped<Field<O extends JavaSource<O>>>

getName

public String getName()
Specified by:
getName in interface Member<O extends JavaSource<O>,Field<O extends JavaSource<O>>>

setName

public Field<O> setName(String name)
Specified by:
setName in interface Field<O extends JavaSource<O>>

getType

public String getType()
Description copied from interface: Field
Get this field's type.

Specified by:
getType in interface Field<O extends JavaSource<O>>

getQualifiedType

public String getQualifiedType()
Description copied from interface: Field
Get this field's fully qualified type.

Specified by:
getQualifiedType in interface Field<O extends JavaSource<O>>

getTypeInspector

public Type<O> getTypeInspector()
Description copied from interface: Field
Get this field's Type

Specified by:
getTypeInspector in interface Field<O extends JavaSource<O>>

isType

public boolean isType(Class<?> type)
Description copied from interface: Field
Attempt to determine if this field is of the same type as the given type.

Specified by:
isType in interface Field<O extends JavaSource<O>>

isType

public boolean isType(String name)
Description copied from interface: Field
Attempt to determine if this field is of the same type as the given type.

Specified by:
isType in interface Field<O extends JavaSource<O>>

setType

public Field<O> setType(Class<?> clazz)
Description copied from interface: Field
Set the type of this Field to the given Class type. Attempt to add an import statement to this field's base O if required.

Specified by:
setType in interface Field<O extends JavaSource<O>>

setType

public Field<O> setType(JavaSource<?> source)
Description copied from interface: Field
Set the type of this Field to the given JavaSource type. Attempt to add an import statement to this field's base O if required.

Specified by:
setType in interface Field<O extends JavaSource<O>>

setType

public Field<O> setType(String typeName)
Description copied from interface: Field
Set the type of this Field to the given type. Attempt to add an import statement to this field's base O if required. (Note that the given className must be fully-qualified in order to properly import required classes)

Specified by:
setType in interface Field<O extends JavaSource<O>>

getLiteralInitializer

public String getLiteralInitializer()
Specified by:
getLiteralInitializer in interface Field<O extends JavaSource<O>>

getStringInitializer

public String getStringInitializer()
Specified by:
getStringInitializer in interface Field<O extends JavaSource<O>>

setLiteralInitializer

public Field<O> setLiteralInitializer(String value)
Specified by:
setLiteralInitializer in interface Field<O extends JavaSource<O>>

setStringInitializer

public Field<O> setStringInitializer(String value)
Specified by:
setStringInitializer in interface Field<O extends JavaSource<O>>

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

isPrimitive

public boolean isPrimitive()
Specified by:
isPrimitive in interface Field<O extends JavaSource<O>>

Forge - Parent 1.0.6-SNAPSHOT

Copyright © 2012 JBoss, a division of Red Hat, Inc.. All Rights Reserved.