[Batchserver-cvs] Batch_IO_1.1/src/org/jmonks/batch/io/ofx/parser Characters.java, 1.1.1.1, 1.2 End
Brought to you by:
suresh_pragada
From: Suresh <sur...@us...> - 2006-10-18 23:04:25
|
Update of /cvsroot/batchserver/Batch_IO_1.1/src/org/jmonks/batch/io/ofx/parser In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5841 Modified Files: Characters.java EndDocument.java EndElement.java OFXEvent.java OFXParser.java OFXParserFactory.java OFXStreamException.java StartDocument.java StartElement.java Log Message: no message Index: EndDocument.java =================================================================== RCS file: /cvsroot/batchserver/Batch_IO_1.1/src/org/jmonks/batch/io/ofx/parser/EndDocument.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** EndDocument.java 18 Oct 2006 03:19:18 -0000 1.1.1.1 --- EndDocument.java 18 Oct 2006 23:04:23 -0000 1.2 *************** *** 12,17 **** /** * ! * @author Suresh Pragada */ public interface EndDocument extends OFXEvent --- 12,22 ---- /** + * <p> + * EndDocument represents the </OFX> element in the stream. + * </p> * ! * @author Suresh Pragada ! * @version 1.1 ! * @since 1.1 */ public interface EndDocument extends OFXEvent Index: StartElement.java =================================================================== RCS file: /cvsroot/batchserver/Batch_IO_1.1/src/org/jmonks/batch/io/ofx/parser/StartElement.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** StartElement.java 18 Oct 2006 03:19:18 -0000 1.1.1.1 --- StartElement.java 18 Oct 2006 23:04:23 -0000 1.2 *************** *** 12,17 **** /** * ! * @author Suresh Pragada */ public interface StartElement extends OFXEvent --- 12,22 ---- /** + * <p> + * StartElement represents any start element in the stream except <OFX> + * </p> * ! * @author Suresh Pragada ! * @version 1.1 ! * @since 1.1 */ public interface StartElement extends OFXEvent Index: StartDocument.java =================================================================== RCS file: /cvsroot/batchserver/Batch_IO_1.1/src/org/jmonks/batch/io/ofx/parser/StartDocument.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** StartDocument.java 18 Oct 2006 03:19:18 -0000 1.1.1.1 --- StartDocument.java 18 Oct 2006 23:04:23 -0000 1.2 *************** *** 12,20 **** /** * ! * @author Suresh Pragada */ public interface StartDocument extends OFXEvent { - } --- 12,24 ---- /** + * <p> + * StartDocument represents the <OFX> element in the stream. + * </p> * ! * @author Suresh Pragada ! * @version 1.1 ! * @since 1.1 */ public interface StartDocument extends OFXEvent { } Index: OFXEvent.java =================================================================== RCS file: /cvsroot/batchserver/Batch_IO_1.1/src/org/jmonks/batch/io/ofx/parser/OFXEvent.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** OFXEvent.java 18 Oct 2006 03:19:18 -0000 1.1.1.1 --- OFXEvent.java 18 Oct 2006 23:04:23 -0000 1.2 *************** *** 12,28 **** /** * ! * @author Suresh Pragada */ public interface OFXEvent { int START_DOCUMENT = 1; int START_ELEMENT = 2; int CHARACTERS = 3; int END_ELEMENT = 4; int END_DOCUMENT = 5; int getEventType(); String getEventValue(); --- 12,56 ---- /** + * <p> + * OFXEvent represents the piece of information that OFXParser intended to return + * to the caller. + * </p> * ! * @author Suresh Pragada ! * @version 1.1 ! * @since 1.1 */ public interface OFXEvent { + /** + * Represents the StartDocument + */ int START_DOCUMENT = 1; + /** + * Represents the StartElement + */ int START_ELEMENT = 2; + /** + * Represents the Characters + */ int CHARACTERS = 3; + /** + * Represents the EndElement + */ int END_ELEMENT = 4; + /** + * Represents the EndDocument + */ int END_DOCUMENT = 5; + /** + * Tells the type of event. + */ int getEventType(); + /** + * Gets the event value. It is element name in case of StartElement, StartDocument + * , EndDocument and EndElement. + */ String getEventValue(); Index: OFXStreamException.java =================================================================== RCS file: /cvsroot/batchserver/Batch_IO_1.1/src/org/jmonks/batch/io/ofx/parser/OFXStreamException.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** OFXStreamException.java 18 Oct 2006 03:19:18 -0000 1.1.1.1 --- OFXStreamException.java 18 Oct 2006 23:04:23 -0000 1.2 *************** *** 12,17 **** /** * ! * @author Suresh Pragada */ public class OFXStreamException extends RuntimeException --- 12,23 ---- /** + * <p> + * To report the problems while reading and writing of OFXEvent from and + * to the OFX Stream. + * </p> * ! * @author Suresh Pragada ! * @version 1.1 ! * @since 1.1 */ public class OFXStreamException extends RuntimeException Index: EndElement.java =================================================================== RCS file: /cvsroot/batchserver/Batch_IO_1.1/src/org/jmonks/batch/io/ofx/parser/EndElement.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** EndElement.java 18 Oct 2006 03:19:18 -0000 1.1.1.1 --- EndElement.java 18 Oct 2006 23:04:23 -0000 1.2 *************** *** 12,17 **** /** * ! * @author Suresh Pragada */ public interface EndElement extends OFXEvent --- 12,22 ---- /** + * <p> + * EndElement represents any end element in the stream except </OFX> + * </p> * ! * @author Suresh Pragada ! * @version 1.1 ! * @since 1.1 */ public interface EndElement extends OFXEvent Index: OFXParserFactory.java =================================================================== RCS file: /cvsroot/batchserver/Batch_IO_1.1/src/org/jmonks/batch/io/ofx/parser/OFXParserFactory.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** OFXParserFactory.java 18 Oct 2006 03:19:18 -0000 1.1.1.1 --- OFXParserFactory.java 18 Oct 2006 23:04:23 -0000 1.2 *************** *** 19,29 **** /** ! * In case if we have different parser for XML block. ! * @author Suresh Pragada */ public abstract class OFXParserFactory { public static final int SGML_OFX_BLOCK = 1; public static final int XML_OFX_BLOCK = 2; public static OFXParser createOFXParser(Reader reader, int ofxBlockType) { --- 19,52 ---- /** ! * <p> ! * OFXParserFactory creates appropriate OFX Parser using the given reader ! * based OFX block type requested. ! * </p> ! * ! * @author Suresh Pragada ! * @version 1.1 ! * @since 1.1 */ public abstract class OFXParserFactory { + /** + * Represents the SMGL OFX Block. + */ public static final int SGML_OFX_BLOCK = 1; + /** + * Represents the XML OFX Block. + */ public static final int XML_OFX_BLOCK = 2; + + /** + * Creates the appropriate OFX Parser for the requested OFX Block type. + * + * @param reader Reader to the OFX File / data. + * @param ofxBlockType Type of the OFX Block defined in the factory. + * + * @return Returns the OFXParser instance. + * + * @throws java.lang.IllegalArgumentException If given reader is null or ofx block type is not supported. + */ public static OFXParser createOFXParser(Reader reader, int ofxBlockType) { *************** *** 42,49 **** } public static OFXParser createOFXParser(InputStream stream, int ofxBlockType) { if(stream==null) ! throw new IllegalArgumentException("Reader to parse OFX cannot be null."); OFXParser parser=createOFXParser(new BufferedReader(new InputStreamReader(stream)), ofxBlockType); return parser; --- 65,82 ---- } + /** + * Creates the appropriate OFX Parser for the requested OFX Block type. + * + * @param reader Input Stream to the OFX File / data. + * @param ofxBlockType Type of the OFX Block defined in the factory. + * + * @return Returns the OFXParser instance. + * + * @throws java.lang.IllegalArgumentException If given stream is null or ofx block type is not supported. + */ public static OFXParser createOFXParser(InputStream stream, int ofxBlockType) { if(stream==null) ! throw new IllegalArgumentException("Stream to parse OFX cannot be null."); OFXParser parser=createOFXParser(new BufferedReader(new InputStreamReader(stream)), ofxBlockType); return parser; Index: OFXParser.java =================================================================== RCS file: /cvsroot/batchserver/Batch_IO_1.1/src/org/jmonks/batch/io/ofx/parser/OFXParser.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** OFXParser.java 18 Oct 2006 03:19:18 -0000 1.1.1.1 --- OFXParser.java 18 Oct 2006 23:04:23 -0000 1.2 *************** *** 12,20 **** /** * ! * @author Suresh Pragada */ public interface OFXParser { ! OFXEvent getNextEvent() throws OFXStreamException; } --- 12,33 ---- /** + * <p> + * OFXParser reads the OFX Stream and returns the elements and their values + * as OFX Events. It it intended to read only OFX Data block and not with the headers. + * </p> * ! * @author Suresh Pragada ! * @version 1.1 ! * @since 1.1 */ public interface OFXParser { ! /** ! * Gets the next OFXEvent from the stream. ! * ! * @return Returns OFXEvent avilable in the stream, null if none is available. ! * ! * @throws OFXStreamException If there is any problem reading the events from the stream. ! */ ! OFXEvent getNextEvent(); } Index: Characters.java =================================================================== RCS file: /cvsroot/batchserver/Batch_IO_1.1/src/org/jmonks/batch/io/ofx/parser/Characters.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Characters.java 18 Oct 2006 03:19:18 -0000 1.1.1.1 --- Characters.java 18 Oct 2006 23:04:23 -0000 1.2 *************** *** 12,22 **** /** * ! * @author Suresh Pragada */ public interface Characters extends OFXEvent { boolean isCDATA(); String getCDATA(); } --- 12,35 ---- /** + * <p> + * Characters represents all the element values and CDATA sections. + * </p> * ! * @author Suresh Pragada ! * @version 1.1 ! * @since 1.1 */ public interface Characters extends OFXEvent { + /** + * Tells whether Charcater instance is CDATA or not. + * + * @return Returns true if the instance is CDATA section, false otherwise. + */ boolean isCDATA(); + /** + * Returns the character content wrapping with the <!CDATA[[]]> + */ String getCDATA(); } |