|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.ehcache.config.generator.model.AbstractDepthFirstVisitor net.sf.ehcache.config.generator.model.XMLGeneratorVisitor
public class XMLGeneratorVisitor
Implementation of an ElementVisitor extending from AbstractDepthFirstVisitor
which can generate XML out of a NodeElement
.
Accepts a PrintWriter
in the constructor and uses it to output the generated XML.
Output can be controlled by enabling/disabling the various options present in XMLGeneratorVisitor.OutputBehavior
by calling
enableOutputBehavior(OutputBehavior)
or disableOutputBehavior(OutputBehavior)
Nested Class Summary | |
---|---|
static class |
XMLGeneratorVisitor.OutputBehavior
Enum controlling the generated XML output |
Constructor Summary | |
---|---|
XMLGeneratorVisitor(PrintWriter out)
Constructor accepting the PrintWriter . |
Method Summary | |
---|---|
void |
disableAllOutputBehaviors()
Disables all output behaviors |
void |
disableOutputBehavior(XMLGeneratorVisitor.OutputBehavior behavior)
Disables one particular XMLGeneratorVisitor.OutputBehavior |
void |
enableAllOutputBehaviors()
Enables all output behaviors |
void |
enableOutputBehavior(XMLGeneratorVisitor.OutputBehavior behavior)
Enables one particular XMLGeneratorVisitor.OutputBehavior |
protected void |
endAttributes(NodeElement element)
Finish visiting attributes of the element. |
protected void |
endChildren(NodeElement element)
Finish visiting children of the element. |
protected void |
endElement(NodeElement element)
Finish visiting the element. |
boolean |
isOutputBehaviorEnabled(XMLGeneratorVisitor.OutputBehavior behavior)
Returns true if the output behavior is enabled |
protected void |
startAttributes(NodeElement element)
Starts visiting the attributes of the element. |
protected void |
startChildren(NodeElement element)
Starts visiting children of the element. |
protected void |
startElement(NodeElement element)
Starts visiting an element. |
protected void |
visitAttribute(NodeElement element,
NodeAttribute attribute)
Visits an attribute. |
protected void |
visitAttributes(NodeElement element,
List<NodeAttribute> attributes)
Visits the attributes of the element. |
protected void |
visitElement(NodeElement element)
Visits the element. |
Methods inherited from class net.sf.ehcache.config.generator.model.AbstractDepthFirstVisitor |
---|
visit |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XMLGeneratorVisitor(PrintWriter out)
PrintWriter
. All output behaviors are enabled by default.
out
- the PrintWriter
Method Detail |
---|
public void enableAllOutputBehaviors()
public void disableAllOutputBehaviors()
public void enableOutputBehavior(XMLGeneratorVisitor.OutputBehavior behavior)
XMLGeneratorVisitor.OutputBehavior
behavior
- public void disableOutputBehavior(XMLGeneratorVisitor.OutputBehavior behavior)
XMLGeneratorVisitor.OutputBehavior
behavior
- public boolean isOutputBehaviorEnabled(XMLGeneratorVisitor.OutputBehavior behavior)
behavior
- the output behavior to inspect
protected void startElement(NodeElement element)
startElement
in class AbstractDepthFirstVisitor
element
- the elementprotected void startAttributes(NodeElement element)
startAttributes
in class AbstractDepthFirstVisitor
element
- the elementprotected void visitAttributes(NodeElement element, List<NodeAttribute> attributes)
visitAttributes
in class AbstractDepthFirstVisitor
element
- the elementattributes
- the attributesprotected void visitAttribute(NodeElement element, NodeAttribute attribute)
element
- attribute
- protected void endAttributes(NodeElement element)
endAttributes
in class AbstractDepthFirstVisitor
element
- the elementprotected void visitElement(NodeElement element)
visitElement
in class AbstractDepthFirstVisitor
element
- the elementprotected void startChildren(NodeElement element)
startChildren
in class AbstractDepthFirstVisitor
element
- the elementprotected void endChildren(NodeElement element)
endChildren
in class AbstractDepthFirstVisitor
element
- the elementprotected void endElement(NodeElement element)
endElement
in class AbstractDepthFirstVisitor
element
- the element
|
ehcache | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |