public class IacXmlWriter extends Object implements AutoCloseable
コンストラクタと説明 |
---|
IacXmlWriter(OutputStream stream)
コンストラクタ
|
IacXmlWriter(OutputStream stream,
String encoding)
コンストラクタ
|
IacXmlWriter(Writer writer)
コンストラクタ
|
修飾子とタイプ | メソッドと説明 |
---|---|
void |
close()
クローズ処理を行います。
|
void |
close(boolean source)
クローズ処理を行います。
|
void |
flush()
フラッシュ処理を行います。
|
void |
writeDefinedNamespaces()
定義済み名前空間情報を出力します。
|
void |
writeEmpty(ElementInfo info,
Attribute... attributes)
空タグを出力します。
|
void |
writeEmpty(Enum<?> enumerator,
Attribute... attributes)
空タグを出力します。
|
void |
writeEmpty(IOutputElement element,
Attribute... attributes)
空タグを出力します。
|
void |
writeEmpty(String namespaceUri,
String name,
Attribute... attributes)
空タグを出力します。
|
void |
writeEnd()
終了タグを出力します。
|
void |
writeEndDocument()
ドキュメント終了出力処理を行います。
|
void |
writeICalendar(IOutputElement element,
IComponent component)
iCalendar 要素を出力します。
|
void |
writeIndent(int size)
インデント文字を出力します。
|
void |
writeStart(ElementInfo info,
Attribute... attributes)
開始タグを出力します。
|
void |
writeStart(IOutputElement element,
Attribute... attributes)
開始タグを出力します。
|
void |
writeStart(String namespaceUri,
String name,
Attribute... attributes)
開始タグを出力します。
|
void |
writeStartDocument()
ドキュメント開始タグを出力します。
|
void |
writeStartEnd(IOutputElement element,
String text)
開始・終了タグを出力します。
|
void |
writeText(String text)
文字列を出力します。
|
public IacXmlWriter(OutputStream stream) throws IacCaldavIOException
stream
- ストリームIacCaldavIOException
- ライターの生成に失敗した場合public IacXmlWriter(OutputStream stream, String encoding) throws IacCaldavIOException
stream
- ストリームencoding
- 文字エンコーディングIacCaldavIOException
- ライターの生成に失敗した場合public IacXmlWriter(Writer writer) throws IacCaldavIOException
writer
- ライターIacCaldavIOException
- ライターの生成に失敗した場合public void close() throws IacCaldavIOException
XML ストリームライターおよび iCalendar ライターに関連付けられたリソースを解放します。
また、基本ストリームのクローズ処理も行います。
close
インタフェース内 AutoCloseable
IacCaldavIOException
- クローズ処理に失敗した場合public void close(boolean source) throws IacCaldavIOException
XML ストリームライターおよび iCalendar ライターに関連付けられたリソースを解放します。
source
- 基本ストリームのクローズを行うかどうかの真偽値
(true
:クローズする/false
:クローズしない)IacCaldavIOException
- クローズ処理に失敗した場合public void flush() throws IacCaldavIOException
IacCaldavIOException
- フラッシュ処理に失敗した場合public void writeDefinedNamespaces() throws IacCaldavIOException
IacCaldavIOException
- 出力処理に失敗した場合public void writeEmpty(ElementInfo info, Attribute... attributes) throws IacCaldavIOException
ボディ部を持たないタグです。
要素情報が null
の場合は出力されません。
info
- 要素情報attributes
- 属性情報IacCaldavIOException
- 出力処理に失敗した場合writeEmpty(String, String, Attribute...)
public void writeEmpty(Enum<?> enumerator, Attribute... attributes) throws IacCaldavIOException
ボディ部を持たないタグです。
列挙子に定義された要素情報(ElementInfo
)からタグを組み立てます。
要素情報が定義されていない場合は出力されません。
enumerator
- 列挙子attributes
- 属性情報IacCaldavIOException
- 出力処理に失敗した場合writeEmpty(ElementInfo, Attribute...)
public void writeEmpty(IOutputElement element, Attribute... attributes) throws IacCaldavIOException
ボディ部を持たないタグです。
要素モデルに定義された要素情報(ElementInfo
)からタグを組み立てます。
要素情報が定義されていない場合は出力されません。
element
- 要素モデルattributes
- 属性情報IacCaldavIOException
- 出力処理に失敗した場合writeEmpty(ElementInfo, Attribute...)
public void writeEmpty(String namespaceUri, String name, Attribute... attributes) throws IacCaldavIOException
ボディ部を持たないタグです。
e.g. <Prefix:tagName/> <Prefix:tagName attName="attValue"/>以下の場合は出力されません。
null
もしくは空文字の場合null
もしくは空文字の場合null
でない場合Attribute.hasValue()
)namespaceUri
- 名前空間 URIname
- 要素名attributes
- 属性情報IacCaldavIOException
- 出力処理に失敗した場合public void writeEnd() throws IacCaldavIOException
IacCaldavIOException
- 出力処理に失敗した場合public void writeEndDocument() throws IacCaldavIOException
閉じられていないタグ等の後処理が行われます。
IacCaldavIOException
- 出力処理に失敗した場合public void writeICalendar(IOutputElement element, IComponent component) throws IacCaldavIOException
iCalendar コンポーネントの内容を値に持つ要素の出力を行います。
iCalendar 文字列の生成処理は IacICalendarWriter
に委譲します。
XML のためのエスケープ処理(直接参照文字変換)を施すため、生成された iCalendar 文字列を writeText(String)
で出力します。
iCalendar で使用する改行文字は XML と同じ Constants.LINE_SEPARATOR
を使用します。
開始タグ、iCalendar 文字列、終了タグをまとめて出力します。
自動成形が有効の場合は、開始タグのインデントのみ行われます。
iCalendar 文字列の内容に干渉させないため、終了タグのインデントは行われません。
e.g. <Prefix:tagName>BEGIN:COMPONENT ... END:COMPONENT </Prefix:tagName>
element
- 要素モデルcomponent
- iCalendar コンポーネントIacCaldavIOException
- 出力処理に失敗した場合IacICalendarWriter.write(IComponent)
public void writeIndent(int size) throws IacCaldavIOException
size
- インデント数IacCaldavIOException
- 出力処理に失敗した場合public void writeStart(ElementInfo info, Attribute... attributes) throws IacCaldavIOException
要素情報が null
の場合は出力されません。
info
- 要素情報attributes
- 属性情報IacCaldavIOException
- 出力処理に失敗した場合writeStart(String, String, Attribute...)
public void writeStart(IOutputElement element, Attribute... attributes) throws IacCaldavIOException
要素モデルに定義された要素情報(ElementInfo
)からタグを組み立てます。
要素情報が定義されていない場合は出力されません。
element
- 要素モデルattributes
- 属性情報IacCaldavIOException
- 出力処理に失敗した場合writeStart(ElementInfo, Attribute...)
public void writeStart(String namespaceUri, String name, Attribute... attributes) throws IacCaldavIOException
以下の場合は出力されません。
null
もしくは空文字の場合null
もしくは空文字の場合null
でない場合Attribute.hasValue()
)namespaceUri
- 名前空間 URIname
- 要素名attributes
- 属性情報IacCaldavIOException
- 出力処理に失敗した場合public void writeStartDocument() throws IacCaldavIOException
IacCaldavIOException
- 出力処理に失敗した場合public void writeStartEnd(IOutputElement element, String text) throws IacCaldavIOException
開始タグ、文字列、終了タグをまとめて出力します。
自動成形が有効の場合は、インデントのみ行われ、当該タグは一行表示となります。
e.g. <Prefix:tagName>text</Prefix:tagName>文字列が
null
もしくは空文字の場合は空タグとなります。
e.g. <Prefix:tagName/>
element
- 要素モデルtext
- 文字列IacCaldavIOException
- 出力処理に失敗した場合public void writeText(String text) throws IacCaldavIOException
XML 出力に必要な実体参照のエスケープ処理が施されます。
text
- 文字列IacCaldavIOException
- 出力処理に失敗した場合XMLStreamWriter.writeCharacters(String)
Copyright © 2012-2015 NTT DATA INTRAMART CORPORATION