public class XmlDataParser extends StructuredDataEditorSupport implements StructuredDataParser
setAllowDTD(boolean))。
読み込み対象となるXMLが信頼できるものであり、かつ、DTDを使用しなければならない場合のみ、
本プロパティを使用してDTDの使用を許可することができる。| Constructor and Description |
|---|
XmlDataParser() |
| Modifier and Type | Method and Description |
|---|---|
protected javax.xml.parsers.DocumentBuilderFactory |
createDocumentBuilderFactory(LayoutDefinition layoutDef)
本クラスで使用する
DocumentBuilderFactoryのインスタンスを生成する。 |
java.util.Map<java.lang.String,?> |
parseData(java.io.InputStream xml,
LayoutDefinition layoutDef)
フラットマップを作成します。
|
void |
setAllowDTD(boolean allowDTD)
DTDの使用を許可する。
デフォルトは「許可しない」(
false)。 |
void |
setContentName(java.lang.String contentName)
属性あり要素のコンテンツ名を設定する。
|
buildMapKey, checkArrayLength, checkIndispensable, checkRequired, convertToFieldOnRead, convertToFieldOnWrite, isObjectTypepublic java.util.Map<java.lang.String,?> parseData(java.io.InputStream xml,
LayoutDefinition layoutDef)
throws java.io.IOException,
InvalidDataFormatException
parseData in interface StructuredDataParserxml - XML文字列layoutDef - フォーマット定義java.io.IOException - 読み込みに伴うIO処理で問題が発生した場合InvalidDataFormatException - 読み込んだデータがフォーマット定義に違反している場合protected javax.xml.parsers.DocumentBuilderFactory createDocumentBuilderFactory(LayoutDefinition layoutDef) throws javax.xml.parsers.ParserConfigurationException
DocumentBuilderFactoryのインスタンスを生成する。layoutDef - レイアウト定義 (本実装では使用しないがオーバーライド用に用意している。)DocumentBuilderFactoryのインスタンスjavax.xml.parsers.ParserConfigurationException - DocumentBuilderFactory.setFeature(String, boolean)に失敗した場合public void setContentName(java.lang.String contentName)
contentName - 属性あり要素のコンテンツ名public void setAllowDTD(boolean allowDTD)
false)。allowDTD - 許可する場合、真