|
|||||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Objectcom.ozacc.mail.impl.AbstractXMLMailBuilder
com.ozacc.mail.impl.XMLMailBuilderImpl
com.ozacc.mail.impl.XMLVelocityMailBuilderImpl
XMLファイルを読み込み、Velocityと連携して動的にメールデータを生成し、そのデータからMailインスタンスを生成するクラス。
フィールドの概要 | |
protected String |
charset
|
protected Map |
templateCache
|
protected LogSystem |
velocityLogSystem
|
クラス com.ozacc.mail.impl.AbstractXMLMailBuilder から継承したフィールド |
documentBuilderCache |
コンストラクタの概要 | |
XMLVelocityMailBuilderImpl()
|
メソッドの概要 | |
protected Mail |
build(String templateXmlText,
VelocityContext context)
メールデータをVelocityContextとマージして生成されたXMLからMailインスタンスを生成します。 |
Mail |
buildMail(File file,
VelocityContext context)
指定されたファイルを読み込んでMailインスタンスを生成します。 |
Mail |
buildMail(String classPath,
VelocityContext context)
指定されたクラスパス上のファイルを読み込んでMailインスタンスを生成します。 |
void |
clearCache()
メールデータキャッシュをクリアします。 |
protected String |
convertDocumentIntoString(Document doc)
指定されたDOM Documentを文字列に変換します。 |
protected Properties |
getOutputProperties()
出力プロパティを生成。 |
protected String |
getTemplateCache(String key)
|
protected boolean |
hasTemplateCache(String key)
|
boolean |
isCacheEnabled()
VelocityContextとマージする前のメールデータをキャッシュする設定かどうか判定します。 |
protected void |
putTemplateCache(String key,
String templateXmlText)
|
void |
setCacheEnabled(boolean cacheEnabled)
VelocityContextとマージする前のメールデータをキャッシュするかどうかを設定します。 |
クラス com.ozacc.mail.impl.XMLMailBuilderImpl から継承したメソッド |
buildMail, buildMail, buildMail |
クラス com.ozacc.mail.impl.AbstractXMLMailBuilder から継承したメソッド |
createDocumentBuilder, createDocumentBuilder, getDocumentFromClassPath, getDocumentFromClassPath, getDocumentFromFile, getDocumentFromFile, setFrom, setHtml, setRecipients, setReplyTo, setReturnPath, setSubject, setText |
クラス java.lang.Object から継承したメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
インタフェース com.ozacc.mail.MailBuilder から継承したメソッド |
buildMail, buildMail |
フィールドの詳細 |
protected String charset
protected LogSystem velocityLogSystem
protected Map templateCache
コンストラクタの詳細 |
public XMLVelocityMailBuilderImpl()
メソッドの詳細 |
protected boolean hasTemplateCache(String key)
protected void putTemplateCache(String key, String templateXmlText)
protected String getTemplateCache(String key)
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)
public Mail buildMail(String classPath, VelocityContext context) throws MailBuildException
VelocityMailBuilder
の記述:
VelocityMailBuilder
内の buildMail
classPath
- メール内容を記述したファイルのパスcontext
- VelocityContext
MailBuildException
- Mailインスタンスの生成に失敗した場合VelocityMailBuilder.buildMail(java.lang.String, org.apache.velocity.VelocityContext)
public Mail buildMail(File file, VelocityContext context) throws MailBuildException
VelocityMailBuilder
の記述:
VelocityMailBuilder
内の buildMail
file
- メール内容を記述したファイルcontext
- VelocityContext
MailBuildException
- Mailインスタンスの生成に失敗した場合VelocityMailBuilder.buildMail(java.io.File, org.apache.velocity.VelocityContext)
protected Mail build(String templateXmlText, VelocityContext context) throws TransformerFactoryConfigurationError, Exception, ParseErrorException, MethodInvocationException, ResourceNotFoundException, IOException
templateXmlText
- メールデータのテンプレートcontext
- テンプレートにマージする内容を格納したVelocityContext
TransformerFactoryConfigurationError
Exception
ParseErrorException
MethodInvocationException
ResourceNotFoundException
IOException
protected String convertDocumentIntoString(Document doc) throws TransformerFactoryConfigurationError
doc
-
TransformerFactoryConfigurationError
protected Properties getOutputProperties()
|
|||||||||||
前のクラス 次のクラス | フレームあり フレームなし | ||||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |