|
|||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | ||||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | ||||||||||
java.lang.Objectcom.ozacc.mail.impl.JDomXMLMailBuilder
JDOMを利用してXMLファイルからMailインスタンスを生成するクラス。
ソースXMLを読み込む際に、DTDバリデーションが実行されますので妥当なXMLデータ(Valid XML Document)でなければいけません。
| フィールドの概要 | |
protected Map |
templateCache
|
protected LogSystem |
velocityLogSystem
|
| コンストラクタの概要 | |
JDomXMLMailBuilder()
コンストラクタ。 |
|
| メソッドの概要 | |
protected Mail |
build(Document doc)
XMLドキュメントからMailインスタンスを生成します。 |
protected Mail |
build(String templateText,
VelocityContext context)
VelocityContextとXMLテンプレートをマージさせ、Mailインスタンスを生成します。 |
Mail |
buildMail(File file)
指定されたXMLファイルからMailインスタンスを生成します。 |
Mail |
buildMail(File file,
VelocityContext context)
指定されたXMLファイルからMailインスタンスを生成します。 |
Mail |
buildMail(String classPath)
指定されたクラスパス上のXMLファイルからMailインスタンスを生成します。 |
Mail |
buildMail(String classPath,
VelocityContext context)
指定されたクラスパス上のXMLファイルからMailインスタンスを生成します。 |
void |
clearCache()
メールデータキャッシュをクリアします。 |
protected Document |
getDocumentFromClassPath(String classPath)
指定されたクラスパス上のファイルを読み込んで、XMLドキュメントを生成します。 |
protected Document |
getDocumentFromFile(File file)
指定されたファイルを読み込んで、XMLドキュメントを生成します。 |
protected String |
getTemplateCache(String key)
|
protected boolean |
hasTemplateCache(String key)
|
boolean |
isCacheEnabled()
VelocityContextとマージする前のメールデータをキャッシュする設定かどうか判定します。 |
protected void |
putTemplateCache(String key,
String templateXmlText)
|
protected void |
setBody(Element root,
Mail mail)
|
void |
setCacheEnabled(boolean cacheEnabled)
VelocityContextとマージする前のメールデータをキャッシュするかどうかを設定します。 |
protected void |
setFrom(Element root,
Mail mail)
|
protected void |
setHtml(Element root,
Mail mail)
|
protected void |
setRecipients(Element root,
Mail mail)
|
protected void |
setReplyTo(Element root,
Mail mail)
|
protected void |
setReturnPath(Element root,
Mail mail)
|
protected void |
setSubject(Element root,
Mail mail)
|
| クラス java.lang.Object から継承したメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| フィールドの詳細 |
protected LogSystem velocityLogSystem
protected Map templateCache
| コンストラクタの詳細 |
public JDomXMLMailBuilder()
| メソッドの詳細 |
public Mail buildMail(String classPath)
throws MailBuildException
MailBuilder 内の buildMailclassPath - メール内容を記述したXMLファイルのパス
MailBuildException - Mailインスタンスの生成に失敗した場合
public Mail buildMail(String classPath,
VelocityContext context)
throws MailBuildException
VelocityMailBuilder 内の buildMailclassPath - メール内容を記述したXMLファイルのパスcontext - VelocityContext
MailBuildException - Mailインスタンスの生成に失敗した場合
public Mail buildMail(File file)
throws MailBuildException
MailBuilder 内の buildMailfile - メール内容を記述したXMLファイル
MailBuildException - Mailインスタンスの生成に失敗した場合
public Mail buildMail(File file,
VelocityContext context)
throws MailBuildException
VelocityMailBuilder 内の buildMailfile - メール内容を記述したXMLファイルcontext - VelocityContext
MailBuildException - Mailインスタンスの生成に失敗した場合
protected Document getDocumentFromClassPath(String classPath)
throws MailBuildException
classPath -
MailBuildExceptionprotected Document getDocumentFromFile(File file)
file -
protected Mail build(Document doc)
doc -
protected Mail build(String templateText,
VelocityContext context)
throws Exception,
ParseErrorException,
MethodInvocationException,
ResourceNotFoundException,
IOException,
JDOMException
templateText - マージするXMLテンプレートの文字列context - マージするVelocityContext
Exception
ParseErrorException
MethodInvocationException
ResourceNotFoundException
IOException
JDOMException
protected void setReturnPath(Element root,
Mail mail)
root - mail -
protected void setReplyTo(Element root,
Mail mail)
root - mail -
protected void setBody(Element root,
Mail mail)
root - mail -
protected void setHtml(Element root,
Mail mail)
root - mail -
protected void setSubject(Element root,
Mail mail)
root - mail -
protected void setRecipients(Element root,
Mail mail)
root - mail -
protected void setFrom(Element root,
Mail mail)
root - mail - public void clearCache()
VelocityMailBuilder の記述:
VelocityMailBuilder 内の clearCacheVelocityMailBuilder.clearCache()public boolean isCacheEnabled()
VelocityMailBuilder の記述:
VelocityMailBuilder 内の isCacheEnabledVelocityMailBuilder.isCacheEnabled()public void setCacheEnabled(boolean cacheEnabled)
VelocityMailBuilder の記述:
キャッシュのキーは、buildMail()メソッド引数のメールデータファイルのクラスパス或いはファイルパスです。
キャッシュに有効期限はありません。
また、メールデータファイルの内容が途中で更新されても、キャッシュされているメールデータは更新されませんので注意してください。
falseを指定してこのメソッドを呼ぶとメールデータキャッシュはクリアされます。
VelocityMailBuilder 内の setCacheEnabledcacheEnabled - メールデータをキャッシュする場合は trueVelocityMailBuilder.setCacheEnabled(boolean)protected boolean hasTemplateCache(String key)
protected void putTemplateCache(String key,
String templateXmlText)
protected String getTemplateCache(String key)
|
|||||||||||
| 前のクラス 次のクラス | フレームあり フレームなし | ||||||||||
| 概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド | ||||||||||