public abstract class GenericTag extends JspContainerNode
Modifier and Type | Field and Description |
---|---|
protected TagInstance |
_tag |
protected java.lang.Class<?> |
_tagClass |
protected TagInfo |
_tagInfo |
protected VariableInfo[] |
_varInfo |
_attributeNames, _attributeValues, _children, _hasJspAttribute
_endAttributeLine, _endLine, _filename, _gen, _name, _ns, _parent, _parseState, _sourcePath, _startLine
Constructor and Description |
---|
GenericTag() |
Modifier and Type | Method and Description |
---|---|
void |
addChild(JspNode node)
Adds a child node.
|
protected void |
addTagDepend() |
void |
endElement()
Completes the element
|
protected void |
fillAttributes(JspJavaWriter out,
java.lang.String name) |
protected VariableInfo[] |
fillVariableInfo(TagVariableInfo[] tagVars,
TagData tagData)
Returns the VariableInfo corresponding the to tag vars and the tag
data.
|
abstract void |
generate(JspJavaWriter out)
Generates the code for a custom tag.
|
void |
generateClassEpilogue(JspJavaWriter out)
Generates the code for the tag
|
void |
generatePrologue(JspJavaWriter out)
Generates code before the actual JSP.
|
void |
generatePrologueDeclare(JspJavaWriter out)
generates prologue data.
|
java.lang.String |
getBodyContent()
Returns the body content.
|
java.lang.String |
getCustomTagName()
Returns the tag name for the current tag.
|
java.lang.String |
getJsfBodyVar()
Returns the variable containing the jsf body
|
java.lang.String |
getJsfVar()
Returns the variable containing the jsf component
|
TagInstance |
getTag()
Returns the TagInstance of the enclosing parent.
|
TagInfo |
getTagInfo() |
VariableInfo[] |
getVarInfo() |
boolean |
hasScripting()
True if the node has scripting
|
protected boolean |
hasScriptlet(JspNode node)
Returns true if the node or one of its children is a scriptlet
|
protected boolean |
hasVarDeclaration(int scope)
Returns true if there is a tag variable declaration matching the scope.
|
protected boolean |
isDeclared()
Returns true if the tag instance has been declared
|
boolean |
isDeclaringInstance()
Returns true if this instance declares the tag.
|
boolean |
isJsfParentRequired()
True if the jsf-parent setting is required.
|
boolean |
isJsp21()
True for 2.1 or later taglib
|
boolean |
isJstl()
True if this is a jstl node.
|
boolean |
isPre21Taglib()
Return true for pre-21 taglib.
|
protected boolean |
isReuse()
Returns true if the tag instance can be reused
|
boolean |
isSimple()
Returns true if the tag is a simple tag.
|
protected void |
printVarAssign(JspJavaWriter out,
int scope)
Prints a tag variable declaration.
|
protected void |
printVarAssign(JspJavaWriter out,
int scope,
VariableInfo var)
Prints a tag variable declaration.
|
protected void |
printVarDeclaration(JspJavaWriter out,
int scope)
Prints a tag variable declaration.
|
protected void |
printVarDeclare(JspJavaWriter out,
int scope)
Prints a tag variable declaration.
|
protected void |
printVarDeclare(JspJavaWriter out,
int scope,
VariableInfo var)
Prints a tag variable declaration.
|
void |
printXml(WriteStream os)
Generates the XML text representation for the tag validation.
|
void |
setTagClass(java.lang.Class cl) |
void |
setTagInfo(TagInfo tagInfo) |
protected void |
validateClass(java.lang.String className,
java.lang.String varName)
Checks that the given class is a valid variable class.
|
addAttribute, addAttribute, addAttributeChild, addChildEnd, addText, findScriptingNode, generateChildren, generateChildrenEmpty, generateClassEpilogueChildren, generateDeclarationChildren, generatePrologueChildren, generateStatic, generateTagReleaseChildren, generateTagStateChildren, getAttribute, getChildren, getStaticText, hasChildren, hasCustomTag, hasScriptingElement, hasTag, isChildrenStatic, isEmpty, isSingleExpression, isWhitespace, printXmlChildren
addNamespace, addNamespaceRec, attributeToBoolean, classToString, convertParameterValue, endAttributes, error, error, error, escapeJavaString, generateDeclaration, generateELValue, generateEmpty, generateEndLocation, generateFragment, generateIncludeUrl, generateObject, generateParentTag, generateStartLocation, generateTagRelease, generateTagState, getEndAttributeLine, getEndLine, getFilename, getGenerator, getNamespaceContext, getNamespacePrefix, getParent, getParentTagName, getParentTagNode, getQName, getRuntimeAttribute, getSegment, getStartLine, getStaticText, getTagName, hasDeferredAttribute, hasDeferredAttribute, hasELAttribute, hasELAttribute, hasNamespace, hasNamespace, hasRuntimeAttribute, hasScripting, hasScripting, invokeFragment, isInFragment, isSimpleTag, isStatic, loadClass, printJspId, printXmlAttribute, printXmlOpen, printXmlText, setEndAttributeLocation, setEndLocation, setGenerator, setNamespace, setParent, setParseState, setQName, setStartLocation, toELObject, toString, xmlAttrText, xmlText
protected TagInstance _tag
protected TagInfo _tagInfo
protected java.lang.Class<?> _tagClass
protected VariableInfo[] _varInfo
public void setTagInfo(TagInfo tagInfo)
public TagInfo getTagInfo()
public boolean isJsp21()
JspNode
public boolean isPre21Taglib()
JspNode
isPre21Taglib
in class JspNode
public TagInstance getTag()
JspNode
public java.lang.String getCustomTagName()
getCustomTagName
in class JspNode
public boolean isSimple()
public void setTagClass(java.lang.Class cl)
public VariableInfo[] getVarInfo()
public java.lang.String getBodyContent()
getBodyContent
in class JspNode
public void addChild(JspNode node) throws JspParseException
addChild
in class JspContainerNode
JspParseException
public void endElement() throws java.lang.Exception
endElement
in class JspNode
java.lang.Exception
protected void addTagDepend()
public boolean hasScripting()
hasScripting
in class JspContainerNode
public boolean isJsfParentRequired()
isJsfParentRequired
in class JspContainerNode
public boolean isDeclaringInstance()
public java.lang.String getJsfVar()
public java.lang.String getJsfBodyVar()
getJsfBodyVar
in class JspNode
public void generateClassEpilogue(JspJavaWriter out) throws java.io.IOException
JspNode
generateClassEpilogue
in class JspNode
out
- the output writer for the generated java.java.io.IOException
public void generatePrologue(JspJavaWriter out) throws java.lang.Exception
generatePrologue
in class JspNode
java.lang.Exception
public void generatePrologueDeclare(JspJavaWriter out) throws java.lang.Exception
JspNode
generatePrologueDeclare
in class JspNode
java.lang.Exception
public void printXml(WriteStream os) throws java.io.IOException
public abstract void generate(JspJavaWriter out) throws java.lang.Exception
protected void fillAttributes(JspJavaWriter out, java.lang.String name) throws java.lang.Exception
java.lang.Exception
protected boolean hasVarDeclaration(int scope) throws java.lang.Exception
java.lang.Exception
protected void printVarDeclaration(JspJavaWriter out, int scope) throws java.lang.Exception
out
- the stream to the java code.scope
- the variable scope to printjava.lang.Exception
protected void printVarDeclare(JspJavaWriter out, int scope) throws java.lang.Exception
out
- the stream to the java code.scope
- the variable scope to printjava.lang.Exception
protected void printVarAssign(JspJavaWriter out, int scope) throws java.lang.Exception
out
- the stream to the java code.scope
- the variable scope to printjava.lang.Exception
protected VariableInfo[] fillVariableInfo(TagVariableInfo[] tagVars, TagData tagData) throws JspParseException
tagVars
- the implicit tag variables for the tagtagData
- the parsed tag attributesJspParseException
protected void printVarDeclare(JspJavaWriter out, int scope, VariableInfo var) throws java.lang.Exception
out
- the stream to the java code.scope
- the variable scope to printjava.lang.Exception
protected void printVarAssign(JspJavaWriter out, int scope, VariableInfo var) throws java.lang.Exception
out
- the stream to the java code.scope
- the variable scope to printjava.lang.Exception
protected boolean isReuse()
protected boolean isDeclared()
protected boolean hasScriptlet(JspNode node)
protected void validateClass(java.lang.String className, java.lang.String varName) throws JspParseException
JspParseException