de.ispsoft.jaxme.generator.dtd
Class RootNodeReader

java.lang.Object
  extended byjava.io.Reader
      extended byde.ispsoft.jaxme.generator.dtd.RootNodeReader

public class RootNodeReader
extends java.io.Reader

The RootNodeReader solves the problem that we can only parse XML documents and not a DTD. It does so by prepending the actual DTD with the lines

   <!DOCTYPE myInvisibleRootNode [
     <!ELEMENT myInvisibleRootNode ANY>
 
and appending the lines
   ]>
   <myInvisibleRootNode/>
 
In other words, it converts the DTD into a well formed XML document, which we may parse.

Version:
$Id: RootNodeReader.java,v 1.2 2003/04/24 20:09:36 joe Exp $
Author:
Jochen Wiedmann

Field Summary
 
Fields inherited from class java.io.Reader
lock
 
Constructor Summary
RootNodeReader(org.xml.sax.InputSource pSource)
          Constructor for RootNodeReader.
 
Method Summary
 void close()
          Closes the parent Reader.
 java.lang.String getRootNodeName()
          Returns the name of the invisible root node.
 int read(char[] pBuffer, int pOffset, int pLen)
           
 void setRootNodeName(java.lang.String pName)
          Sets the name of the invisible root node.
 
Methods inherited from class java.io.Reader
mark, markSupported, read, read, ready, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RootNodeReader

public RootNodeReader(org.xml.sax.InputSource pSource)
Constructor for RootNodeReader.

Method Detail

setRootNodeName

public void setRootNodeName(java.lang.String pName)

Sets the name of the invisible root node.


getRootNodeName

public java.lang.String getRootNodeName()

Returns the name of the invisible root node.


read

public int read(char[] pBuffer,
                int pOffset,
                int pLen)
         throws java.io.IOException
Throws:
java.io.IOException
See Also:
Reader.read(char[], int, int)

close

public void close()
           throws java.io.IOException

Closes the parent Reader.

Throws:
java.io.IOException