file2xliff4j
Class MifFrameRomanCharset

java.lang.Object
  extended by java.nio.charset.Charset
      extended by file2xliff4j.MifFrameRomanCharset
All Implemented Interfaces:
java.lang.Comparable<java.nio.charset.Charset>

public class MifFrameRomanCharset
extends java.nio.charset.Charset

A Charset implementation that maps between the "7-bit" ASCII (well, it is actually 8-bit ASCII ...) used by FrameMaker's Maker Interchange Format (MIF) to/from Unicode (UTF-8).

Note: This is not applicable to the Asian encodings that are implied by the presence of a MIFEncoding tag in the MIF file.

Author:
Weldon Whipple <weldon@lingotek.com>

Constructor Summary
protected MifFrameRomanCharset(java.lang.String canonical, java.lang.String[] aliases)
          Constructor for the MIF charset.
 
Method Summary
 boolean contains(java.nio.charset.Charset cs)
          Passed a Charset, return true if every character in the specified Charset is representable by the MifFrameRomanCharset.
 java.nio.charset.CharsetDecoder newDecoder()
          Get a decoder for the MifFrameRomanCharset character set.
 java.nio.charset.CharsetEncoder newEncoder()
          Return an encoder that will convert from UTF-8 to the MIF character set.
 
Methods inherited from class java.nio.charset.Charset
aliases, availableCharsets, canEncode, compareTo, decode, defaultCharset, displayName, displayName, encode, encode, equals, forName, hashCode, isRegistered, isSupported, name, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MifFrameRomanCharset

protected MifFrameRomanCharset(java.lang.String canonical,
                               java.lang.String[] aliases)
Constructor for the MIF charset. Call the superclass constructor to pass along the name(s) we'll be known by. Then save a reference to the delegate Charset.

Parameters:
canonical - The canonical name of this character set
aliases - An array of this charset's aliases, or null if it has no aliases.
Method Detail

contains

public boolean contains(java.nio.charset.Charset cs)
Passed a Charset, return true if every character in the specified Charset is representable by the MifFrameRomanCharset. This method must be implemented by concrete Charsets. We always say no, which is safe.

Specified by:
contains in class java.nio.charset.Charset
Parameters:
cs - The Charset that might (or might not--depending on the return value from this method) be a subset of MifFrameRomanCharset.
Returns:
true if, and only if, the given charset is contained in this charset

newDecoder

public java.nio.charset.CharsetDecoder newDecoder()
Get a decoder for the MifFrameRomanCharset character set.

Note: This implementation instantiates an instance of a private class (defined below) and passes it a decoder from the base Charset.

Specified by:
newDecoder in class java.nio.charset.Charset
Returns:
a decoder for the MifFrameRomanCharset charset

newEncoder

public java.nio.charset.CharsetEncoder newEncoder()
Return an encoder that will convert from UTF-8 to the MIF character set. This implementation instantiates an instance of a private class (defined below) and passes it an encoder from the base Charset.

Specified by:
newEncoder in class java.nio.charset.Charset