Nux 1.6

nux.xom.sandbox
Class MulticastNodeFactory

java.lang.Object
  extended by nu.xom.NodeFactory
      extended by nux.xom.sandbox.MulticastNodeFactory

public final class MulticastNodeFactory
extends NodeFactory

Streams input into one or more independent underlying node factories.

Author:
whoschek.AT.lbl.DOT.gov, $Author: hoschek3 $

Nested Class Summary
static class MulticastNodeFactory.MultipleCausesException
          A RuntimeException containing an array of one or more causes (Throwables).
 
Constructor Summary
MulticastNodeFactory(NodeFactory[] receivers, boolean failFast)
          Constructs a new instance.
 
Method Summary
 void finishMakingDocument(Document doc)
          
 Nodes finishMakingElement(Element unused)
          
 Document[] getDocuments()
          Returns the document build for each of the factories.
 Nodes makeAttribute(String qname, String namespaceURI, String value, Attribute.Type type)
          
 Nodes makeComment(String data)
          
 Nodes makeDocType(String rootElementName, String publicID, String systemID)
          
 Nodes makeProcessingInstruction(String target, String data)
          
 Element makeRootElement(String qname, String namespaceURI)
          
 Nodes makeText(String text)
          
 Document startMakingDocument()
          
 Element startMakingElement(String qname, String namespaceURI)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MulticastNodeFactory

public MulticastNodeFactory(NodeFactory[] receivers,
                            boolean failFast)
Constructs a new instance. In failFast mode fails immediately when at least one child throws an exception. Otherwise continues to stream into the remaining working factories and reports all collected failures on finishMakingDocument().

Parameters:
receivers - the child factories to push into
failFast - whether or not to immediately report an exception on the first child failure
Method Detail

getDocuments

public Document[] getDocuments()
Returns the document build for each of the factories.


startMakingDocument

public Document startMakingDocument()

Overrides:
startMakingDocument in class NodeFactory

finishMakingDocument

public void finishMakingDocument(Document doc)

Overrides:
finishMakingDocument in class NodeFactory

makeRootElement

public Element makeRootElement(String qname,
                               String namespaceURI)

Overrides:
makeRootElement in class NodeFactory

startMakingElement

public Element startMakingElement(String qname,
                                  String namespaceURI)

Overrides:
startMakingElement in class NodeFactory

finishMakingElement

public Nodes finishMakingElement(Element unused)

Overrides:
finishMakingElement in class NodeFactory

makeAttribute

public Nodes makeAttribute(String qname,
                           String namespaceURI,
                           String value,
                           Attribute.Type type)

Overrides:
makeAttribute in class NodeFactory

makeComment

public Nodes makeComment(String data)

Overrides:
makeComment in class NodeFactory

makeDocType

public Nodes makeDocType(String rootElementName,
                         String publicID,
                         String systemID)

Overrides:
makeDocType in class NodeFactory

makeProcessingInstruction

public Nodes makeProcessingInstruction(String target,
                                       String data)

Overrides:
makeProcessingInstruction in class NodeFactory

makeText

public Nodes makeText(String text)

Overrides:
makeText in class NodeFactory

Nux 1.6