file2xliff4j
Class XMLSkeletonMerger

java.lang.Object
  extended by file2xliff4j.XMLSkeletonMerger
All Implemented Interfaces:
SkeletonMerger

public class XMLSkeletonMerger
extends java.lang.Object
implements SkeletonMerger

This class merges the following:

  1. The pseudoSkeleton stream generated as XLIFF is created from the original XML input.
  2. The original XML stream from which the XLIFF was created. It outputs a final Skeleton file that can be used to generate the original XML (with modified/added targets) XLIFF.

    Author:
    Weldon Whipple <weldon@lingotek.com>

    Constructor Summary
    XMLSkeletonMerger()
              Constructor for the skeleton merger object
     
    Method Summary
     void merge(java.io.InputStream tSkelInStream, java.io.InputStream xmlInStream, java.io.OutputStream skeletonOutStream, java.nio.charset.Charset encoding)
              Create a skeleton file from the temporary skeleton and the original XML.
     void merge(java.io.InputStream tSkelInStream, java.io.InputStream xmlInStream, java.io.OutputStream skeletonOutStream, java.nio.charset.Charset encoding, int maxTuDepth)
              Create a skeleton file from the temporary skeleton and the original XML.
     void setProperty(java.lang.String property, java.lang.Object value)
              Set a format-specific property that might affect the way that the merger process is conducted.
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    XMLSkeletonMerger

    public XMLSkeletonMerger()
    Constructor for the skeleton merger object

    Method Detail

    merge

    public void merge(java.io.InputStream tSkelInStream,
                      java.io.InputStream xmlInStream,
                      java.io.OutputStream skeletonOutStream,
                      java.nio.charset.Charset encoding,
                      int maxTuDepth)
               throws java.lang.IllegalArgumentException,
                      java.io.IOException
    Create a skeleton file from the temporary skeleton and the original XML.

    Specified by:
    merge in interface SkeletonMerger
    Parameters:
    tSkelInStream - The intermediate skeleton we will read from
    xmlInStream - The original XML to read from and merge with
    skeletonOutStream - Where I write the new skeleton
    encoding - The encoding used by the XML
    maxTuDepth - The maximum depth to which TUs are imbedded within other TUs. (Ignored for this merger.)
    Throws:
    java.util.IllegalArgumentException - if an argument is bogus or non-existent
    java.io.IOException - if an I/O error occurs.
    java.lang.IllegalArgumentException

    merge

    public void merge(java.io.InputStream tSkelInStream,
                      java.io.InputStream xmlInStream,
                      java.io.OutputStream skeletonOutStream,
                      java.nio.charset.Charset encoding)
               throws java.lang.IllegalArgumentException,
                      java.io.IOException
    Create a skeleton file from the temporary skeleton and the original XML.

    Specified by:
    merge in interface SkeletonMerger
    Parameters:
    tSkelInStream - The intermediate skeleton we will read from
    xmlInStream - The original XML to read from and merge with
    skeletonOutStream - Where I write the new skeleton
    encoding - The encoding used by the XML
    Throws:
    java.util.IllegalArgumentException - if an argument is bogus or non-existent
    java.io.IOException - if an I/O error occurs.
    java.lang.IllegalArgumentException

    setProperty

    public void setProperty(java.lang.String property,
                            java.lang.Object value)
                     throws ConversionException
    Set a format-specific property that might affect the way that the merger process is conducted.

    Specified by:
    setProperty in interface SkeletonMerger
    Parameters:
    property - The name of the property
    value - The value of the property
    Throws:
    ConversionException - If the property or value can't be recognized.