@Override public String getElementText() throws XMLStreamException { return wrappedEventReader.getElementText(); }
@Override public Object unmarshal(Source source) throws XmlMappingException { try { XMLEventReader xmlEventReader = StaxTestUtils.getXmlEventReader(source); xmlEventReader.nextEvent(); xmlEventReader.nextEvent(); return xmlEventReader.getElementText(); } catch (Exception e) { throw new RuntimeException(e); } } });
public void testGetElementText() throws XMLStreamException { String text = "text"; when(xmlEventReader.getElementText()).thenReturn(text); assertEquals(eventReaderWrapper.getElementText(), text); }
/** * Event为location_select时触发 * @param reader reader * @return 读取结果 * @throws XMLStreamException XML解析异常 */ protected static Map<String, Object> eventSendLocationInfo(XMLEventReader reader) throws XMLStreamException{ Map<String, Object> sendLocationInfo = new HashMap<String, Object>(); while(reader.hasNext()){ XMLEvent event = reader.nextEvent(); if (event.isStartElement()) { String tagName = event.asStartElement().getName() .toString(); sendLocationInfo.put(tagName, reader.getElementText()); } } return sendLocationInfo; }
/** * Reads the base64 element value. * * @param outputStream the output stream * @throws Exception the exception */ public void readBase64ElementValue(OutputStream outputStream) throws Exception { this.ensureCurrentNodeIsStartElement(); byte[] buffer = null; buffer = Base64.decodeBase64(this.xmlReader.getElementText().toString()); outputStream.write(buffer); outputStream.flush(); }
/** * Event为scancode_push, scancode_waitmsg时触发 * @param reader reader * @return 读取结果 * @throws XMLStreamException XML解析异常 */ protected static Map<String, Object> eventScanCodePush(XMLEventReader reader) throws XMLStreamException{ Map<String, Object> scanCodePush = new HashMap<String, Object>(); while(reader.hasNext()){ XMLEvent event = reader.nextEvent(); if (event.isStartElement()) { String tagName = event.asStartElement().getName() .toString(); scanCodePush.put(tagName, reader.getElementText()); } } return scanCodePush; } }
/** * Reads the base64 element value. * * @return byte[] * @throws ServiceXmlDeserializationException the service xml deserialization exception * @throws XMLStreamException the XML stream exception * @throws IOException signals that an I/O exception has occurred */ public byte[] readBase64ElementValue() throws ServiceXmlDeserializationException, XMLStreamException, IOException { this.ensureCurrentNodeIsStartElement(); byte[] buffer = null; ByteArrayOutputStream byteArrayStream = new ByteArrayOutputStream(); buffer = Base64.decodeBase64(this.xmlReader.getElementText().toString()); byteArrayStream.write(buffer); return byteArrayStream.toByteArray(); }
.toString(); if("Count".equals(tagName)){ sendPicsInfoMap.put(tagName, reader.getElementText()); }else if("PicList".equals(tagName)){ .toString())){ Map<String, String> picMap = new HashMap<String, String>(); picMap.put("PicMd5Sum", reader.getElementText());
} else if("xml".equals(tagName)) { } else { map.put(tagName, reader.getElementText());
/** * Reads the content of a text-only element. Forwards from the underlying reader as-is. * * @todo Untested. In particular, it is not clear how to update {@code outerElements}. * By chance, JAXB does not seem to invoke this method. */ @Override public String getElementText() throws XMLStreamException { return in.getElementText(); }
public String getElementText() throws XMLStreamException { return reader.getElementText(); }
/** * {@inheritDoc} */ public String getElementText() throws XMLStreamException { return backing.getElementText(); }
public String getElementText() throws XMLStreamException { /* 09-May-2006, TSa: Not sure if this is good enough: might * need to improve. */ return mReader.getElementText(); }
public String getElementText() throws XMLStreamException { /* 09-May-2006, TSa: Not sure if this is good enough: might * need to improve. */ return mReader.getElementText(); }
public String getElementText() throws XMLStreamException { /* 09-May-2006, TSa: Not sure if this is good enough: might * need to improve. */ return mReader.getElementText(); }
private void handleSimilar(XMLEventReader reader, StartElement element) throws XMLStreamException { if (currSummary.similarUris == null) { currSummary.similarUris = new ArrayList<String>(); } currSummary.similarUris.add(reader.getElementText()); } private void handleRelevanceInfo(XMLEventReader reader, StartElement element)
@Override public String doGetElementTextAndEnd() { try { return real.getElementText(); } catch (XMLStreamException e) { throw new XmlException(e.getMessage(),e); } }
@Override public String getElementText() { try { return real.getElementText(); } catch (XMLStreamException e) { throw Throwables.propagate(e); } }
private void handleWarning(XMLEventReader reader, StartElement element) throws XMLStreamException { if (tempWarnings == null) { tempWarnings = new ArrayList<Warning>(); } Warning warning = new Warning(); warning.setId(getAttribute(element, "id")); warning.setMessage(reader.getElementText()); tempWarnings.add(warning); } private void handleReport(XMLEventReader reader, StartElement element)
private FacetValue handleFacetValue(XMLEventReader reader, StartElement element) throws XMLStreamException { String name = getAttribute(element, "name"); long count = Long.parseLong(getAttribute(element, "count")); FacetValueImpl facetValue = new FacetValueImpl(name, count); facetValue.setLabel(reader.getElementText()); return facetValue; } private void handleGeoFacet(XMLEventReader reader, StartElement element)