|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Objectcom.ozacc.mail.impl.AbstractXMLMailBuilder
com.ozacc.mail.impl.XMLMailBuilderImpl
com.ozacc.mail.impl.XMLVelocityMailBuilderImpl
public class XMLVelocityMailBuilderImpl
XMLファイルを読み込み、Velocityと連携して動的にメールデータを生成し、そのデータからMailインスタンスを生成するクラス。
フィールドの概要 | |
---|---|
protected String |
charset
|
protected Map |
templateCache
|
protected org.apache.velocity.runtime.log.LogSystem |
velocityLogSystem
|
クラス com.ozacc.mail.impl.AbstractXMLMailBuilder から継承されたフィールド |
---|
documentBuilderCache |
コンストラクタの概要 | |
---|---|
XMLVelocityMailBuilderImpl()
|
メソッドの概要 | |
---|---|
protected Mail |
build(String templateXmlText,
org.apache.velocity.VelocityContext context)
メールデータをVelocityContextとマージして生成されたXMLからMailインスタンスを生成します。 |
Mail |
buildMail(File file,
org.apache.velocity.VelocityContext context)
指定されたファイルを読み込んでMailインスタンスを生成します。 |
Mail |
buildMail(File file,
org.apache.velocity.VelocityContext context,
String mailId)
指定されたファイルを読み込み、mailIdが示すデータからMailインスタンスを生成します。 |
Mail |
buildMail(String classPath,
org.apache.velocity.VelocityContext context)
指定されたクラスパス上のファイルを読み込んでMailインスタンスを生成します。 |
Mail |
buildMail(String classPath,
org.apache.velocity.VelocityContext context,
String mailId)
指定されたクラスパス上のファイルを読み込み、mailIdが示すデータからMailインスタンスを生成します。 |
void |
clearCache()
メールデータキャッシュをクリアします。 |
protected String |
convertDocumentIntoString(Element mailElement)
指定された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, 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 org.apache.velocity.runtime.log.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, org.apache.velocity.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, org.apache.velocity.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, org.apache.velocity.VelocityContext context) throws TransformerFactoryConfigurationError, Exception, org.apache.velocity.exception.ParseErrorException, org.apache.velocity.exception.MethodInvocationException, org.apache.velocity.exception.ResourceNotFoundException, IOException
templateXmlText
- メールデータのテンプレートcontext
- テンプレートにマージする内容を格納したVelocityContext
TransformerFactoryConfigurationError
Exception
org.apache.velocity.exception.ParseErrorException
org.apache.velocity.exception.MethodInvocationException
org.apache.velocity.exception.ResourceNotFoundException
IOException
protected String convertDocumentIntoString(Element mailElement) throws TransformerFactoryConfigurationError
mailElement
-
TransformerFactoryConfigurationError
protected Properties getOutputProperties()
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)
|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |