299 if(index<0) return null;
300 return getValue(index);
301 }
302
303 public String getValue(String qName) {
304 int index = getIndex(qName);
305 if(index<0) return null;
306 return getValue(index);
307 }
308 };
309
310 protected void handleCharacters() throws XMLStreamException, SAXException {
311 if( predictor.expectText() )
312 buffer.append(
313 staxStreamReader.getTextCharacters(),
314 staxStreamReader.getTextStart(),
315 staxStreamReader.getTextLength() );
316 }
317
318 private void processText( boolean ignorable ) throws SAXException {
319 if( predictor.expectText() && (!ignorable || !WhiteSpaceProcessor.isWhiteSpace(buffer))) {
320 if(textReported) {
321 textReported = false;
322 } else {
323 visitor.text(buffer);
324 }
325 }
326 buffer.setLength(0);
327 }
328
329
330
331 /**
332 * Reference to FI's StAXReader class, if FI can be loaded.
333 */
334 private static final Class FI_STAX_READER_CLASS = initFIStAXReaderClass();
335 private static final Constructor<? extends StAXConnector> FI_CONNECTOR_CTOR = initFastInfosetConnectorClass();
336
337 private static Class initFIStAXReaderClass() {
338 try {
339 Class<?> fisr = Class.forName("com.sun.xml.internal.org.jvnet.fastinfoset.stax.FastInfosetStreamReader");
|
299 if(index<0) return null;
300 return getValue(index);
301 }
302
303 public String getValue(String qName) {
304 int index = getIndex(qName);
305 if(index<0) return null;
306 return getValue(index);
307 }
308 };
309
310 protected void handleCharacters() throws XMLStreamException, SAXException {
311 if( predictor.expectText() )
312 buffer.append(
313 staxStreamReader.getTextCharacters(),
314 staxStreamReader.getTextStart(),
315 staxStreamReader.getTextLength() );
316 }
317
318 private void processText( boolean ignorable ) throws SAXException {
319 if( predictor.expectText() && (!ignorable || !WhiteSpaceProcessor.isWhiteSpace(buffer) || context.getCurrentState().isMixed())) {
320 if(textReported) {
321 textReported = false;
322 } else {
323 visitor.text(buffer);
324 }
325 }
326 buffer.setLength(0);
327 }
328
329
330
331 /**
332 * Reference to FI's StAXReader class, if FI can be loaded.
333 */
334 private static final Class FI_STAX_READER_CLASS = initFIStAXReaderClass();
335 private static final Constructor<? extends StAXConnector> FI_CONNECTOR_CTOR = initFastInfosetConnectorClass();
336
337 private static Class initFIStAXReaderClass() {
338 try {
339 Class<?> fisr = Class.forName("com.sun.xml.internal.org.jvnet.fastinfoset.stax.FastInfosetStreamReader");
|