|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.fu_berlin.ties.ConfigurableProcessor
de.fu_berlin.ties.TextProcessor
de.fu_berlin.ties.DocumentWriter
de.fu_berlin.ties.xml.convert.DSVtoXMLConverter
public class DSVtoXMLConverter
Converts data in DSV format
(or
any other FieldContainer
s) into XML format.
Optionally, all attributes can be omitted.
Instances of this class are not thread-safe and must be synchronized externally, if required (if setter methods are used -- otherwise this class is stateless and can be used to convert multiple documents in parallel).
Field Summary |
---|
Fields inherited from class de.fu_berlin.ties.TextProcessor |
---|
CONFIG_POST, KEY_DIRECTORY, KEY_LOCAL_NAME, KEY_OUT_DIRECTORY, KEY_URL |
Constructor Summary | |
---|---|
DSVtoXMLConverter(String outExt)
Creates a new instance, using the standard configuration. |
|
DSVtoXMLConverter(String outExt,
TiesConfiguration conf)
Creates a new instance. |
|
DSVtoXMLConverter(String outExt,
TiesConfiguration conf,
QName rootElement,
boolean omitAttribs,
QName secondLevelName,
String secondLevelPattern)
Creates a new instance. |
Method Summary | |
---|---|
Document |
convert(FieldContainer data)
Converts a field container into XML. |
QName |
getLevel2Name()
Returns the name of elements inserted as second level; if null , no second level is used. |
QName |
getRootName()
Returns the name used for the root element. |
boolean |
isOmittingAttribs()
Whether attributes are omitted. |
Document |
process(Reader reader,
ContextMap context)
Processes the contents of a reader and stores the results of processing in an XML document. This implementation delegates to convert(FieldContainer) , reading input in
DSV format. |
void |
setLevel2Name(QName newLevel2Name)
Modifies the name of elements to insert as second level; if null , no second level is used. |
void |
setOmittingAttribs(boolean newOmittingAttribs)
Specifies whether to omit attributes. |
String |
toString()
Returns a string representation of this object. |
Methods inherited from class de.fu_berlin.ties.DocumentWriter |
---|
doProcess |
Methods inherited from class de.fu_berlin.ties.TextProcessor |
---|
getOutFileExt, process, process, process, process, process, process |
Methods inherited from class de.fu_berlin.ties.ConfigurableProcessor |
---|
getConfig |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DSVtoXMLConverter(String outExt)
outExt
- the extension to use for output filespublic DSVtoXMLConverter(String outExt, TiesConfiguration conf)
outExt
- the extension to use for output filesconf
- used to configure this instance; must not be
null
public DSVtoXMLConverter(String outExt, TiesConfiguration conf, QName rootElement, boolean omitAttribs, QName secondLevelName, String secondLevelPattern)
outExt
- the extension to use for output filesconf
- used to configure this instance; if null
,
the standard configuration is usedrootElement
- the name of the root elementomitAttribs
- whether to omit all attributessecondLevelName
- the name of elements inserted as second level;
if null
, no second level is usedsecondLevelPattern
- pattern that must be matched for second-level
elements to be createdMethod Detail |
---|
public Document convert(FieldContainer data)
data
- the container to convert
public QName getLevel2Name()
null
, no second level is used.
public QName getRootName()
public boolean isOmittingAttribs()
public Document process(Reader reader, ContextMap context) throws IOException, ProcessingException
convert(FieldContainer)
, reading input in
DSV format.
process
in class DocumentWriter
reader
- reader containing the text to process; not closed
by this methodcontext
- a map of objects that are made available for processing
IOException
- if an I/O error occurs
ProcessingException
- if an error occurs during processingpublic void setLevel2Name(QName newLevel2Name)
null
, no second level is used.
newLevel2Name
- the new value of the attributepublic void setOmittingAttribs(boolean newOmittingAttribs)
newOmittingAttribs
- the new value of the attributepublic String toString()
toString
in class TextProcessor
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |