public StAXEventReader(XMLStreamReader reader) throws XMLStreamException { _streamReader = reader ; _eventAllocator = (XMLEventAllocator)reader.getProperty(XMLInputFactory.ALLOCATOR); if(_eventAllocator == null){ _eventAllocator = new StAXEventAllocatorBase(); } //initialize if (_streamReader.hasNext()) { _streamReader.next(); _currentEvent =_eventAllocator.allocate(_streamReader); events[0] = _currentEvent; hasEvent = true; } else { throw new XMLStreamException(CommonResourceBundle.getInstance().getString("message.noElement")); } }
@Override public XMLEventAllocator newInstance() { try { return new XMLSecEventAllocator(); } catch (Exception e) { throw new RuntimeException(e); } }
public void setProperty(String name, Object value) throws IllegalArgumentException { if (name.equals(IS_NAMESPACE_AWARE)) namespaceAware = ((Boolean) value).booleanValue(); else if (name.equals(IS_VALIDATING)) validating = ((Boolean) value).booleanValue(); else if (name.equals(IS_COALESCING)) coalescing = ((Boolean) value).booleanValue(); else if (name.equals(IS_REPLACING_ENTITY_REFERENCES)) replacingEntityReferences = ((Boolean) value).booleanValue(); else if (name.equals(IS_SUPPORTING_EXTERNAL_ENTITIES)) externalEntities = ((Boolean) value).booleanValue(); else if (name.equals(SUPPORT_DTD)) supportDTD = ((Boolean) value).booleanValue(); else if (name.equals(REPORTER)) reporter = (XMLReporter) value; else if (name.equals(RESOLVER)) resolver = (XMLResolver) value; else if (name.equals(ALLOCATOR)) allocator = (XMLEventAllocator) value; else if (name.equals("gnu.xml.stream.stringInterning")) stringInterning = ((Boolean) value).booleanValue(); else if (name.equals("gnu.xml.stream.baseAware")) baseAware = ((Boolean) value).booleanValue(); else if (name.equals("gnu.xml.stream.xIncludeAware")) xIncludeAware = ((Boolean) value).booleanValue(); else throw new IllegalArgumentException(name); }
protected XMLEventReaderImpl(XMLStreamReader reader, XMLEventAllocator allocator, String systemId) { this.reader = reader; this.allocator = allocator; this.systemId = systemId; }
@Override public void setProperty(String propName, Object value) { if (!mConfig.setProperty(propName, value)) { if (XMLInputFactory.ALLOCATOR.equals(propName)) { setEventAllocator((XMLEventAllocator) value); } } }
protected XMLEventAllocator createEventAllocator() { // Explicitly set allocate? if (mAllocator != null) { return mAllocator.newInstance(); } /* Complete or fast one? Note: standard allocator is designed * in such a way that newInstance() need not be called (calling * it wouldn't do anything, anyway) */ return mConfig.willPreserveLocation() ? DefaultEventAllocator.getDefaultInstance() : DefaultEventAllocator.getFastInstance(); }
public XMLEventAllocator getEventAllocator() { return (XMLEventAllocator)getProperty(XMLInputFactory.ALLOCATOR); }
/** Set a user defined event allocator for events * @param allocator the user defined allocator */ public void setEventAllocator(XMLEventAllocator allocator) { _manager.setProperty(XMLInputFactory.ALLOCATOR, allocator); }
public void setAllocator(XMLEventAllocator allocator) { if (allocator == null) throw new IllegalArgumentException(CommonResourceBundle.getInstance().getString("message.nullXMLEventAllocator")); _eventAllocator = allocator; }
/** Set a user defined event allocator for events * @param allocator the user defined allocator */ public void setEventAllocator(XMLEventAllocator allocator) { fPropertyManager.setProperty(XMLInputFactory.ALLOCATOR, allocator); }
public javax.xml.stream.util.XMLEventAllocator newInstance() { return new XMLEventAllocatorImpl(); }
@Override public void setEventAllocator(XMLEventAllocator allocator) { throw new UnsupportedOperationException("Not supported yet."); }
@Override public XMLEventAllocator getEventAllocator() { throw new UnsupportedOperationException("Not supported yet."); }
@Override public void setEventAllocator(XMLEventAllocator allocator) { defaultImpl.setEventAllocator(allocator); }
@Override public XMLEventAllocator getEventAllocator() { return defaultImpl.getEventAllocator(); }
@Override public XMLEventAllocator getEventAllocator() { return null; }