|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Objectorg.apache.xerces.impl.xs.XMLSchemaValidator
jp.terasoluna.fw.oxm.xsd.xerces.XMLSchemaValidatorEx
public class XMLSchemaValidatorEx
解析中のXMLの要素情報をXMLErrorReporterExのスタックに格納するために、XMLSchemaValidatorの拡張を行ったクラス。
要素の開始時に、要素名にインデックスを付加した文字列を、XMLErrorReporterExのスタックにプッシュする。
要素の終了時に、スタックからポップする。
要素の情報が入ったスタックを利用することで、エラーが発生した箇所を特定することができる。
XMLの要素情報がどのようにスタックに格納されるかを以下に記す。
【XMLデータのサンプル】
<sample-dto>
<param-a>
<param-b>
<param-c>...</param-c>
<param-d>...</param-d>
</param-b>
</param-a>
<param-e>
<param-f>...</param-f>
</param-e>
<param-e>
<param-f>...</param-f>
</param-e>
</sample-dto>
【上記のXMLデータが入力された場合の、スタックの状態の変化】
例えば、上記サンプルでparam-c要素に不正な値が入っていた場合、エラー発生時のスタックの状態は以下の通りである。
スタックの状態:{sample-dto[0]}{param-a[0]}{param-b[0]}{param-c[0]}
XMLErrorReporterExは以下のようにスタックの値をドット(".")で連結して、エラーのフィールド情報を生成する。
フィールド情報:sample-dto[0].param-a[0].param-b[0].param-c[0]
解析中のXMLの属性の情報は特定することができない。
エラーが発生した属性名はエラー情報の置換文字列から取得することができる。
詳細は、XMLErrorReporterEx
を参照すること。
XMLErrorReporterEx
入れ子のクラスの概要 |
---|
クラス org.apache.xerces.impl.xs.XMLSchemaValidator から継承された入れ子のクラス/インタフェース |
---|
org.apache.xerces.impl.xs.XMLSchemaValidator.KeyRefValueStore, org.apache.xerces.impl.xs.XMLSchemaValidator.KeyValueStore, org.apache.xerces.impl.xs.XMLSchemaValidator.LocalIDKey, org.apache.xerces.impl.xs.XMLSchemaValidator.ShortVector, org.apache.xerces.impl.xs.XMLSchemaValidator.UniqueValueStore, org.apache.xerces.impl.xs.XMLSchemaValidator.ValueStoreBase, org.apache.xerces.impl.xs.XMLSchemaValidator.ValueStoreCache, org.apache.xerces.impl.xs.XMLSchemaValidator.XPathMatcherStack, org.apache.xerces.impl.xs.XMLSchemaValidator.XSIErrorReporter |
フィールドの概要 |
---|
クラス org.apache.xerces.impl.xs.XMLSchemaValidator から継承されたフィールド |
---|
ALLOW_JAVA_ENCODINGS, CONTINUE_AFTER_FATAL_ERROR, DYNAMIC_VALIDATION, ENTITY_MANAGER, ENTITY_RESOLVER, ERROR_REPORTER, fAugmentations, fAugPSVI, fCurrentPSVI, fDefaultValue, fDocumentHandler, fDocumentSource, fDoValidation, fDynamicValidation, fEntityRef, fEntityResolver, fExternalNoNamespaceSchema, fExternalSchemas, fFullChecking, fGrammarPool, fIdConstraint, fInCDATA, fJaxpSchemaSource, fLocationPairs, fMatcherStack, fMayMatchFieldMap, fNormalizeData, fSchemaDynamicValidation, fSchemaElementDefault, fSymbolTable, fUseGrammarPoolOnly, fValidationManager, fValidationState, fValueStoreCache, fXSDDescription, fXSIErrorReporter, GENERATE_SYNTHETIC_ANNOTATIONS, HONOUR_ALL_SCHEMALOCATIONS, ID_CONSTRAINT_NUM, ID_IDREF_CHECKING, IDENTITY_CONSTRAINT_CHECKING, IGNORE_XSI_TYPE, JAXP_SCHEMA_LANGUAGE, JAXP_SCHEMA_SOURCE, NORMALIZE_DATA, PARSER_SETTINGS, ROOT_TYPE_DEF, SCHEMA_AUGMENT_PSVI, SCHEMA_ELEMENT_DEFAULT, SCHEMA_FULL_CHECKING, SCHEMA_LOCATION, SCHEMA_NONS_LOCATION, SCHEMA_VALIDATION, STANDARD_URI_CONFORMANT_FEATURE, SYMBOL_TABLE, UNPARSED_ENTITY_CHECKING, USE_GRAMMAR_POOL_ONLY, VALIDATE_ANNOTATIONS, VALIDATION, VALIDATION_MANAGER, XMLGRAMMAR_POOL |
コンストラクタの概要 | |
---|---|
XMLSchemaValidatorEx(XMLErrorReporterEx reporter)
コンストラクタ |
メソッドの概要 | |
---|---|
void |
endElement(org.apache.xerces.xni.QName element,
org.apache.xerces.xni.Augmentations augs)
要素の終了時に、XMLErrorReporterExのスタックからポップする。 |
void |
startElement(org.apache.xerces.xni.QName element,
org.apache.xerces.xni.XMLAttributes attributes,
org.apache.xerces.xni.Augmentations augs)
要素の開始時に、解析中のフィールド情報をXMLErrorReporterExのスタックにプッシュする。 |
クラス org.apache.xerces.impl.xs.XMLSchemaValidator から継承されたメソッド |
---|
activateField, characterData, characters, comment, doctypeDecl, elementDefault, emptyElement, endCDATA, endDocument, endGeneralEntity, endValueScopeFor, getDocumentHandler, getDocumentSource, getFeatureDefault, getPropertyDefault, getRecognizedFeatures, getRecognizedProperties, ignorableWhitespace, mayMatch, processingInstruction, reset, setDocumentHandler, setDocumentSource, setFeature, setMayMatch, setProperty, startCDATA, startDocument, startGeneralEntity, startValueScopeFor, textDecl, xmlDecl |
クラス java.lang.Object から継承されたメソッド |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
コンストラクタの詳細 |
---|
public XMLSchemaValidatorEx(XMLErrorReporterEx reporter)
reporter
- XMLErrorReporterExインスタンスメソッドの詳細 |
---|
public void startElement(org.apache.xerces.xni.QName element, org.apache.xerces.xni.XMLAttributes attributes, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException
org.apache.xerces.xni.XMLDocumentHandler
内の startElement
org.apache.xerces.impl.xs.XMLSchemaValidator
内の startElement
element
- XML要素の情報を持つインスタンスattributes
- XML属性の情報を持つインスタンスaugs
- 妥当性検証の結果が格納されるインスタンス
org.apache.xerces.xni.XNIException
- パーサ内で発生する実行時例外public void endElement(org.apache.xerces.xni.QName element, org.apache.xerces.xni.Augmentations augs) throws org.apache.xerces.xni.XNIException
org.apache.xerces.xni.XMLDocumentHandler
内の endElement
org.apache.xerces.impl.xs.XMLSchemaValidator
内の endElement
element
- XML要素の情報を持つインスタンスaugs
- 妥当性検証の結果が格納されるインスタンス
org.apache.xerces.xni.XNIException
- パーサ内で発生する実行時例外
|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |