file2xliff4j
Class Format

java.lang.Object
  extended by file2xliff4j.Format

public class Format
extends java.lang.Object

Class to encapsulate the format file generated along with the XLIFF file that represents a document stored in LingoDoc. (The format file currently maps bx/ex/x tags back to their original HTML, ODF, etc. tags.)

Author:
Weldon Whipple <weldon@lingotek.com>

Field Summary
protected static int BLKSIZE
           
 
Constructor Summary
Format(java.io.InputStream inStream)
          Create a new instance of Format
Format(java.lang.String fileName)
          Create a new instance of Format, taking a file name as input
 
Method Summary
 java.lang.String getReplacement(java.lang.String tagID)
          Passed the identifier of a bx, ex (or perhaps some other tag), return the text that the tag identifier maps to in the format file.
 java.lang.String getReplacement(java.lang.String tagID, boolean prependLT)
          Passed the identifier of a bx, ex (or perhaps some other tag), return the text that the tag identifier maps to in the format file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BLKSIZE

protected static final int BLKSIZE
See Also:
Constant Field Values
Constructor Detail

Format

public Format(java.lang.String fileName)
       throws java.io.FileNotFoundException,
              java.io.IOException
Create a new instance of Format, taking a file name as input

Parameters:
fileName - Name of file that contains the format information
Throws:
java.io.FileNotFoundException
java.io.IOException

Format

public Format(java.io.InputStream inStream)
       throws java.io.IOException
Create a new instance of Format

Parameters:
inStream - The input stream with the format information
Throws:
java.io.IOException
Method Detail

getReplacement

public java.lang.String getReplacement(java.lang.String tagID,
                                       boolean prependLT)
Passed the identifier of a bx, ex (or perhaps some other tag), return the text that the tag identifier maps to in the format file.

Parameters:
tagID - The identifier of the XLIFF tag who's substitution value is being requested
prependLT - true: prepend a '<' value before the value (if the value's length is greater than 0; false: Return the actual value from the format file with no modifications.
Returns:
The actual value found in the original document

getReplacement

public java.lang.String getReplacement(java.lang.String tagID)
Passed the identifier of a bx, ex (or perhaps some other tag), return the text that the tag identifier maps to in the format file.

Parameters:
tagID - The identifier of the XLIFF tag who's substitution value is being requested
Returns:
The value to which the bx/ex/x tag maps.