| Modifier and Type | Field and Description |
|---|---|
| private MappedNamespaceConvention | |
| private NamespaceContext | |
| private String | |
| private FastStack | |
| private int | |
| private String |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Implements javax. |
| public MappedNamespaceConvention | |
| public String | getElementText()
Implements javax. |
| public NamespaceContext | getNamespaceContext()
Implements javax. |
| public String | getText()
Implements javax. |
| public boolean | |
| public int | next()
Implements javax. |
| private void | |
| private boolean | |
| public void |
| convention | back to summary |
|---|---|
| private MappedNamespaceConvention convention | |
| ctx | back to summary |
|---|---|
| private NamespaceContext ctx | |
| currentValue | back to summary |
|---|---|
| private String currentValue | |
| nodes | back to summary |
|---|---|
| private FastStack nodes | |
| popArrayNodes | back to summary |
|---|---|
| private int popArrayNodes | |
| valueKey | back to summary |
|---|---|
| private String valueKey | |
| MappedXMLStreamReader | back to summary |
|---|---|
| public MappedXMLStreamReader(JSONObject obj) throws JSONException, XMLStreamException | |
| MappedXMLStreamReader | back to summary |
|---|---|
| public MappedXMLStreamReader(JSONObject obj, MappedNamespaceConvention con) throws JSONException, XMLStreamException | |
| close | back to summary |
|---|---|
| public void close() throws XMLStreamException Implements javax. Doc from javax. Frees any resources associated with this Reader. This method does not close the underlying input source.
| |
| getConvention | back to summary |
|---|---|
| public MappedNamespaceConvention getConvention() | |
| getElementText | back to summary |
|---|---|
| public String getElementText() throws XMLStreamException Implements javax. Doc from javax. Reads the content of a text-only element, an exception is thrown if this is
not a text-only element.
Regardless of value of javax.xml.stream.isCoalescing this method always returns coalesced content.
if(getEventType() != XMLStreamConstants.START_ELEMENT) {
throw new XMLStreamException(
"parser must be on START_ELEMENT to read next text", getLocation());
}
int eventType = next();
StringBuffer content = new StringBuffer();
while(eventType != XMLStreamConstants.END_ELEMENT) {
if(eventType == XMLStreamConstants.CHARACTERS
|| eventType == XMLStreamConstants.CDATA
|| eventType == XMLStreamConstants.SPACE
|| eventType == XMLStreamConstants.ENTITY_REFERENCE) {
buf.append(getText());
} else if(eventType == XMLStreamConstants.PROCESSING_INSTRUCTION
|| eventType == XMLStreamConstants.COMMENT) {
// skipping
} else if(eventType == XMLStreamConstants.END_DOCUMENT) {
throw new XMLStreamException(
"unexpected end of document when reading element text content", this);
} else if(eventType == XMLStreamConstants.START_ELEMENT) {
throw new XMLStreamException(
"element text content may not contain START_ELEMENT", getLocation());
} else {
throw new XMLStreamException(
"Unexpected event type "+eventType, getLocation());
}
eventType = next();
}
return buf.toString();
| |
| getNamespaceContext | back to summary |
|---|---|
| public NamespaceContext getNamespaceContext() Implements javax. Doc from javax. Returns a read only namespace context for the current position. The context is transient and only valid until a call to next() changes the state of the reader.
| |
| getText | back to summary |
|---|---|
| public String getText() Implements javax. Doc from javax. Returns the current value of the parse event as a string, this returns the string value of a CHARACTERS event, returns the value of a COMMENT, the replacement value for an ENTITY_REFERENCE, the string value of a CDATA section, the string value for a SPACE event, or the String value of the internal subset of the DTD. If an ENTITY_REFERENCE has been resolved, any character data will be reported as CHARACTERS events.
| |
| isAvoidArraySpecificEvents | back to summary |
|---|---|
| public boolean isAvoidArraySpecificEvents(String key) | |
| next | back to summary |
|---|---|
| public int next() throws XMLStreamException Implements javax. Doc from javax. Get next parsing event - a processor may return all contiguous character data in a single chunk, or it may split it into several chunks. If the property javax.xml.stream.isCoalescing is set to true element content must be coalesced and only one CHARACTERS event must be returned for contiguous element content or CDATA Sections. By default entity references must be expanded and reported transparently to the application. An exception will be thrown if an entity reference cannot be expanded. If element content is empty (i.e. content is "") then no CHARACTERS event will be reported. Given the following XML: Note empty element (such as
| |
| processElement | back to summary |
|---|---|
| private void processElement() throws XMLStreamException | |
| processUniformArrayIfPossible | back to summary |
|---|---|
| private boolean processUniformArrayIfPossible(String arrayKey, JSONArray array) throws JSONException, XMLStreamException | |
| setValueKey | back to summary |
|---|---|
| public void setValueKey(String valueKey) | |