|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.writersforge.catalan.process.workers.xml.DirectiveStack
Format specification for placing Java Objects into a Datum tree.
| Nested Class Summary | |
static class |
DirectiveStack.Attribute
A Directive to create a new attribute (Datum property) inside the current element. |
static class |
DirectiveStack.Directive
A single operation to perform on a node while creating a Bellows Datum tree from a list of nodes. |
static class |
DirectiveStack.EndElement
A Directive to close the current element. |
static class |
DirectiveStack.Pcdata
A Directive to insert PCDATA content into the current element. |
static class |
DirectiveStack.Repeat
A Directive to repeat an embedded stack of directives until a certain condition is met. |
static class |
DirectiveStack.StartElement
A Directive to start a new Datum element. |
| Constructor Summary | |
DirectiveStack()
Creates a new instance of DirectiveStack. |
|
DirectiveStack(int maxCycles,
java.lang.Object untilNode)
Creates a new instance of DirectiveStack with optional maximum iterations and an input node to trigger a premature bailout. |
|
| Method Summary | |
void |
addDirective(DirectiveStack.Directive directive)
Adds a formatting Directive to the end of the stack. |
DirectiveStack.Directive |
getNextDirective(java.lang.Object node)
Retrieves the next Directive in the stack. |
boolean |
isFinished()
Determines if the stack has reached the end of its run. |
static DirectiveStack |
loadXmlStack(org.writersforge.bellows.Datum[] directives)
Factory method for creating a stack from an XML document. |
void |
reset()
Initializes the stack to its initial state. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DirectiveStack()
public DirectiveStack(int maxCycles,
java.lang.Object untilNode)
maxCycles - the maximum number of times the stack should be
processed from start to finishuntilNode - the "bail out" node| Method Detail |
public void addDirective(DirectiveStack.Directive directive)
directive - the next Directive to run in the stackpublic DirectiveStack.Directive getNextDirective(java.lang.Object node)
node - the current node being processed; used to check for
'until-node' matches
public boolean isFinished()
public void reset()
public static DirectiveStack loadXmlStack(org.writersforge.bellows.Datum[] directives)
Factory method for creating a stack from an XML document. Converts XML
elements into Directive instances. The <repeat> element can
contain other XML directives, which it will iterate through depending
on its own parameters (if count is set, or the input data
stream (if until-node is set). The XML directives map to
Directive constructors like this:
new DirectiveStack.StartElement()
new DirectiveStack.StartElement("static-name")
new DirectiveStack.EndElement()
new DirectiveStack.Attribute(null, null)
new DirectiveStack.Attribute("static-name", null)
new DirectiveStack.Attribute(null, "static-value")
new DirectiveStack.Attribute("static-name", "static-value")
new DirectiveStack.Pcdata(null)
new DirectiveStack.Pcdata("PCDATA CONTENT")
new DirectiveStack.Repeat(new DirectiveStack(1, null))
new DirectiveStack.Repeat(new DirectiveStack(5, null))
new DirectiveStack.Repeat(new DirectiveStack(Integer.MAX_VALUE, "END"))
directives - an array of XML directives as described above
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||