|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Objectcom.ozacc.mail.impl.JDomXMLMailBuilder
public class JDomXMLMailBuilder
JDOMを利用してXMLファイルからMailインスタンスを生成するクラス。
ソースXMLを読み込む際に、DTDバリデーションが実行されますので妥当なXMLデータ(Valid XML Document)でなければいけません。
フィールドの概要 | |
---|---|
protected Map |
templateCache
|
protected org.apache.velocity.runtime.log.LogSystem |
velocityLogSystem
|
コンストラクタの概要 | |
---|---|
JDomXMLMailBuilder()
コンストラクタ。 |
メソッドの概要 | |
---|---|
protected Mail |
build(Element mailElement)
XMLのmailルートエレメントからMailインスタンスを生成します。 |
protected Mail |
build(String templateText,
org.apache.velocity.VelocityContext context)
VelocityContextとXMLテンプレートをマージさせ、Mailインスタンスを生成します。 |
Mail |
buildMail(File file)
指定されたXMLファイルからMailインスタンスを生成します。 |
Mail |
buildMail(File file,
String mailId)
指定されたファイルを読み込み、mailIdが示すデータからMailインスタンスを生成します。 |
Mail |
buildMail(File file,
org.apache.velocity.VelocityContext context)
指定されたXMLファイルからMailインスタンスを生成します。 |
Mail |
buildMail(File file,
org.apache.velocity.VelocityContext context,
String mailId)
指定されたファイルを読み込み、mailIdが示すデータからMailインスタンスを生成します。 |
Mail |
buildMail(String classPath)
指定されたクラスパス上のXMLファイルからMailインスタンスを生成します。 |
Mail |
buildMail(String classPath,
String mailId)
指定されたクラスパス上のファイルを読み込み、mailIdが示すデータからMailインスタンスを生成します。 |
Mail |
buildMail(String classPath,
org.apache.velocity.VelocityContext context)
指定されたクラスパス上のXMLファイルからMailインスタンスを生成します。 |
Mail |
buildMail(String classPath,
org.apache.velocity.VelocityContext context,
String mailId)
指定されたクラスパス上のファイルを読み込み、mailIdが示すデータから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 org.apache.velocity.runtime.log.LogSystem velocityLogSystem
protected Map templateCache
コンストラクタの詳細 |
---|
public JDomXMLMailBuilder()
メソッドの詳細 |
---|
public Mail buildMail(String classPath) throws MailBuildException
MailBuilder
内の buildMail
classPath
- メール内容を記述したXMLファイルのパス
MailBuildException
- Mailインスタンスの生成に失敗した場合public Mail buildMail(String classPath, org.apache.velocity.VelocityContext context) throws MailBuildException
VelocityMailBuilder
内の buildMail
classPath
- メール内容を記述したXMLファイルのパスcontext
- VelocityContext
MailBuildException
- Mailインスタンスの生成に失敗した場合public Mail buildMail(File file) throws MailBuildException
MailBuilder
内の buildMail
file
- メール内容を記述したXMLファイル
MailBuildException
- Mailインスタンスの生成に失敗した場合public Mail buildMail(File file, org.apache.velocity.VelocityContext context) throws MailBuildException
VelocityMailBuilder
内の buildMail
file
- メール内容を記述したXMLファイルcontext
- VelocityContext
MailBuildException
- Mailインスタンスの生成に失敗した場合protected Document getDocumentFromClassPath(String classPath) throws MailBuildException
classPath
-
MailBuildException
protected Document getDocumentFromFile(File file)
file
-
protected Mail build(Element mailElement)
mailElement
- mail要素を示すElementインスタンス
protected Mail build(String templateText, org.apache.velocity.VelocityContext context) throws Exception, org.apache.velocity.exception.ParseErrorException, org.apache.velocity.exception.MethodInvocationException, org.apache.velocity.exception.ResourceNotFoundException, IOException, JDOMException
templateText
- マージするXMLテンプレートの文字列context
- マージするVelocityContext
Exception
org.apache.velocity.exception.ParseErrorException
org.apache.velocity.exception.MethodInvocationException
org.apache.velocity.exception.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
内の clearCache
VelocityMailBuilder.clearCache()
public boolean isCacheEnabled()
VelocityMailBuilder
の記述:
VelocityMailBuilder
内の isCacheEnabled
VelocityMailBuilder.isCacheEnabled()
public void setCacheEnabled(boolean cacheEnabled)
VelocityMailBuilder
の記述:
キャッシュのキーは、buildMail()
メソッド引数のメールデータファイルのクラスパス或いはファイルパスです。
キャッシュに有効期限はありません。
また、メールデータファイルの内容が途中で更新されても、キャッシュされているメールデータは更新されませんので注意してください。
false
を指定してこのメソッドを呼ぶとメールデータキャッシュはクリアされます。
VelocityMailBuilder
内の setCacheEnabled
cacheEnabled
- メールデータをキャッシュする場合は trueVelocityMailBuilder.setCacheEnabled(boolean)
protected boolean hasTemplateCache(String key)
protected void putTemplateCache(String key, String templateXmlText)
protected String getTemplateCache(String key)
public Mail buildMail(String classPath, org.apache.velocity.VelocityContext context, String mailId) throws MailBuildException
VelocityMultipleMailBuilder
の記述:
VelocityMultipleMailBuilder
内の buildMail
classPath
- メール内容を記述したファイルのパスcontext
- VelocityContextmailId
- 生成するMailのメールデータを示すID
MailBuildException
- Mailインスタンスの生成に失敗した場合VelocityMultipleMailBuilder.buildMail(java.lang.String, org.apache.velocity.VelocityContext, java.lang.String)
public Mail buildMail(File file, org.apache.velocity.VelocityContext context, String mailId) throws MailBuildException
VelocityMultipleMailBuilder
の記述:
VelocityMultipleMailBuilder
内の buildMail
file
- メール内容を記述したファイルcontext
- VelocityContextmailId
- 生成するMailのメールデータを示すID
MailBuildException
- Mailインスタンスの生成に失敗した場合VelocityMultipleMailBuilder.buildMail(java.io.File, org.apache.velocity.VelocityContext, java.lang.String)
public Mail buildMail(String classPath, String mailId) throws MailBuildException
MultipleMailBuilder
の記述:
MultipleMailBuilder
内の buildMail
classPath
- メール内容を記述したファイルのパスmailId
- 生成するMailのメールデータを示すID
MailBuildException
- Mailインスタンスの生成に失敗した場合MultipleMailBuilder.buildMail(java.lang.String, java.lang.String)
public Mail buildMail(File file, String mailId) throws MailBuildException
MultipleMailBuilder
の記述:
MultipleMailBuilder
内の buildMail
file
- メール内容を記述したファイルmailId
- 生成するMailのメールデータを示すID
MailBuildException
- Mailインスタンスの生成に失敗した場合MultipleMailBuilder.buildMail(java.io.File, java.lang.String)
|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |