|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.joost.instruction.AbstractInstruction
net.sf.joost.instruction.NodeBase
public abstract class NodeBase
Abstract base class for all instances of nodes in the STX transformation sheet
Nested Class Summary | |
---|---|
class |
NodeBase.End
Generic class that represents the end of an element in the STX transformation sheet (the end tag). |
Field Summary | |
---|---|
protected AbstractInstruction |
lastChild
The reference to the last child, needed for inserting additional nodes while parsing the transformation sheet. |
protected Stack |
localFieldStack
Stack for storing local fields from this or derived classes |
protected AbstractInstruction |
nodeEnd
The reference to the end instruction. |
NodeBase |
parent
The parent of this node |
boolean |
preserveSpace
true if the attribute xml:space on the
nearest ancestor element was set to preserve ,
false otherwise. |
String |
publicId
The public identifier of the transformation sheet |
String |
qName
The qualified name of this node |
protected Vector |
scopedVariables
The names of local declared variables of this element, available only if this node has stx:variable children |
String |
systemId
The system identifier of the transformation sheet |
Fields inherited from class net.sf.joost.instruction.AbstractInstruction |
---|
colNo, lineNo, next |
Fields inherited from interface net.sf.joost.Constants |
---|
DEBUG, DEFAULT_ENCODING, FEAT_NS, FEAT_NSPREFIX, FEATURE_URI_PREFIX, FUNC_NS, JOOST_EXT_NS, PR_ATTRIBUTES, PR_BUFFER, PR_CHILDREN, PR_CONTINUE, PR_ERROR, PR_SELF, PR_SIBLINGS, STX_NS |
Constructor Summary | |
---|---|
protected |
NodeBase(String qName,
NodeBase parent,
ParseContext context,
boolean mayHaveChildren)
|
Method Summary | |
---|---|
boolean |
compile(int pass,
ParseContext context)
This method may be overwritten to perform compilation tasks (for example optimization) on this node. |
protected void |
declareVariable(String name)
Store the name of a variable as local for this node. |
NodeBase |
getNode()
|
AbstractInstruction |
getNodeEnd()
Getter for nodeEnd used by
Processor.processEvent() . |
void |
insert(NodeBase node)
Insert a new node as a child of this element |
protected void |
mayDropEnd()
Removes (if possible) the end node ( nodeEnd ) of this instruction
from the execution chain. |
protected void |
onDeepCopy(AbstractInstruction copy,
HashMap copies)
Callback that will be called when a clone of this instance has been created. |
short |
process(Context context)
Save local variables if needed. |
boolean |
processable()
|
protected short |
processEnd(Context context)
Called when the end tag will be processed. |
void |
setEndLocation(ParseContext context)
Notify this node about its end location (taken from ParseContext.locator in the context parameter) |
String |
toString()
|
Methods inherited from class net.sf.joost.instruction.AbstractInstruction |
---|
deepCopy, deepHashtableCopy, deepTemplateArrayCopy |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public String qName
public NodeBase parent
protected AbstractInstruction lastChild
protected AbstractInstruction nodeEnd
null
means: must be an empty element.
public String publicId
public String systemId
public boolean preserveSpace
true
if the attribute xml:space
on the
nearest ancestor element was set to preserve
,
false
otherwise. This field is set in the
Parser
object.
protected Vector scopedVariables
protected Stack localFieldStack
Constructor Detail |
---|
protected NodeBase(String qName, NodeBase parent, ParseContext context, boolean mayHaveChildren)
Method Detail |
---|
public final NodeBase getNode()
getNode
in class AbstractInstruction
public void insert(NodeBase node) throws SAXParseException
node
- the node to be inserted
SAXParseException
public final void setEndLocation(ParseContext context)
ParseContext.locator
in the context
parameter)
context
- the current parse contextpublic boolean compile(int pass, ParseContext context) throws SAXException
compile
will be called with a
parameter 0
directly after parsing the node, i.e. after
parsing all children. The invocation with bigger pass
parameters happens not before the whole transformation sheet has been
completely parsed.
pass
- the number of invocations already performed on this nodecontext
- the parse context
true
if another invocation in the next pass is
necessary, false
if the compiling is complete.
This instance returns false
.
SAXException
protected final void mayDropEnd()
nodeEnd
) of this instruction
from the execution chain. May be invoked from
compile(int, ParseContext)
of concrete instructions only if
processEnd(Context)
hasn't been overridden.
protected final void declareVariable(String name)
name
- the variable namepublic boolean processable()
true
if process(net.sf.joost.stx.Context)
can be invoked on this
node, and false
otherwisepublic short process(Context context) throws SAXException
process
in class AbstractInstruction
context
- the current context
Constants.PR_CONTINUE
SAXException
- if an error occurs (in a derived class)protected short processEnd(Context context) throws SAXException
context
- the current context
Constants.PR_CONTINUE
SAXException
- if an error occurs (in a derived class)public final AbstractInstruction getNodeEnd()
nodeEnd
used by
Processor.processEvent()
.
AbstractInstruction
protected void onDeepCopy(AbstractInstruction copy, HashMap copies)
AbstractInstruction
onDeepCopy
in class AbstractInstruction
copy
- the created clonescopies
- the map of already copied objectspublic String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |