org.mule.devkit.model.code
Class GeneratedVariable

java.lang.Object
  extended by org.mule.devkit.model.code.AbstractExpression
      extended by org.mule.devkit.model.code.GeneratedVariable
All Implemented Interfaces:
Annotable, AssignmentTarget, Declaration, Generable, GeneratedExpression
Direct Known Subclasses:
GeneratedField

public class GeneratedVariable
extends AbstractExpression
implements Declaration, AssignmentTarget, Annotable

Variables and fields.


Method Summary
 GeneratedAnnotationUse annotate(Class<? extends Annotation> clazz)
          Adds an annotation to this variable.
 GeneratedAnnotationUse annotate(TypeReference clazz)
          Adds an annotation to this variable.
<W extends AnnotationWriter>
W
annotate2(Class<W> clazz)
          Adds an annotation to this program element and returns a type-safe writer to fill in the values of such annotations.
 Collection<GeneratedAnnotationUse> annotations()
          Read-only live view of all annotations on this Annotable
 GeneratedExpression assign(GeneratedExpression rhs)
           
 GeneratedExpression assignPlus(GeneratedExpression rhs)
           
 void bind(Formatter f)
           
 void declare(Formatter f)
           
 void generate(Formatter f)
           
 GeneratedVariable init(GeneratedExpression init)
          Initialize this variable
protected  boolean isAnnotated()
           
 Modifiers mods()
           
 String name()
          Get the name of this variable
 void name(String name)
          Changes the name of this variable.
 Type type()
          Return the type of this variable.
 Type type(Type newType)
          Sets the type of this variable.
 
Methods inherited from class org.mule.devkit.model.code.AbstractExpression
_instanceof, band, bor, cand, complement, component, cor, decr, div, eq, gt, gte, incr, invoke, invoke, isNotNull, isNull, lt, lte, minus, minus, mod, mul, ne, not, plus, ref, ref, shl, shr, shrz, xor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.mule.devkit.model.code.GeneratedExpression
_instanceof, band, bor, cand, complement, component, cor, decr, div, eq, gt, gte, incr, invoke, invoke, isNotNull, isNull, lt, lte, minus, minus, mod, mul, ne, not, plus, ref, ref, shl, shr, shrz, xor
 

Method Detail

init

public GeneratedVariable init(GeneratedExpression init)
Initialize this variable

Parameters:
init - Expression to be used to initialize this field

name

public String name()
Get the name of this variable

Returns:
Name of the variable

name

public void name(String name)
Changes the name of this variable.


type

public Type type()
Return the type of this variable.

Returns:
always non-null.

mods

public Modifiers mods()
Returns:
the current modifiers of this method. Always return non-null valid object.

type

public Type type(Type newType)
Sets the type of this variable.

Parameters:
newType - must not be null.
Returns:
the old type value. always non-null.

annotate

public GeneratedAnnotationUse annotate(TypeReference clazz)
Adds an annotation to this variable.

Specified by:
annotate in interface Annotable
Parameters:
clazz - The annotation class to annotate the field with

annotate

public GeneratedAnnotationUse annotate(Class<? extends Annotation> clazz)
Adds an annotation to this variable.

Specified by:
annotate in interface Annotable
Parameters:
clazz - The annotation class to annotate the field with

annotate2

public <W extends AnnotationWriter> W annotate2(Class<W> clazz)
Description copied from interface: Annotable
Adds an annotation to this program element and returns a type-safe writer to fill in the values of such annotations.

Specified by:
annotate2 in interface Annotable

annotations

public Collection<GeneratedAnnotationUse> annotations()
Description copied from interface: Annotable
Read-only live view of all annotations on this Annotable

Specified by:
annotations in interface Annotable
Returns:
Can be empty but never null.

isAnnotated

protected boolean isAnnotated()

bind

public void bind(Formatter f)

declare

public void declare(Formatter f)
Specified by:
declare in interface Declaration

generate

public void generate(Formatter f)
Specified by:
generate in interface Generable

assign

public GeneratedExpression assign(GeneratedExpression rhs)
Specified by:
assign in interface AssignmentTarget

assignPlus

public GeneratedExpression assignPlus(GeneratedExpression rhs)
Specified by:
assignPlus in interface AssignmentTarget


Copyright © 2010–2015 MuleSoft, Inc.. All rights reserved.