Package com.sencha.gxt.core.rebind
Class Context
- java.lang.Object
-
- com.sencha.gxt.core.rebind.Context
-
public class Context extends Object
Wraps up locally scoped variables used in creating a xtemplate method. Can be nested, to allow for local scopes that shouldn't affect outer scopes.
-
-
Constructor Summary
Constructors Constructor Description Context(com.google.gwt.core.ext.GeneratorContext ctx, com.google.gwt.core.ext.TreeLogger l, Map<String,com.google.gwt.core.ext.typeinfo.JType> params, FormatCollector formatters)
Context(Context parent, String childDeref, com.google.gwt.core.ext.typeinfo.JType childType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
declareLocalVariable(String name)
String
deref(String localName)
Gets a java expression that will return a value for the local name from within the current context, including any formatting.String
derefCount(String localName)
Gets a java expression for the number of items in the given localName, assuming it is an Array or Listcom.google.gwt.core.ext.typeinfo.JType
getType(String localName)
Gets the type of content available at this path, within the current context.void
setCountVar(String countVar)
Explicitly set the local count variable.
-
-
-
Constructor Detail
-
Context
public Context(Context parent, String childDeref, com.google.gwt.core.ext.typeinfo.JType childType)
-
Context
public Context(com.google.gwt.core.ext.GeneratorContext ctx, com.google.gwt.core.ext.TreeLogger l, Map<String,com.google.gwt.core.ext.typeinfo.JType> params, FormatCollector formatters)
-
-
Method Detail
-
deref
public String deref(String localName) throws com.google.gwt.core.ext.UnableToCompleteException
Gets a java expression that will return a value for the local name from within the current context, including any formatting.- Parameters:
localName
- the name of the content- Returns:
- the Java expression that returns the value
- Throws:
com.google.gwt.core.ext.UnableToCompleteException
- if the Java expression cannot be returned
-
derefCount
public String derefCount(String localName) throws com.google.gwt.core.ext.UnableToCompleteException
Gets a java expression for the number of items in the given localName, assuming it is an Array or List- Parameters:
localName
- the name of the content- Returns:
- number of items in localName
- Throws:
com.google.gwt.core.ext.UnableToCompleteException
- if the number of items cannot be returned
-
getType
public com.google.gwt.core.ext.typeinfo.JType getType(String localName) throws com.google.gwt.core.ext.UnableToCompleteException
Gets the type of content available at this path, within the current context.- Parameters:
localName
- the name of the content- Returns:
- the type of the content
- Throws:
com.google.gwt.core.ext.UnableToCompleteException
- if the type cannot be returned
-
setCountVar
public void setCountVar(String countVar)
Explicitly set the local count variable. This can (must) be set for each context, and can be referenced with the # magic variable.- Parameters:
countVar
- the local count variable
-
-