home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / xml4j.jar / com / ibm / xml / internal / XMLDeclReader.class (.txt) < prev   
Encoding:
Java Class File  |  1999-08-30  |  3.1 KB  |  174 lines

  1. package com.ibm.xml.internal;
  2.  
  3. import com.ibm.xml.framework.ChunkyByteArray;
  4. import com.ibm.xml.framework.ChunkyCharArray;
  5. import com.ibm.xml.framework.ParserState;
  6. import com.ibm.xml.framework.ScanContentState;
  7. import com.ibm.xml.framework.XMLReader;
  8. import java.io.IOException;
  9.  
  10. final class XMLDeclReader extends XMLReader {
  11.    private ChunkyByteArray fData;
  12.    private ParserState fParserState;
  13.  
  14.    XMLDeclReader(ChunkyByteArray var1, ParserState var2) {
  15.       super((ParserState)null, (String)null, (String)null);
  16.       this.fData = var1;
  17.       this.fParserState = var2;
  18.    }
  19.  
  20.    public boolean skippedChar(char var1) throws IOException {
  21.       if (this.fData.byteAt(super.fCurrentOffset) != var1) {
  22.          return false;
  23.       } else {
  24.          ++super.fCurrentOffset;
  25.          return true;
  26.       }
  27.    }
  28.  
  29.    public boolean lookingAtChar(char var1) throws IOException {
  30.       return this.fData.byteAt(super.fCurrentOffset) == var1;
  31.    }
  32.  
  33.    public boolean skippedSpace() throws IOException {
  34.       int var1 = this.fData.byteAt(super.fCurrentOffset) & 255;
  35.       if (var1 != 32 && var1 != 9 && var1 != 10 && var1 != 13) {
  36.          return false;
  37.       } else {
  38.          ++super.fCurrentOffset;
  39.          return true;
  40.       }
  41.    }
  42.  
  43.    public int skipPastSpaces() throws IOException {
  44.       while(true) {
  45.          int var1 = this.fData.byteAt(super.fCurrentOffset) & 255;
  46.          if (var1 != 32 && var1 != 9 && var1 != 10 && var1 != 13) {
  47.             return super.fCurrentOffset;
  48.          }
  49.  
  50.          ++super.fCurrentOffset;
  51.       }
  52.    }
  53.  
  54.    public boolean skippedAlpha() throws IOException {
  55.       int var1 = this.fData.byteAt(super.fCurrentOffset) & 255;
  56.       if (var1 <= 122 && XMLReader.fgAsciiAlphaChar[var1] != 0) {
  57.          ++super.fCurrentOffset;
  58.          return true;
  59.       } else {
  60.          return false;
  61.       }
  62.    }
  63.  
  64.    private boolean skippedAsciiCharWithFlag(byte var1) throws IOException {
  65.       int var2 = this.fData.byteAt(super.fCurrentOffset) & 255;
  66.       if ((var2 & 128) == 0 && (XMLReader.fgCharFlags[var2] & var1) != 0) {
  67.          ++super.fCurrentOffset;
  68.          return true;
  69.       } else {
  70.          return false;
  71.       }
  72.    }
  73.  
  74.    public boolean skippedVersionNum() throws IOException {
  75.       return this.skippedAsciiCharWithFlag((byte)1);
  76.    }
  77.  
  78.    public boolean skippedEncName() throws IOException {
  79.       return this.skippedAsciiCharWithFlag((byte)2);
  80.    }
  81.  
  82.    public boolean skippedString(char[] var1) throws IOException {
  83.       int var2 = super.fCurrentOffset;
  84.  
  85.       for(int var3 = 0; var3 < var1.length; ++var3) {
  86.          if (this.fData.byteAt(var2) != var1[var3]) {
  87.             return false;
  88.          }
  89.  
  90.          ++var2;
  91.       }
  92.  
  93.       super.fCurrentOffset = var2;
  94.       return true;
  95.    }
  96.  
  97.    public int addString(int var1, int var2) {
  98.       StringBuffer var3 = new StringBuffer();
  99.  
  100.       for(int var4 = 0; var4 < var2; ++var4) {
  101.          var3.append((char)this.fData.byteAt(var1 + var4));
  102.       }
  103.  
  104.       return this.fParserState.getStringPool().addString(var3.toString());
  105.    }
  106.  
  107.    public int addSymbol(int var1, int var2) {
  108.       return -1;
  109.    }
  110.  
  111.    public void append(ChunkyCharArray var1, int var2, int var3) {
  112.    }
  113.  
  114.    public int skipOneChar() throws IOException {
  115.       throw new IOException();
  116.    }
  117.  
  118.    public int skipAsciiChar() throws IOException {
  119.       throw new IOException();
  120.    }
  121.  
  122.    public int skipToChar(char var1) throws IOException {
  123.       throw new IOException();
  124.    }
  125.  
  126.    public int skipPastChar(char var1) throws IOException {
  127.       throw new IOException();
  128.    }
  129.  
  130.    public boolean skippedValidChar() throws IOException {
  131.       throw new IOException();
  132.    }
  133.  
  134.    public boolean lookingAtValidChar() throws IOException {
  135.       throw new IOException();
  136.    }
  137.  
  138.    public int skipInvalidChar(int var1) throws Exception {
  139.       throw new IOException();
  140.    }
  141.  
  142.    public boolean lookingAtSpace() throws IOException {
  143.       throw new IOException();
  144.    }
  145.  
  146.    public int skipDecimalDigit() throws IOException {
  147.       throw new IOException();
  148.    }
  149.  
  150.    public int skipHexDigit() throws IOException {
  151.       throw new IOException();
  152.    }
  153.  
  154.    public boolean skippedPubidChar() throws IOException {
  155.       throw new IOException();
  156.    }
  157.  
  158.    public int scanName(char var1, int var2) throws IOException {
  159.       throw new IOException();
  160.    }
  161.  
  162.    public int skipPastName(char var1) throws IOException {
  163.       throw new IOException();
  164.    }
  165.  
  166.    public int skipPastNmtoken(char var1) throws IOException {
  167.       throw new IOException();
  168.    }
  169.  
  170.    public int scanContent(ScanContentState var1) throws Exception {
  171.       throw new IOException();
  172.    }
  173. }
  174.