Class TagPluginManager.TagPluginContextImpl
java.lang.Object
org.apache.jasper.compiler.TagPluginManager.TagPluginContextImpl
- All Implemented Interfaces:
TagPluginContext
- Enclosing class:
TagPluginManager
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAbandon optimization for this tag handler, and instruct Jasper to generate the tag handler calls, as usual.voidgenerateAttribute(String attributeName) Generate codesto evaluate value of a attribute in the custom tag The codes is a Java expression.voidvoidgenerateDeclaration(String id, String text) Generate a declaration in the of the generated class.voidgenerateImport(String imp) Generate an import statementvoidgenerateJavaSource(String sourceCode) Generate Java source codesgetConstantAttribute(String attribute) private Node.JspAttributegetNodeAttribute(String attribute) Get the PluginContext for the parent of this custom tag.getPluginAttribute(String key) Get the value of an attribute in the current tagplugin context.booleanisAttributeSpecified(String attribute) booleanisConstantAttribute(String attribute) booleanvoidsetPluginAttribute(String key, Object value) Associate the attribute with a value in the current tagplugin context.
-
Field Details
-
node
-
curNodes
-
pageInfo
-
pluginAttributes
-
-
Constructor Details
-
TagPluginContextImpl
TagPluginContextImpl(Node.CustomTag n, PageInfo pageInfo)
-
-
Method Details
-
getParentContext
Description copied from interface:TagPluginContextGet the PluginContext for the parent of this custom tag. NOTE: The operations available for PluginContext so obtained is limited to getPluginAttribute and setPluginAttribute, and queries (e.g. isScriptless(). There should be no calls to generate*().- Specified by:
getParentContextin interfaceTagPluginContext- Returns:
- The pluginContext for the parent node. null if the parent is not a custom tag, or if the pluginConxt if not available (because useTagPlugin is false, e.g).
-
setPluginAttribute
Description copied from interface:TagPluginContextAssociate the attribute with a value in the current tagplugin context. The plugin attributes can be used for communication among tags that must work together as a group. See invalid input: '<'c:when> for an example.- Specified by:
setPluginAttributein interfaceTagPluginContext
-
getPluginAttribute
Description copied from interface:TagPluginContextGet the value of an attribute in the current tagplugin context.- Specified by:
getPluginAttributein interfaceTagPluginContext
-
isScriptless
public boolean isScriptless()- Specified by:
isScriptlessin interfaceTagPluginContext- Returns:
- true if the body of the tag is scriptless.
-
isConstantAttribute
- Specified by:
isConstantAttributein interfaceTagPluginContext- Returns:
- true if the attribute is specified and its value is a translation-time constant.
-
getConstantAttribute
- Specified by:
getConstantAttributein interfaceTagPluginContext- Returns:
- A string that is the value of a constant attribute. Undefined if the attribute is not a (translation-time) constant. null if the attribute is not specified.
-
isAttributeSpecified
- Specified by:
isAttributeSpecifiedin interfaceTagPluginContext- Parameters:
attribute- Name of the attribute- Returns:
- true if the attribute is specified in the tag
-
getTemporaryVariableName
- Specified by:
getTemporaryVariableNamein interfaceTagPluginContext- Returns:
- An unique temporary variable name that the plugin can use.
-
generateImport
Description copied from interface:TagPluginContextGenerate an import statement- Specified by:
generateImportin interfaceTagPluginContext- Parameters:
imp- Name of the import class, '*' allowed.
-
generateDeclaration
Description copied from interface:TagPluginContextGenerate a declaration in the of the generated class. This can be used to declare an innter class, a method, or a class variable.- Specified by:
generateDeclarationin interfaceTagPluginContext- Parameters:
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.
-
generateJavaSource
Description copied from interface:TagPluginContextGenerate Java source codes- Specified by:
generateJavaSourcein interfaceTagPluginContext
-
generateAttribute
Description copied from interface:TagPluginContextGenerate codesto evaluate value of a attribute in the custom tag The codes is a Java expression. NOTE: Currently cannot handle attributes that are fragments.- Specified by:
generateAttributein interfaceTagPluginContext- Parameters:
attributeName- The specified attribute
-
dontUseTagPlugin
public void dontUseTagPlugin()Description copied from interface:TagPluginContextAbandon optimization for this tag handler, and instruct Jasper to generate the tag handler calls, as usual. Should be invoked if errors are detected, or when the tag body is deemed too compilicated for optimization.- Specified by:
dontUseTagPluginin interfaceTagPluginContext
-
generateBody
public void generateBody()- Specified by:
generateBodyin interfaceTagPluginContext
-
getNodeAttribute
-