file2xliff4j
Class HtmlSkeletonMerger

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

public class HtmlSkeletonMerger
extends java.lang.Object
implements SkeletonMerger

This class merges the following:

  1. The pseudoSkeleton stream generated as XLIFF is created from XML.
  2. The original HTML stream from which the XLIFF was created. It outputs a final Skeleton file that can be used to generate HTML from XLIFF.

    Author:
    Weldon Whipple <weldon@lingotek.com>

    Constructor Summary
    HtmlSkeletonMerger()
              Constructor for the skeleton merger object
     
    Method Summary
     void merge(java.io.InputStream tSkelInStream, java.io.InputStream htmlInStream, java.io.OutputStream skeletonOutStream, java.nio.charset.Charset encoding)
              Create a skeleton file from the pseudo skeleton and the original html.
     void merge(java.io.InputStream tSkelInStream, java.io.InputStream htmlInStream, java.io.OutputStream skeletonOutStream, java.nio.charset.Charset encoding, int maxTuDepth)
              Create a skeleton file from the pseudo skeleton and the original html.
     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

    HtmlSkeletonMerger

    public HtmlSkeletonMerger()
    Constructor for the skeleton merger object

    Method Detail

    merge

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

    Specified by:
    merge in interface SkeletonMerger
    Parameters:
    tSkelInStream - The intermediate skeleton we will read from
    htmlInStream - The original HTML to read from and merge with
    skeletonOutStream - Where I write the new skeleton
    encoding - The encoding used by the html
    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 htmlInStream,
                      java.io.OutputStream skeletonOutStream,
                      java.nio.charset.Charset encoding,
                      int maxTuDepth)
               throws java.lang.IllegalArgumentException,
                      java.io.IOException
    Create a skeleton file from the pseudo skeleton and the original html.

    Specified by:
    merge in interface SkeletonMerger
    Parameters:
    tSkelInStream - The intermediate skeleton we will read from
    htmlInStream - The original HTML to read from and merge with
    skeletonOutStream - Where I write the new skeleton
    encoding - The encoding used by the html
    maxTuDepth - The maximum depth to which TUs are imbedded within other TUs. (Not used in HTML format)
    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.