home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2004 May / DPPCPRO0504.ISO / May / Seatools / SeaTools.iso / tools / en / webhelp / webhelp.jar / BsscXML / BsscXMLDocument.class (.txt) < prev    next >
Encoding:
Java Class File  |  2002-04-17  |  1.1 KB  |  45 lines

  1. package BsscXML;
  2.  
  3. public class BsscXMLDocument implements IBsscXMLDocumentBuilder, IBsscXMLDocumentReader {
  4.    BsscXMLElement m_root = null;
  5.    BsscXMLConsumerChain m_ConsumerChain = null;
  6.  
  7.    public void setRoot(IBsscXMLElementBuilder var1) throws BsscXMLException {
  8.       if (this.m_root == null) {
  9.          if (var1 instanceof BsscXMLElement) {
  10.             this.m_root = (BsscXMLElement)var1;
  11.          } else {
  12.             throw new BsscXMLException("Type Mismatch!");
  13.          }
  14.       } else {
  15.          throw new BsscXMLException("Only one Root element is allowed!");
  16.       }
  17.    }
  18.  
  19.    public IBsscXMLElementReader getRoot() {
  20.       return this.m_root;
  21.    }
  22.  
  23.    public void setReady(boolean var1) {
  24.       if (this.m_ConsumerChain != null) {
  25.          this.m_ConsumerChain.consume(this.m_root);
  26.       }
  27.  
  28.    }
  29.  
  30.    public void removeConsumer(IBsscXMLConsumer var1) {
  31.       if (this.m_ConsumerChain != null) {
  32.          this.m_ConsumerChain.remove(var1);
  33.       }
  34.  
  35.    }
  36.  
  37.    public void addConsumer(IBsscXMLConsumer var1) {
  38.       if (this.m_ConsumerChain == null) {
  39.          this.m_ConsumerChain = new BsscXMLConsumerChain();
  40.       }
  41.  
  42.       this.m_ConsumerChain.add(var1);
  43.    }
  44. }
  45.