com.ozacc.mail.impl
クラス XMLMailBuilderImpl

java.lang.Object
  拡張com.ozacc.mail.impl.XMLMailBuilderImpl
すべての実装インタフェース:
MailBuilder
直系の既知のサブクラス:
XMLVelocityMailBuilderImpl

public class XMLMailBuilderImpl
extends Object
implements MailBuilder

メールデータのXMLファイルからMailインスタンスを生成するクラス。

ソースXMLを読み込む際に、DTDバリデーションが実行されますので妥当なXMLデータ(Valid XML Document)でなければいけません。 メールデータXMLのDTDは、http://www.ozacc.com/library/dtd/ozacc-mail.dtdを参照。

導入されたバージョン:
1.0.1
バージョン:
$Id: XMLMailBuilderImpl.java,v 1.1 2004/09/13 07:07:11 otsuka Exp $
作成者:
Tomohiro Otsuka

コンストラクタの概要
XMLMailBuilderImpl()
           
 
メソッドの概要
protected  Mail build(Document doc)
          DOM DocumentからMailインスタンスを生成します。
 Mail buildMail(File file)
          指定されたファイルを読み込んでMailインスタンスを生成します。
 Mail buildMail(String classPath)
          指定されたクラスパス上のファイルを読み込んでMailインスタンスを生成します。
protected  DocumentBuilder createDocumentBuilder()
           
protected  Document getDocumentFromClassPath(String classPath)
           
protected  Document getDocumentFromFile(File file)
          DocumentBuilderはスレッドセーフではないため、同期メソッドに。
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

XMLMailBuilderImpl

public XMLMailBuilderImpl()
メソッドの詳細

buildMail

public Mail buildMail(String classPath)
               throws MailBuildException
インタフェース MailBuilder の記述:
指定されたクラスパス上のファイルを読み込んでMailインスタンスを生成します。

定義:
インタフェース MailBuilder 内の buildMail
パラメータ:
classPath - メール内容を記述したファイルのパス
戻り値:
生成されたMailインスタンス
例外:
MailBuildException - Mailインスタンスの生成に失敗した場合
関連項目:
MailBuilder.buildMail(java.lang.String)

getDocumentFromClassPath

protected Document getDocumentFromClassPath(String classPath)
                                     throws SAXException,
                                            IOException
パラメータ:
classPath -
戻り値:
例外:
IOException
SAXException

buildMail

public Mail buildMail(File file)
               throws MailBuildException
インタフェース MailBuilder の記述:
指定されたファイルを読み込んでMailインスタンスを生成します。

定義:
インタフェース MailBuilder 内の buildMail
パラメータ:
file - メール内容を記述したファイル
戻り値:
生成されたMailインスタンス
例外:
MailBuildException - Mailインスタンスの生成に失敗した場合
関連項目:
MailBuilder.buildMail(java.io.File)

build

protected Mail build(Document doc)
DOM DocumentからMailインスタンスを生成します。

パラメータ:
doc - メールデータのDOM Document
戻り値:
生成されたMailインスタンス

getDocumentFromFile

protected Document getDocumentFromFile(File file)
                                throws SAXException,
                                       IOException
DocumentBuilderはスレッドセーフではないため、同期メソッドに。

パラメータ:
file -
戻り値:
DOM Document
例外:
IOException
SAXException

createDocumentBuilder

protected DocumentBuilder createDocumentBuilder()
                                         throws FactoryConfigurationError
戻り値:
DocumentBuilder
例外:
FactoryConfigurationError


Copyright © 2004 OZACC. All Rights Reserved.