站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 3.2.7 messaging API Documentation 英文版文档

XElementProducer (JBoss Messaging API) - JBoss 3.2.7 messaging API Documentation 英文版文档


org.jboss.mq.xml
Class XElementProducer

java.lang.Object
  extended byorg.jboss.mq.xml.XElementProducer

public class XElementProducer
extends Object

XElementProducer parses and provides an XElementConsumer XElement data.

An XElementProducer is a SAX based XML parser. This class provides a hybrid of the Event Based and DOM based XML parsing models. This is done by telling the XElementProducer which elements signal the start of a record, and when to generat an XElement. As the "record" XML elements are encountered, XElements are produced. These XElements create an in memory DOM tree of the element and all sub elements. After the "record" element has be fully read in through the use of SAX events, the "record" element, now in the form of an XElement, is passed to an XElementConsumer for processing.

Version:
$Revision: 1.5 $
Author:
Hiram Chirino (Cojonudo14@hotmail.com)

Constructor Summary
XElementProducer(XElementConsumer consumerObject)
          The Constructor must be passed the consumer object.
 
Method Summary
 void addElementRecord(String name)
          Adds a name to the list of element names which when encountered, will produce an XElement record.
 void clearElementRecords()
          Clears all the previously added element record names.
 void parse(InputStream is)
          Starts parsing a file.
 void parse(URL url)
          Starts parsing a file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XElementProducer

public XElementProducer(XElementConsumer consumerObject)
The Constructor must be passed the consumer object.

Parameters:
consumerObject - the object that will process data produced from this object.
Method Detail

addElementRecord

public void addElementRecord(String name)
Adds a name to the list of element names which when encountered, will produce an XElement record.

Parameters:
name -

clearElementRecords

public void clearElementRecords()
Clears all the previously added element record names.


parse

public void parse(InputStream is)
           throws Exception
Starts parsing a file. As "record" elements are encountered, record XElements are produced and given to the XElementConsumer to process.

Parameters:
is - Description of Parameter
Throws:
Exception - includes IO errors, parse errors, or Exceptions thrown from the RecordConsumer.

parse

public void parse(URL url)
           throws Exception
Starts parsing a file. As "record" elements are encountered, record XElements are produced and given to the XElementConsumer to process.

Parameters:
url - Description of Parameter
Throws:
Exception - includes IO errors, parse errors, or Exceptions thrown from the RecordConsumer.


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.