javax.xml.stream.util.XMLEventAllocator Java Examples

The following examples show how to use javax.xml.stream.util.XMLEventAllocator. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: StAXEventReader.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
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"));
    }
}
 
Example #2
Source File: StAXEventReader.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
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"));
    }
}
 
Example #3
Source File: StAXEventReader.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
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"));
    }
}
 
Example #4
Source File: StAXEventReader.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
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"));
    }
}
 
Example #5
Source File: StAXEventReader.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
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"));
    }
}
 
Example #6
Source File: StAXEventReader.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
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"));
    }
}
 
Example #7
Source File: StAXEventReader.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
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"));
    }
}
 
Example #8
Source File: StAXEventReader.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
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"));
    }
}
 
Example #9
Source File: WstxEventReader.java    From woodstox with Apache License 2.0 5 votes vote down vote up
public WstxEventReader(XMLEventAllocator a, XMLStreamReader2 r)
{
    mAllocator = a;
    mReader = r;
    mCfgMultiDocMode = (r instanceof StreamScanner)
            && ((StreamScanner) r).getConfig().inputParsingModeDocuments();
}
 
Example #10
Source File: WstxInputFactory.java    From woodstox with Apache License 2.0 5 votes vote down vote up
@Override
public void setProperty(String propName, Object value)
{
    if (!mConfig.setProperty(propName, value)) {
        if (XMLInputFactory.ALLOCATOR.equals(propName)) {
            setEventAllocator((XMLEventAllocator) value);
        }
    }
}
 
Example #11
Source File: WstxInputFactory.java    From woodstox with Apache License 2.0 4 votes vote down vote up
@Override
public void setEventAllocator(XMLEventAllocator allocator) {
    mAllocator = allocator;
}
 
Example #12
Source File: StAXEventReader.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public void setAllocator(XMLEventAllocator allocator) {
    if (allocator == null)
        throw new IllegalArgumentException(CommonResourceBundle.getInstance().getString("message.nullXMLEventAllocator"));

    _eventAllocator = allocator;
}
 
Example #13
Source File: StAXEventReader.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public void setAllocator(XMLEventAllocator allocator) {
    if (allocator == null)
        throw new IllegalArgumentException(CommonResourceBundle.getInstance().getString("message.nullXMLEventAllocator"));

    _eventAllocator = allocator;
}
 
Example #14
Source File: DefaultEventAllocator.java    From woodstox with Apache License 2.0 4 votes vote down vote up
@Override
public XMLEventAllocator newInstance() {
    return new DefaultEventAllocator(mAccurateLocation);
}
 
Example #15
Source File: XMLEventAllocatorImpl.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public javax.xml.stream.util.XMLEventAllocator newInstance() {
    return new XMLEventAllocatorImpl();
}
 
Example #16
Source File: XMLEventAllocatorImpl.java    From Bytecoder with Apache License 2.0 4 votes vote down vote up
public javax.xml.stream.util.XMLEventAllocator newInstance() {
    return new XMLEventAllocatorImpl();
}
 
Example #17
Source File: XMLInputFactoryWrapper.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public XMLEventAllocator getEventAllocator() {
    return defaultImpl.getEventAllocator();
}
 
Example #18
Source File: XMLInputFactoryWrapper.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void setEventAllocator(XMLEventAllocator allocator) {
    defaultImpl.setEventAllocator(allocator);
}
 
Example #19
Source File: XMLInputFactoryImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
public XMLEventAllocator getEventAllocator() {
    return (XMLEventAllocator)getProperty(XMLInputFactory.ALLOCATOR);
}
 
Example #20
Source File: XMLInputFactoryImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
/** Set a user defined event allocator for events
 * @param allocator the user defined allocator
 */
public void setEventAllocator(XMLEventAllocator allocator) {
    fPropertyManager.setProperty(XMLInputFactory.ALLOCATOR, allocator);
}
 
Example #21
Source File: StAXInputFactory.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
/** Set a user defined event allocator for events
 * @param allocator the user defined allocator
 */
public void setEventAllocator(XMLEventAllocator allocator) {
    _manager.setProperty(XMLInputFactory.ALLOCATOR, allocator);
}
 
Example #22
Source File: StAXInputFactory.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
/** Set a user defined event allocator for events
 * @param allocator the user defined allocator
 */
public void setEventAllocator(XMLEventAllocator allocator) {
    _manager.setProperty(XMLInputFactory.ALLOCATOR, allocator);
}
 
Example #23
Source File: StAXInputFactory.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
public XMLEventAllocator getEventAllocator() {
    return (XMLEventAllocator)getProperty(XMLInputFactory.ALLOCATOR);
}
 
Example #24
Source File: StAXInputFactory.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
/** Set a user defined event allocator for events
 * @param allocator the user defined allocator
 */
public void setEventAllocator(XMLEventAllocator allocator) {
    _manager.setProperty(XMLInputFactory.ALLOCATOR, allocator);
}
 
Example #25
Source File: MyInputFactory.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public XMLEventAllocator getEventAllocator() {
    throw new UnsupportedOperationException("Not supported yet.");
}
 
Example #26
Source File: XMLEventAllocatorImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
public javax.xml.stream.util.XMLEventAllocator newInstance() {
    return new XMLEventAllocatorImpl();
}
 
Example #27
Source File: XMLEventAllocatorImpl.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
public javax.xml.stream.util.XMLEventAllocator newInstance() {
    return new XMLEventAllocatorImpl();
}
 
Example #28
Source File: StAXEventReader.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public void setAllocator(XMLEventAllocator allocator) {
    if (allocator == null)
        throw new IllegalArgumentException(CommonResourceBundle.getInstance().getString("message.nullXMLEventAllocator"));

    _eventAllocator = allocator;
}
 
Example #29
Source File: XMLInputFactoryImpl.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
public XMLEventAllocator getEventAllocator() {
    return (XMLEventAllocator)getProperty(XMLInputFactory.ALLOCATOR);
}
 
Example #30
Source File: StAXInputFactory.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
public XMLEventAllocator getEventAllocator() {
    return (XMLEventAllocator)getProperty(XMLInputFactory.ALLOCATOR);
}