static class TagPluginManager.TagPluginContextImpl extends java.lang.Object implements TagPluginContext
Modifier and Type | Field and Description |
---|---|
private Node.Nodes |
curNodes |
private Node.CustomTag |
node |
private PageInfo |
pageInfo |
private java.util.HashMap<java.lang.String,java.lang.Object> |
pluginAttributes |
Constructor and Description |
---|
TagPluginContextImpl(Node.CustomTag n,
PageInfo pageInfo) |
Modifier and Type | Method and Description |
---|---|
void |
dontUseTagPlugin()
Abandon optimization for this tag handler, and instruct
Jasper to generate the tag handler calls, as usual.
|
void |
generateAttribute(java.lang.String attributeName)
Generate codesto evaluate value of a attribute in the custom tag
The codes is a Java expression.
|
void |
generateBody() |
void |
generateDeclaration(java.lang.String id,
java.lang.String text)
Generate a declaration in the of the generated class.
|
void |
generateImport(java.lang.String imp)
Generate an import statement
|
void |
generateJavaSource(java.lang.String sourceCode)
Generate Java source codes
|
java.lang.String |
getConstantAttribute(java.lang.String attribute) |
private Node.JspAttribute |
getNodeAttribute(java.lang.String attribute) |
TagPluginContext |
getParentContext()
Get the PluginContext for the parent of this custom tag.
|
java.lang.Object |
getPluginAttribute(java.lang.String key)
Get the value of an attribute in the current tagplugin context.
|
java.lang.String |
getTemporaryVariableName() |
boolean |
isAttributeSpecified(java.lang.String attribute) |
boolean |
isConstantAttribute(java.lang.String attribute) |
boolean |
isScriptless() |
void |
setPluginAttribute(java.lang.String key,
java.lang.Object value)
Associate the attribute with a value in the current tagplugin context.
|
private Node.CustomTag node
private Node.Nodes curNodes
private PageInfo pageInfo
private java.util.HashMap<java.lang.String,java.lang.Object> pluginAttributes
TagPluginContextImpl(Node.CustomTag n, PageInfo pageInfo)
public TagPluginContext getParentContext()
TagPluginContext
getParentContext
in interface TagPluginContext
public void setPluginAttribute(java.lang.String key, java.lang.Object value)
TagPluginContext
setPluginAttribute
in interface TagPluginContext
public java.lang.Object getPluginAttribute(java.lang.String key)
TagPluginContext
getPluginAttribute
in interface TagPluginContext
public boolean isScriptless()
isScriptless
in interface TagPluginContext
public boolean isConstantAttribute(java.lang.String attribute)
isConstantAttribute
in interface TagPluginContext
public java.lang.String getConstantAttribute(java.lang.String attribute)
getConstantAttribute
in interface TagPluginContext
public boolean isAttributeSpecified(java.lang.String attribute)
isAttributeSpecified
in interface TagPluginContext
attribute
- Name of the attributepublic java.lang.String getTemporaryVariableName()
getTemporaryVariableName
in interface TagPluginContext
public void generateImport(java.lang.String imp)
TagPluginContext
generateImport
in interface TagPluginContext
imp
- Name of the import class, '*' allowed.public void generateDeclaration(java.lang.String id, java.lang.String text)
TagPluginContext
generateDeclaration
in interface TagPluginContext
id
- An unique ID identifying the declaration. It is not
part of the declaration, and is used to ensure that the
declaration will only appear once. If this method is
invoked with the same id more than once in the translation
unit, only the first declaration will be taken.text
- The text of the declaration.public void generateJavaSource(java.lang.String sourceCode)
TagPluginContext
generateJavaSource
in interface TagPluginContext
public void generateAttribute(java.lang.String attributeName)
TagPluginContext
generateAttribute
in interface TagPluginContext
attributeName
- The specified attributepublic void dontUseTagPlugin()
TagPluginContext
dontUseTagPlugin
in interface TagPluginContext
public void generateBody()
generateBody
in interface TagPluginContext
private Node.JspAttribute getNodeAttribute(java.lang.String attribute)