/** * @return Returns String. * @see javax.xml.stream.XMLStreamReader#getText() */ public String getText() { String returnString = null; if (parser != null) { returnString = parser.getText(); } else { if (hasText()) { if (lastNode instanceof OMText) { returnString = ((OMText) lastNode).getText(); } else if (lastNode instanceof OMComment) { returnString = ((OMComment) lastNode).getValue(); } } } return returnString; }
/** * @return Returns char[]. * @see javax.xml.stream.XMLStreamReader#getTextCharacters() */ public char[] getTextCharacters() { char[] returnArray = null; if (parser != null) { returnArray = parser.getTextCharacters(); } else { if (hasText()) { OMText textNode = (OMText) lastNode; String str = textNode.getText(); returnArray = str.toCharArray(); } } return returnArray; }
/** * @param i * @param chars * @param i1 * @param i2 * @return Returns int. * @throws XMLStreamException * @see javax.xml.stream.XMLStreamReader#getTextCharacters(int, char[], int, int) */ public int getTextCharacters(int i, char[] chars, int i1, int i2) throws XMLStreamException { int returnLength = 0; if (hasText()) { if (parser != null) { try { returnLength = parser.getTextCharacters(i, chars, i1, i2); } catch (XMLStreamException e) { throw new OMStreamingException(e); } } // Note - this has no relevant method in the OM } return returnLength; }