com.ozacc.mail.fetch.impl.sk_jp.io
クラス UnicodeCorrector

java.lang.Object
  上位を拡張 com.ozacc.mail.fetch.impl.sk_jp.io.UnicodeCorrector
直系の既知のサブクラス:
FromCP932Corrector, ToCP932Corrector

public abstract class UnicodeCorrector
extends Object

UnicodeCorrector.

CorrectOutputStreamWriterで用いられる文字列バッファ補正クラスです。
出力エンコーディングによって補正すべき文字コードが異なるので、 実際の補正処理はサブクラスで行います。
対応しているのは以下のコンバータ名です。

バージョン:
$Revision: 1.1.2.1 $ $Date: 2005/01/18 07:20:36 $
作成者:
Shin

コンストラクタの概要
UnicodeCorrector()
           
 
メソッドの概要
static void addCorrector(String enc, Class correctorClass)
          新しいUnicodeCorrectorを追加します。
abstract  char correct(char c)
           
 char[] correct(char[] cbuf, int off, int len)
          Unicode文字配列の補正を行います。
 String correct(String s)
           
static UnicodeCorrector getInstance(String enc)
          Create an UnicodeCorrector that uses the named character encoding.
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

UnicodeCorrector

public UnicodeCorrector()
メソッドの詳細

getInstance

public static UnicodeCorrector getInstance(String enc)
                                    throws UnsupportedEncodingException
Create an UnicodeCorrector that uses the named character encoding.

パラメータ:
enc - Name of the encoding to be used
例外:
UnsupportedEncodingException - If the named encoding is not supported

correct

public char[] correct(char[] cbuf,
                      int off,
                      int len)
Unicode文字配列の補正を行います。

特定の文字を特定エンコーディングで出力しようとした際の sun.ioコンバータでは正常に変換できない部分を補正します。

パラメータ:
cbuf - Buffer of characters
off - Offset from which to start writing characters
len - Number of characters to write
戻り値:
Result that corrected. Note:Return array is different from cbuf in case of different result size.

correct

public String correct(String s)

correct

public abstract char correct(char c)

addCorrector

public static void addCorrector(String enc,
                                Class correctorClass)
新しいUnicodeCorrectorを追加します。

このソースコードを変えずに、動的に新たな出力エンコーディングに 対応したUnicodeCorrectorを登録したい場合に用います。

パラメータ:
enc - 対応するエンコーディング名
correctorClass - UnicodeCorrectorサブクラスのClassオブジェクト


Copyright © 2004-2006 OZACC. All Rights Reserved.