public abstract class XslNode
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.util.ArrayList<XslNode> |
_children |
protected int |
_endLine |
protected java.lang.String |
_filename |
protected JavaGenerator |
_gen |
protected NamespaceContext |
_matchNamespace |
protected QName |
_name |
protected NamespaceContext |
_outputNamespace |
protected XslNode |
_parent |
protected int |
_startLine |
protected java.lang.String |
_systemId |
Modifier | Constructor and Description |
---|---|
protected |
XslNode() |
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(QName name,
java.lang.String value)
Adds an attribute.
|
void |
addChild(XslNode node)
Adds a child node.
|
protected int |
addExpr(java.lang.String pattern) |
protected void |
addNamespaceAttribute(QName name,
java.lang.String url)
Adds an attribute.
|
void |
addText(java.lang.String text)
Adds text.
|
void |
addVariableCount()
Add variable.
|
protected boolean |
allowJavaSelect(AbstractPattern select)
Returns true if we can compile in the java select.
|
void |
endAttributes()
Called after all the attributes from the tag.
|
void |
endElement()
Called when the tag closes.
|
protected XslParseException |
error(java.lang.String msg)
Creates a parse exception with the proper line information.
|
protected XslParseException |
error(java.lang.Throwable e)
Creates a parse exception with the proper line information.
|
java.lang.String |
escapeJavaString(java.lang.String s) |
abstract void |
generate(JavaWriter out)
Generates the code for the tag
|
void |
generateChildren(JavaWriter out)
Generates the code for the children.
|
void |
generateDeclaration(JavaWriter out)
Generates the prelude code for the tag
|
void |
generateDeclarationChildren(JavaWriter out)
Generates the declaration code for the children.
|
protected int |
generateId() |
java.lang.String |
getBaseURI()
Returns the base URI.
|
java.util.ArrayList<XslNode> |
getChildren()
Returns the children.
|
int |
getEndLine()
Gets the ending line number
|
protected java.lang.String |
getEnv() |
java.lang.String |
getFilename()
Gets the filename of the node
|
NamespaceContext |
getMatchNamespace()
Returns the namespaces.
|
java.lang.String |
getNamespace(java.lang.String prefix)
Returns the matching node in the namespace.
|
NamespaceContext |
getOutputNamespace()
Returns the namespaces.
|
XslNode |
getParent()
Returns the parent node.
|
QName |
getQName()
Returns the qname of the node.
|
int |
getStartLine()
Gets the starting line number
|
java.lang.String |
getSystemId()
Gets the system id of the node
|
java.lang.String |
getTagName()
Returns the qname of the node.
|
boolean |
hasChildren()
Returns true if there are any children.
|
protected Expr |
parseExpr(java.lang.String pattern)
Parses an XPath expression in the current context.
|
AbstractPattern |
parseMatch(java.lang.String pattern) |
protected AbstractPattern |
parseSelect(java.lang.String pattern) |
protected void |
popCall(JavaWriter out) |
protected void |
popScope(JavaWriter out) |
protected void |
printAttributeValue(JavaWriter out,
java.lang.String value)
Prints an attribute value.
|
protected void |
printAttributeValue(JavaWriter out,
java.lang.String name,
java.lang.String value)
Prints an attribute value.
|
protected void |
printExprTest(JavaWriter out,
int id,
java.lang.String node)
Prints a test expr.
|
protected void |
printFragmentString(JavaWriter out,
java.lang.String id)
Prints the children as a fragment stored in a variable.
|
protected void |
printFragmentValue(JavaWriter out,
java.lang.String id)
Prints the children as a fragment stored in a variable.
|
protected void |
printNamespace(JavaWriter out,
NamespaceContext namespace) |
protected void |
printPopScope(JavaWriter out) |
protected java.lang.String |
printSelectBegin(JavaWriter out,
AbstractPattern select,
boolean isForEach,
java.lang.String loopVar)
Prints iterator code to start a select.
|
protected void |
printStringExpr(JavaWriter out,
java.lang.String exprString)
Prints a value-of expression
|
protected void |
pushCall(JavaWriter out) |
void |
setEndLocation(java.lang.String filename,
int line)
Sets the end location of the node.
|
void |
setGenerator(JavaGenerator gen)
Sets the Java generator.
|
void |
setParent(XslNode parent)
Sets the parent node
|
void |
setQName(QName name)
Sets the node's qname
|
void |
setStartLocation(java.lang.String systemId,
java.lang.String filename,
int line)
Sets the start location of the node.
|
protected void |
stringExpr(JavaWriter out,
java.lang.String exprString) |
java.lang.String |
toString()
Returns a printable version of the node.
|
protected java.lang.String _systemId
protected java.lang.String _filename
protected int _startLine
protected int _endLine
protected JavaGenerator _gen
protected QName _name
protected XslNode _parent
protected java.util.ArrayList<XslNode> _children
protected NamespaceContext _matchNamespace
protected NamespaceContext _outputNamespace
public void setGenerator(JavaGenerator gen)
public QName getQName()
public void setQName(QName name)
public java.lang.String getTagName()
public XslNode getParent()
public void setParent(XslNode parent)
public void addVariableCount()
public void setStartLocation(java.lang.String systemId, java.lang.String filename, int line)
public void setEndLocation(java.lang.String filename, int line)
public java.lang.String getSystemId()
public java.lang.String getFilename()
public int getStartLine()
public int getEndLine()
public java.lang.String getBaseURI()
public NamespaceContext getMatchNamespace()
public NamespaceContext getOutputNamespace()
public java.lang.String getNamespace(java.lang.String prefix)
public void addAttribute(QName name, java.lang.String value) throws XslParseException
XslParseException
protected void addNamespaceAttribute(QName name, java.lang.String url) throws XslParseException
XslParseException
public void endAttributes() throws XslParseException
XslParseException
public void addText(java.lang.String text) throws XslParseException
XslParseException
public void addChild(XslNode node) throws XslParseException
XslParseException
public void endElement() throws java.lang.Exception
java.lang.Exception
public java.util.ArrayList<XslNode> getChildren()
public boolean hasChildren()
public abstract void generate(JavaWriter out) throws java.lang.Exception
out
- the output writer for the generated java.java.lang.Exception
public void generateChildren(JavaWriter out) throws java.lang.Exception
out
- the output writer for the generated java.java.lang.Exception
public void generateDeclaration(JavaWriter out) throws java.lang.Exception
out
- the output writer for the generated java.java.lang.Exception
public void generateDeclarationChildren(JavaWriter out) throws java.lang.Exception
out
- the output writer for the generated java.java.lang.Exception
protected void printAttributeValue(JavaWriter out, java.lang.String name, java.lang.String value) throws java.lang.Exception
java.lang.Exception
protected void printAttributeValue(JavaWriter out, java.lang.String value) throws java.lang.Exception
java.lang.Exception
protected void printStringExpr(JavaWriter out, java.lang.String exprString) throws java.lang.Exception
java.lang.Exception
protected void stringExpr(JavaWriter out, java.lang.String exprString) throws java.lang.Exception, XslParseException
java.lang.Exception
XslParseException
protected void pushCall(JavaWriter out) throws java.io.IOException
java.io.IOException
protected void popCall(JavaWriter out) throws java.io.IOException
java.io.IOException
protected java.lang.String printSelectBegin(JavaWriter out, AbstractPattern select, boolean isForEach, java.lang.String loopVar) throws java.io.IOException, XslParseException
java.io.IOException
XslParseException
protected boolean allowJavaSelect(AbstractPattern select)
protected void printNamespace(JavaWriter out, NamespaceContext namespace) throws java.lang.Exception
java.lang.Exception
protected void printFragmentString(JavaWriter out, java.lang.String id) throws java.lang.Exception
java.lang.Exception
protected void printFragmentValue(JavaWriter out, java.lang.String id) throws java.lang.Exception
java.lang.Exception
protected void popScope(JavaWriter out) throws java.lang.Exception
java.lang.Exception
protected void printPopScope(JavaWriter out) throws java.lang.Exception
java.lang.Exception
protected void printExprTest(JavaWriter out, int id, java.lang.String node) throws java.io.IOException
java.io.IOException
public AbstractPattern parseMatch(java.lang.String pattern) throws XslParseException, java.io.IOException
XslParseException
java.io.IOException
protected AbstractPattern parseSelect(java.lang.String pattern) throws XslParseException
XslParseException
protected int addExpr(java.lang.String pattern) throws XslParseException
XslParseException
protected Expr parseExpr(java.lang.String pattern) throws XslParseException
XslParseException
protected int generateId()
protected java.lang.String getEnv()
public java.lang.String escapeJavaString(java.lang.String s)
protected XslParseException error(java.lang.String msg)
protected XslParseException error(java.lang.Throwable e)
public java.lang.String toString()
toString
in class java.lang.Object