public class WrappedReader extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
WrappedReader.ErrorInfo |
| Constructor and Description |
|---|
WrappedReader(InputStream is) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkElement(String name)
Check for an optional element present in the input.
|
void |
closeElement()
Read required element end tag.
|
void |
closeNested(int count)
Read nested element end tags.
|
List<WrappedReader.ErrorInfo> |
getErrorList()
Get list of verification errors.
|
void |
init(String type)
Initialize reader state.
|
void |
openElement(String name)
Read required element start tag.
|
void |
openNested(String... names)
Read nested element start tags.
|
String |
readElement(String name)
Read trimmed text content of required next element.
|
String |
readNested(String... names)
Read trimmed text content of nested element.
|
void |
skipElement(String name)
Skip element including all nested content.
|
void |
skipOptionalElement(String name)
Skip optional element including all nested content.
|
void |
validate()
Validate document, discarding all data.
|
void |
verifyElement(String value,
String name)
Verify trimmed text content of element matches expected value.
|
void |
verifyNested(String value,
String... names)
Verify trimmed text content of element matches expected value.
|
public WrappedReader(InputStream is) throws XMLStreamException
XMLStreamExceptionpublic void init(String type) throws XMLStreamException
type - XMLStreamExceptionpublic void validate()
throws XMLStreamException
XMLStreamExceptionpublic List<WrappedReader.ErrorInfo> getErrorList()
public boolean checkElement(String name) throws XMLStreamException
name - true if present, false if notXMLStreamExceptionpublic void openElement(String name) throws XMLStreamException
name - element local nameXMLStreamExceptionpublic void openNested(String... names) throws XMLStreamException
names - XMLStreamExceptionpublic void closeElement()
throws XMLStreamException
XMLStreamExceptionpublic void closeNested(int count)
throws XMLStreamException
count - XMLStreamExceptionpublic void skipElement(String name) throws XMLStreamException
name - XMLStreamExceptionpublic void skipOptionalElement(String name) throws XMLStreamException
name - XMLStreamExceptionpublic String readElement(String name) throws XMLStreamException
name - XMLStreamExceptionpublic String readNested(String... names) throws XMLStreamException
names - null if emptyXMLStreamExceptionpublic void verifyElement(String value, String name) throws XMLStreamException
value - name - XMLStreamExceptionpublic void verifyNested(String value, String... names) throws XMLStreamException
value - names - XMLStreamExceptionCopyright © 2025 MuleSoft, Inc.. All rights reserved.