org.jboss.errai.ioc.rebind.ioc.codegen
Class Context

java.lang.Object
  extended by org.jboss.errai.ioc.rebind.ioc.codegen.Context

public class Context
extends Object

This class represents a context in which Statements are generated. It references its parent context and holds a map of variables to represent a Statement's scope. It further supports importing classes and packages to avoid the use of fully qualified class names.

Author:
Christian Sadilek

Method Summary
 Context addClassImport(MetaClass clazz)
           
 Context addLabel(Label label)
           
 Context addPackageImport(String packageName)
           
 Context addVariable(String name, Class<?> type)
           
 Context addVariable(String name, Class<?> type, Object initialization)
           
 Context addVariable(String name, Object initialization)
           
 Context addVariable(String name, javax.enterprise.util.TypeLiteral<?> type)
           
 Context addVariable(String name, javax.enterprise.util.TypeLiteral<?> type, Object initialization)
           
 Context addVariable(Variable variable)
           
 Context autoImport()
           
static Context create()
           
static Context create(Context parent)
           
 VariableReference getClassMember(String name)
           
 Collection<Variable> getDeclaredVariables()
           
 Set<String> getImportedClasses()
           
 Set<String> getImportedPackages()
           
 LabelReference getLabel(String name)
           
 VariableReference getVariable(String name)
           
 Map<String,Variable> getVariables()
           
 boolean hasClassImport(MetaClass clazz)
           
 boolean hasPackageImport(String packageName)
           
 boolean isAutoImports()
           
 boolean isScoped(Variable variable)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static Context create()

create

public static Context create(Context parent)

addVariable

public Context addVariable(String name,
                           Class<?> type)

addVariable

public Context addVariable(String name,
                           javax.enterprise.util.TypeLiteral<?> type)

addVariable

public Context addVariable(String name,
                           Object initialization)

addVariable

public Context addVariable(String name,
                           Class<?> type,
                           Object initialization)

addVariable

public Context addVariable(String name,
                           javax.enterprise.util.TypeLiteral<?> type,
                           Object initialization)

addVariable

public Context addVariable(Variable variable)

addLabel

public Context addLabel(Label label)

addPackageImport

public Context addPackageImport(String packageName)

hasPackageImport

public boolean hasPackageImport(String packageName)

addClassImport

public Context addClassImport(MetaClass clazz)

hasClassImport

public boolean hasClassImport(MetaClass clazz)

autoImport

public Context autoImport()

getVariable

public VariableReference getVariable(String name)

getClassMember

public VariableReference getClassMember(String name)

getLabel

public LabelReference getLabel(String name)

isScoped

public boolean isScoped(Variable variable)

getDeclaredVariables

public Collection<Variable> getDeclaredVariables()

getVariables

public Map<String,Variable> getVariables()

getImportedPackages

public Set<String> getImportedPackages()

getImportedClasses

public Set<String> getImportedClasses()

isAutoImports

public boolean isAutoImports()


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