下面列出了javax.xml.stream.util.XMLEventAllocator#allocate ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
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"));
}
}
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"));
}
}
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"));
}
}
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"));
}
}
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"));
}
}
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"));
}
}
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"));
}
}
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"));
}
}