com.facetmap.simple
Class XmlGenerator

java.lang.Object
  extended bycom.facetmap.simple.XmlGenerator

public class XmlGenerator
extends java.lang.Object

Contains XML output functionality. This is a stateful generator, so all output methods are synchronized. Typically you should create a new XmlGenerator for each output task. If you extend this class, new methods that create Document objects should synchronize on this XmlGenerator object. Methods that build Elements should not be synchronized, but they should only be called by other Element-builders and the synchronized Document-builders. That's why they're protected.


Nested Class Summary
static class XmlGenerator.HeadingRef
           
 
Field Summary
protected  org.w3c.dom.Document doc
           
protected  Map map
           
 
Constructor Summary
XmlGenerator()
           
 
Method Summary
 org.w3c.dom.Document documentOf(java.lang.Exception exc)
           
 org.w3c.dom.Document documentOf(Map facetmap)
           
 org.w3c.dom.Document documentOf(Selection s)
           
static XMLSerializer getDataOnlySerializer(java.io.Writer w)
           
static XMLSerializer getDefaultSerializer(java.io.Writer w)
           
 org.w3c.dom.Element modelOf(java.lang.Exception exc)
           
protected  org.w3c.dom.Element modelOf(Resource r)
           
 org.w3c.dom.Element modelOf(Selection s)
           
protected  org.w3c.dom.Element modelOf(Spectrum spect)
           
protected  org.w3c.dom.Element modelOf(SpectrumHeading h)
           
protected  org.w3c.dom.Element modelOf(TaxonomicHeading h)
           
protected  org.w3c.dom.Element modelOf(Taxonomy tax)
           
protected  org.w3c.dom.Element modelOf(XmlGenerator.HeadingRef fr)
           
 void outputDocument(org.w3c.dom.Document d, java.io.Writer w)
           
 void outputDocumentElement(org.w3c.dom.Document d, java.io.Writer w)
           
 void outputException(java.lang.Exception exc, java.io.Writer w)
           
 void outputMap(Map m, java.io.Writer w)
           
 void outputSelection(Selection s, java.io.Writer w)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

map

protected Map map

doc

protected org.w3c.dom.Document doc
Constructor Detail

XmlGenerator

public XmlGenerator()
Method Detail

getDefaultSerializer

public static XMLSerializer getDefaultSerializer(java.io.Writer w)

getDataOnlySerializer

public static XMLSerializer getDataOnlySerializer(java.io.Writer w)

outputDocument

public void outputDocument(org.w3c.dom.Document d,
                           java.io.Writer w)
                    throws java.io.IOException
Throws:
java.io.IOException

outputDocumentElement

public void outputDocumentElement(org.w3c.dom.Document d,
                                  java.io.Writer w)
                           throws java.io.IOException
Throws:
java.io.IOException

outputMap

public void outputMap(Map m,
                      java.io.Writer w)
               throws java.io.IOException,
                      DataException,
                      InternalException
Throws:
java.io.IOException
DataException
InternalException

outputSelection

public void outputSelection(Selection s,
                            java.io.Writer w)
                     throws java.io.IOException,
                            DataException,
                            InternalException
Throws:
java.io.IOException
DataException
InternalException

outputException

public void outputException(java.lang.Exception exc,
                            java.io.Writer w)
                     throws java.io.IOException
Throws:
java.io.IOException

documentOf

public org.w3c.dom.Document documentOf(Map facetmap)

modelOf

protected org.w3c.dom.Element modelOf(Taxonomy tax)

modelOf

protected org.w3c.dom.Element modelOf(Spectrum spect)

modelOf

protected org.w3c.dom.Element modelOf(TaxonomicHeading h)

modelOf

protected org.w3c.dom.Element modelOf(SpectrumHeading h)

modelOf

protected org.w3c.dom.Element modelOf(Resource r)

modelOf

protected org.w3c.dom.Element modelOf(XmlGenerator.HeadingRef fr)

modelOf

public org.w3c.dom.Element modelOf(Selection s)
                            throws DataException,
                                   InternalException
Throws:
DataException
InternalException

modelOf

public org.w3c.dom.Element modelOf(java.lang.Exception exc)

documentOf

public org.w3c.dom.Document documentOf(Selection s)
                                throws DataException,
                                       InternalException
Throws:
DataException
InternalException

documentOf

public org.w3c.dom.Document documentOf(java.lang.Exception exc)