Formally, a DTD for the JOCL grammar is as follows:
<!ELEMENT object (object|array|collection|list|byte|boolean|char|double|float|int|long|short|string)*> <!ATTLIST object class CDATA #REQUIRED null (true|false) "false"> <!ELEMENT byte EMPTY> <!ATTLIST byte value CDATA #REQUIRED> <!ELEMENT boolean EMPTY> <!ATTLIST boolean value (true|false) #REQUIRED> <!ELEMENT char EMPTY> <!ATTLIST char value CDATA #REQUIRED> <!ELEMENT double EMPTY> <!ATTLIST double value CDATA #REQUIRED> <!ELEMENT float EMPTY> <!ATTLIST float value CDATA #REQUIRED> <!ELEMENT int EMPTY> <!ATTLIST int value CDATA #REQUIRED> <!ELEMENT long EMPTY> <!ATTLIST long value CDATA #REQUIRED> <!ELEMENT short EMPTY> <!ATTLIST short value CDATA #REQUIRED> <!ELEMENT string EMPTY> <!ATTLIST string value CDATA #REQUIRED>
This class can also be used as a base class for {@link org.xml.sax.ContentHandler}s that include JOCL as part of their grammar. Simply extend this class, and override the {@link #startElement}, {@link #characters}, and {@link #endElement} methods to handleyour tags, and invoke the method of the parent class (i.e., super.XXX for elements and data that you don't handle.
A number of static methods are available for simply reading a list of objects from a {@link InputStream}, {@link Reader} or {@link InputSource}.
Note that this class is not synchronized.
@author Rodney Waldhoff @version $Revision: 883416 $ $Date: 2009-11-23 12:12:14 -0500 (Mon, 23 Nov 2009) $
|
|