public abstract class JspNode
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected int |
_endAttributeLine |
protected int |
_endLine |
protected java.lang.String |
_filename |
protected JavaJspGenerator |
_gen |
protected QName |
_name |
protected Namespace |
_ns |
protected JspNode |
_parent |
protected ParseState |
_parseState |
protected Path |
_sourcePath |
protected int |
_startLine |
Modifier | Constructor and Description |
---|---|
protected |
JspNode() |
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(QName name,
JspAttribute value)
Adds a JspAttribute attribute.
|
void |
addAttribute(QName name,
java.lang.String value)
Adds an attribute.
|
void |
addChild(JspNode node)
Adds a child node.
|
void |
addChildEnd(JspNode node)
Adds a child node after its completely initialized..
|
void |
addNamespace(java.lang.String prefix,
java.lang.String value)
Adds a namespace, e.g.
|
void |
addNamespaceRec(java.lang.String prefix,
java.lang.String value)
Adds a namespace, e.g.
|
JspNode |
addText(java.lang.String text)
Adds text.
|
protected boolean |
attributeToBoolean(java.lang.String attr,
java.lang.String value)
Converts the string to a boolean.
|
protected java.lang.String |
classToString(java.lang.Class<?> cl) |
void |
convertParameterValue(JspJavaWriter out,
java.lang.String type,
java.lang.String value) |
void |
endAttributes()
Called after all the attributes from the tag.
|
void |
endElement()
Called when the tag closes.
|
protected JspParseException |
error(java.lang.String msg)
Creates a parse exception with the proper line information.
|
protected JspParseException |
error(java.lang.String msg,
java.lang.Throwable e)
Creates a parse exception with the proper line information.
|
protected JspParseException |
error(java.lang.Throwable e)
Creates a parse exception with the proper line information.
|
static java.lang.String |
escapeJavaString(java.lang.String s)
Escapes a java string.
|
JspNode |
findScriptingNode()
Finds the first scripting node
|
abstract void |
generate(JspJavaWriter out)
Generates the code for the tag
|
void |
generateChildren(JspJavaWriter out)
Generates the code for the children.
|
void |
generateChildrenEmpty()
Generates the code for the children.
|
void |
generateClassEpilogue(JspJavaWriter out)
Generates the code for the tag
|
void |
generateClassEpilogueChildren(JspJavaWriter out)
Generates the code for the tag
|
void |
generateDeclaration(JspJavaWriter out)
generates declaration data.
|
void |
generateDeclarationChildren(JspJavaWriter out)
generates data for declaration children.
|
protected java.lang.String |
generateELValue(java.lang.Class<?> type,
java.lang.String value) |
void |
generateEmpty()
Generates the code for the tag
|
void |
generateEndLocation(JspJavaWriter out)
Generates the start location.
|
protected java.lang.String |
generateFragment(JspFragmentNode frag,
java.lang.String contextVar)
Generates the code for a fragment.
|
protected void |
generateIncludeUrl(JspJavaWriter out,
java.lang.String page,
java.util.ArrayList<JspParam> params) |
protected java.lang.String |
generateObject(java.lang.Object obj) |
protected java.lang.String |
generateParentTag(TagInstance parent)
Generates the code for the value of a parent tag.
|
void |
generatePrologue(JspJavaWriter out)
generates prologue data.
|
void |
generatePrologueChildren(JspJavaWriter out)
generates data for prologue children.
|
void |
generatePrologueDeclare(JspJavaWriter out)
generates prologue data.
|
void |
generateStartLocation(JspJavaWriter out)
Generates the start location.
|
void |
generateStatic(JspJavaWriter out)
Generates the code for the tag
|
void |
generateTagRelease(JspJavaWriter out)
generates tag state release
|
void |
generateTagReleaseChildren(JspJavaWriter out)
generates tag state
|
void |
generateTagState(JspJavaWriter out)
generates tag state
|
void |
generateTagStateChildren(JspJavaWriter out)
generates tag state
|
java.lang.String |
getBodyContent()
Returns the body content.
|
java.util.ArrayList<JspNode> |
getChildren()
Returns the children.
|
java.lang.String |
getCustomTagName()
Returns the tag name for the current tag.
|
int |
getEndAttributeLine()
Gets the attribute ending line number
|
int |
getEndLine()
Gets the ending line number
|
java.lang.String |
getFilename()
Gets the filename of the node
|
JavaJspGenerator |
getGenerator() |
java.lang.String |
getJsfBodyVar()
Returns the variable containing the jsf body
|
java.lang.String |
getJsfVar()
Returns the variable containing the jsf component
|
NamespaceContext |
getNamespaceContext()
Returns the XPath namespace context.
|
java.lang.String |
getNamespacePrefix(java.lang.String uri)
Adds a namespace, e.g.
|
JspNode |
getParent()
Returns the parent node.
|
java.lang.String |
getParentTagName()
Returns parent tag node
|
JspNode |
getParentTagNode()
Returns parent tag node
|
QName |
getQName()
Returns the qname of the node.
|
java.lang.String |
getRuntimeAttribute(java.lang.String value)
Returns the runtime attribute of the value.
|
JspSegmentNode |
getSegment()
Returns the containing segment.
|
int |
getStartLine()
Gets the starting line number
|
java.lang.String |
getStaticText()
Returns the static text.
|
void |
getStaticText(CharBuffer cb)
Returns the static text.
|
TagInstance |
getTag()
Returns the TagInstance of the enclosing parent.
|
java.lang.String |
getTagName()
Returns the qname of the node.
|
boolean |
hasCustomTag()
True if the node contains a child tag.
|
boolean |
hasDeferredAttribute(java.lang.String value)
Returns true if the value is a runtime attribute.
|
boolean |
hasDeferredAttribute(java.lang.String value,
boolean isELIgnored)
Returns true if the value is a runtime attribute.
|
boolean |
hasELAttribute(java.lang.String value)
Returns true if the value is a runtime attribute.
|
boolean |
hasELAttribute(java.lang.String value,
boolean isELIgnored)
Returns true if the value is a runtime attribute.
|
boolean |
hasNamespace(QName name)
Returns true if the namespace decl has been printed.
|
boolean |
hasNamespace(java.lang.String prefix,
java.lang.String uri)
Returns true if the namespace decl has been printed.
|
boolean |
hasRuntimeAttribute(java.lang.String value)
Returns true if the value is a runtime attribute.
|
boolean |
hasScripting()
True if the node has scripting (counting rtexpr)
|
boolean |
hasScripting(JspAttribute value)
Returns true if the string has scripting.
|
boolean |
hasScripting(java.lang.String value)
Returns true if the string has scripting.
|
boolean |
hasScriptingElement()
True if the node has scripting element (i.e.
|
boolean |
hasTag()
True if the node contains a child tag.
|
protected java.lang.String |
invokeFragment(JspFragmentNode frag)
Generates the code invoking a fragment to a string.
|
boolean |
isInFragment()
Returns true if in a fragment
|
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.
|
boolean |
isSimpleTag()
Returns true for a simple tag.
|
boolean |
isStatic()
True if the node only has static text.
|
protected java.lang.Class |
loadClass(java.lang.String type) |
void |
printJspId(WriteStream os)
Prints the jsp:id
|
abstract void |
printXml(WriteStream os)
Generates the XML text representation for the tag validation.
|
void |
printXmlAttribute(WriteStream os,
java.lang.String name,
java.lang.String text)
Generates the XML text representation for the tag validation.
|
protected java.lang.String |
printXmlOpen(WriteStream os,
java.lang.String ns,
java.lang.String localName) |
void |
printXmlText(WriteStream os,
java.lang.String text)
Generates the XML text representation for the tag validation.
|
void |
setEndAttributeLocation(java.lang.String filename,
int line)
Sets the end location of the node.
|
void |
setEndLocation(java.lang.String filename,
int line)
Sets the end location of the node.
|
void |
setGenerator(JavaJspGenerator gen)
Sets the Java generator.
|
void |
setNamespace(Namespace ns)
Adds a namespace, e.g.
|
void |
setParent(JspNode parent)
Sets the parent node
|
void |
setParseState(ParseState parseState)
Sets the parse state
|
void |
setQName(QName name)
Sets the node's qname
|
void |
setStartLocation(Path sourcePath,
java.lang.String filename,
int line)
Sets the start location of the node.
|
static java.lang.String |
toELObject(java.lang.String expr,
java.lang.Class<?> type) |
java.lang.String |
toString()
Returns a printable version of the node.
|
java.lang.String |
xmlAttrText(java.lang.String text)
Generates the XML text.
|
java.lang.String |
xmlText(java.lang.String text)
Generates the XML text.
|
protected Path _sourcePath
protected java.lang.String _filename
protected int _startLine
protected int _endAttributeLine
protected int _endLine
protected Namespace _ns
protected JavaJspGenerator _gen
protected ParseState _parseState
protected QName _name
protected JspNode _parent
public void setGenerator(JavaJspGenerator gen)
public JavaJspGenerator getGenerator()
public void setParseState(ParseState parseState)
public QName getQName()
public void setQName(QName name)
public java.lang.String getTagName()
public JspNode getParent()
public void setParent(JspNode parent)
public void setStartLocation(Path sourcePath, java.lang.String filename, int line)
public void setEndAttributeLocation(java.lang.String filename, int line)
public void setEndLocation(java.lang.String filename, int line)
public java.lang.String getFilename()
public int getStartLine()
public int getEndAttributeLine()
public int getEndLine()
public boolean isStatic()
public boolean isJstl()
public boolean isJsp21()
public java.lang.String getStaticText()
public void getStaticText(CharBuffer cb)
public boolean hasScripting()
public boolean hasScriptingElement()
public JspNode findScriptingNode()
public java.lang.String getBodyContent()
public boolean hasCustomTag()
public boolean hasTag()
public java.lang.String getCustomTagName()
public boolean isSimpleTag()
public JspNode getParentTagNode()
public java.lang.String getParentTagName()
public boolean hasNamespace(java.lang.String prefix, java.lang.String uri)
public final void addNamespace(java.lang.String prefix, java.lang.String value)
public final void setNamespace(Namespace ns)
public final NamespaceContext getNamespaceContext()
public void addNamespaceRec(java.lang.String prefix, java.lang.String value)
public java.lang.String getNamespacePrefix(java.lang.String uri)
public boolean hasNamespace(QName name)
public void addAttribute(QName name, java.lang.String value) throws JspParseException
JspParseException
public void addAttribute(QName name, JspAttribute value) throws JspParseException
name
- the name of the attribute.value
- the value of the attribute.JspParseException
public void endAttributes() throws JspParseException
JspParseException
public JspNode addText(java.lang.String text) throws JspParseException
JspParseException
public void addChild(JspNode node) throws JspParseException
JspParseException
public void addChildEnd(JspNode node) throws JspParseException
JspParseException
public void endElement() throws java.lang.Exception
java.lang.Exception
public java.util.ArrayList<JspNode> getChildren()
public TagInstance getTag()
public boolean isPre21Taglib()
public abstract void printXml(WriteStream os) throws java.io.IOException
os
- write stream to the generated XML.java.io.IOException
protected java.lang.String printXmlOpen(WriteStream os, java.lang.String ns, java.lang.String localName) throws java.io.IOException
java.io.IOException
public void printJspId(WriteStream os) throws java.io.IOException
java.io.IOException
public void printXmlText(WriteStream os, java.lang.String text) throws java.io.IOException
os
- write stream to the generated XML.java.io.IOException
public void printXmlAttribute(WriteStream os, java.lang.String name, java.lang.String text) throws java.io.IOException
os
- write stream to the generated XML.java.io.IOException
public java.lang.String xmlText(java.lang.String text)
public java.lang.String xmlAttrText(java.lang.String text)
public void generateStartLocation(JspJavaWriter out) throws java.io.IOException
java.io.IOException
public void generateEndLocation(JspJavaWriter out) throws java.io.IOException
java.io.IOException
public void generatePrologue(JspJavaWriter out) throws java.lang.Exception
java.lang.Exception
public void generatePrologueDeclare(JspJavaWriter out) throws java.lang.Exception
java.lang.Exception
public void generatePrologueChildren(JspJavaWriter out) throws java.lang.Exception
java.lang.Exception
public void generateDeclaration(JspJavaWriter out) throws java.io.IOException
java.io.IOException
public void generateDeclarationChildren(JspJavaWriter out) throws java.io.IOException
java.io.IOException
public void generateTagState(JspJavaWriter out) throws java.lang.Exception
java.lang.Exception
public void generateTagStateChildren(JspJavaWriter out) throws java.lang.Exception
java.lang.Exception
public void generateTagRelease(JspJavaWriter out) throws java.lang.Exception
java.lang.Exception
public void generateTagReleaseChildren(JspJavaWriter out) throws java.lang.Exception
java.lang.Exception
public abstract void generate(JspJavaWriter out) throws java.lang.Exception
out
- the output writer for the generated java.java.lang.Exception
public void generateChildren(JspJavaWriter out) throws java.lang.Exception
out
- the output writer for the generated java.java.lang.Exception
public void generateClassEpilogue(JspJavaWriter out) throws java.io.IOException
out
- the output writer for the generated java.java.io.IOException
public void generateClassEpilogueChildren(JspJavaWriter out) throws java.io.IOException
out
- the output writer for the generated java.java.io.IOException
public void generateStatic(JspJavaWriter out) throws java.lang.Exception
out
- the output writer for the generated java.java.lang.Exception
public void generateEmpty() throws java.lang.Exception
out
- the output writer for the generated java.java.lang.Exception
public void generateChildrenEmpty() throws java.lang.Exception
out
- the output writer for the generated java.java.lang.Exception
protected boolean attributeToBoolean(java.lang.String attr, java.lang.String value) throws JspParseException
JspParseException
public boolean isInFragment()
public JspSegmentNode getSegment()
protected java.lang.String invokeFragment(JspFragmentNode frag) throws java.lang.Exception
java.lang.Exception
protected java.lang.String generateFragment(JspFragmentNode frag, java.lang.String contextVar) throws java.lang.Exception
java.lang.Exception
protected java.lang.String generateParentTag(TagInstance parent) throws java.io.IOException
java.io.IOException
public java.lang.String getJsfVar()
public java.lang.String getJsfBodyVar()
public boolean isJsfParentRequired()
protected void generateIncludeUrl(JspJavaWriter out, java.lang.String page, java.util.ArrayList<JspParam> params) throws java.lang.Exception
java.lang.Exception
protected java.lang.String generateELValue(java.lang.Class<?> type, java.lang.String value) throws java.lang.Exception
java.lang.Exception
public void convertParameterValue(JspJavaWriter out, java.lang.String type, java.lang.String value) throws java.io.IOException
java.io.IOException
protected java.lang.String classToString(java.lang.Class<?> cl)
public boolean hasRuntimeAttribute(java.lang.String value) throws JspParseException
JspParseException
public boolean hasScripting(java.lang.String value)
public boolean hasScripting(JspAttribute value)
public boolean hasELAttribute(java.lang.String value)
public boolean hasDeferredAttribute(java.lang.String value)
public boolean hasELAttribute(java.lang.String value, boolean isELIgnored)
public boolean hasDeferredAttribute(java.lang.String value, boolean isELIgnored)
public java.lang.String getRuntimeAttribute(java.lang.String value) throws java.lang.Exception
java.lang.Exception
protected java.lang.String generateObject(java.lang.Object obj)
public static java.lang.String toELObject(java.lang.String expr, java.lang.Class<?> type)
public static java.lang.String escapeJavaString(java.lang.String s)
protected java.lang.Class loadClass(java.lang.String type) throws JspParseException
JspParseException
protected JspParseException error(java.lang.String msg)
protected JspParseException error(java.lang.String msg, java.lang.Throwable e)
protected JspParseException error(java.lang.Throwable e)
public java.lang.String toString()
toString
in class java.lang.Object