com.facetmap.format.xml
Class XmlGenerator
java.lang.Object
com.facetmap.format.xml.XmlGenerator
public class XmlGenerator
- extends java.lang.Object
Generates XML output for Facetmaps and Selections. See the
Facetmap XML 2.0.1 DTD
and the
Selection XML DTD
for definitions of this class's output.
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.
|
Field Summary |
protected org.w3c.dom.Document |
doc
|
protected Facetmap |
map
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
map
protected Facetmap map
doc
protected org.w3c.dom.Document doc
XmlGenerator
public XmlGenerator()
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(Facetmap 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(Facetmap facetmap)
modelOf
protected org.w3c.dom.Element modelOf(Facet untypedFacet)
modelOf
protected org.w3c.dom.Element modelOf(CompoundHeadingFacet compoundHeadingFacet)
modelOf
protected org.w3c.dom.Element modelOf(TaxonomyFacet tax)
modelOf
protected org.w3c.dom.Element modelOf(SpectrumFacet spect)
modelOf
protected org.w3c.dom.Element modelOf(DateFacet dateFacet)
modelOf
protected org.w3c.dom.Element modelOf(TaxonomyHeading 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(com.facetmap.format.xml.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)