org.opensync.engine.server.adapter
Class Translator

java.lang.Object
  extended byorg.xml.sax.helpers.DefaultHandler
      extended byorg.opensync.engine.server.adapter.Translator
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler
Direct Known Subclasses:
EdiX128402Xml, Txt2Xml, Xml2EdiX12840, Xml2Txt

public class Translator
extends org.xml.sax.helpers.DefaultHandler

Titre : OpenSync Description : This class is the base class of Xml2Txt and Txt2Xml classes. These classes translates XML files to text files and text files to XML files respectively. The text files may be tag separated values files or fixe size columns files. An XML file called descriptor is read before translation to initialize the fields of the translator.


Field Summary
protected  boolean append
           
protected  java.util.List colNames
           
protected  java.lang.String delimiter
           
protected static java.lang.String DESCRIPTION
           
protected  java.lang.String document_element
           
protected  java.lang.String documentElementTag
           
protected  java.util.ArrayList endColumns
           
protected static java.lang.String FATAL
           
 java.util.List fields
           
protected static java.lang.String LINE_NUMBER
           
protected  java.lang.String linebreak
           
protected  java.lang.String lineBreakMarker
           
protected static java.lang.String MISSING_LAST_FIELD
           
protected  int nfields
           
protected static java.lang.String NONFATAL
           
protected static java.lang.String OFF_WIDTH_ROW
           
protected  boolean offWidthOK
           
protected  boolean pretty_print
           
protected  boolean prettyPrint
           
protected  boolean remove_file
           
protected  java.lang.String row_element
           
protected  java.lang.String rowElementTag
           
protected static java.lang.String SEVERITY
           
protected  int skipfirstlines
           
protected  int skiplastlines
           
protected  java.util.ArrayList startColumns
           
protected  java.lang.String starting_offset
           
protected  int startingOffset
           
protected  boolean suppressquotes
           
protected  boolean toCSV
           
protected  java.lang.String trim_columns
           
protected  boolean trimFields
           
protected  java.lang.String type
           
protected static java.lang.String UNTERMINATED_ROW
           
 
Constructor Summary
Translator()
           
 
Method Summary
static java.lang.String checkSpecialChar(java.lang.String in, char c, java.lang.String replace)
           
static java.lang.String checkSpecialCharXml(java.lang.String s)
           
 boolean getAppend()
           
 boolean getRemove_file()
           
protected  long linesCounter(java.io.Reader input)
           
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

type

protected java.lang.String type

append

protected boolean append

remove_file

protected boolean remove_file

suppressquotes

protected boolean suppressquotes

delimiter

protected java.lang.String delimiter

skipfirstlines

protected int skipfirstlines

skiplastlines

protected int skiplastlines

nfields

protected int nfields

row_element

protected java.lang.String row_element

document_element

protected java.lang.String document_element

trim_columns

protected java.lang.String trim_columns

linebreak

protected java.lang.String linebreak

pretty_print

protected boolean pretty_print

starting_offset

protected java.lang.String starting_offset

FATAL

protected static final java.lang.String FATAL
See Also:
Constant Field Values

NONFATAL

protected static final java.lang.String NONFATAL
See Also:
Constant Field Values

SEVERITY

protected static final java.lang.String SEVERITY
See Also:
Constant Field Values

DESCRIPTION

protected static final java.lang.String DESCRIPTION
See Also:
Constant Field Values

UNTERMINATED_ROW

protected static final java.lang.String UNTERMINATED_ROW
See Also:
Constant Field Values

OFF_WIDTH_ROW

protected static final java.lang.String OFF_WIDTH_ROW
See Also:
Constant Field Values

MISSING_LAST_FIELD

protected static final java.lang.String MISSING_LAST_FIELD
See Also:
Constant Field Values

LINE_NUMBER

protected static final java.lang.String LINE_NUMBER
See Also:
Constant Field Values

offWidthOK

protected boolean offWidthOK

trimFields

protected boolean trimFields

lineBreakMarker

protected java.lang.String lineBreakMarker

documentElementTag

protected java.lang.String documentElementTag

rowElementTag

protected java.lang.String rowElementTag

startingOffset

protected int startingOffset

prettyPrint

protected boolean prettyPrint

toCSV

protected boolean toCSV

colNames

protected java.util.List colNames

fields

public java.util.List fields

startColumns

protected java.util.ArrayList startColumns

endColumns

protected java.util.ArrayList endColumns
Constructor Detail

Translator

public Translator()
Method Detail

getAppend

public boolean getAppend()

getRemove_file

public boolean getRemove_file()

checkSpecialCharXml

public static java.lang.String checkSpecialCharXml(java.lang.String s)

checkSpecialChar

public static java.lang.String checkSpecialChar(java.lang.String in,
                                                char c,
                                                java.lang.String replace)

linesCounter

protected long linesCounter(java.io.Reader input)
                     throws java.io.IOException
Throws:
java.io.IOException


Copyright © 2004 sourceforge. All Rights Reserved.