001: //** Copyright Statement ***************************************************
002: //The Salmon Open Framework for Internet Applications (SOFIA)
003: // Copyright (C) 1999 - 2002, Salmon LLC
004: //
005: // This program is free software; you can redistribute it and/or
006: // modify it under the terms of the GNU General Public License version 2
007: // as published by the Free Software Foundation;
008: //
009: // This program is distributed in the hope that it will be useful,
010: // but WITHOUT ANY WARRANTY; without even the implied warranty of
011: // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
012: // GNU General Public License for more details.
013: //
014: // You should have received a copy of the GNU General Public License
015: // along with this program; if not, write to the Free Software
016: // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
017: //
018: // For more information please visit http://www.salmonllc.com
019: //** End Copyright Statement ***************************************************
020:
021: package com.salmonllc.parser;
022:
023: /**
024: * This interface is a mechanism to let you create a class that contains a ByteArrayParser.
025: * And be able to manipulate the ByteArrayParser from some other class.
026: */
027:
028: public interface ParserInterface {
029: /**
030: To set a column with an object for a specified column in a <CODE>ByteArrayParser</CODE>.
031:
032: <P><PRE>
033: Method: public void setObject(String sProperty,Object oValue) throws Exception
034: Visibility: Public
035: Purpose: To set the value of a column in a parsed object.
036: </PRE></P>
037: @param sProperty Specifies the property/Column that you wish to set the value of.
038: @oValue Specifies the value you want to set to a particular property/Column.
039: @exception Exception <P><PRE>Throws five possible Exception under these Circumstances.
040: Circumstance 1: If the property/column specified does not exist.
041: Circumstance 2: If the length of the values being passed is not equal to the required column length for String objects.
042: Circumstance 3: If doParse has not been called.
043: Circumstance 4: If the object passed is null.
044: Circumstance 5: If the value of an Integer or Float type is not within its min/max range determined by its length.
045: </PRE></P>
046: */
047: public void setObject(String sField, Object oValue)
048: throws ParserException;
049:
050: /**
051: To set the bytes of a column from a string for a specified column in a <CODE>ByteArrayParser</CODE>.
052:
053: <P><PRE>
054: Method: public void setValue(String sProperty,String sValue) throws Exception
055: Visibility: Public
056: Purpose: To set the value of a column in a parsed object.
057: </PRE></P>
058: @param sProperty Specifies the property/Column that you wish to set the value of.
059: @param sValue Specifies the value you want to set to a particular property/Column.
060: @exception Exception <P><PRE>Throws two possible Exception under these Circumstances.
061: Circumstance 1: If the property/column specified does not exist.
062: Circumstance 2: If the length of the values being passed is not equal to the required column length.
063: </PRE></P>
064: */
065: public void setValue(String sField, String sValue)
066: throws ParserException;
067:
068: /**
069: To get an object representation of a column from a specified column in a <CODE>ByteArrayParser</CODE>.
070:
071: <P><PRE>
072: Method: public Object getObject(String sProperty) throws Exception
073: Visibility: Public
074: Purpose: To get the object value of a column from a parsed object.
075: </PRE></P>
076: @param sProperty Specifies the property/Column that you wish to get the value of.
077: @return Returns the value of the specified column as an Object.
078: @exception Exception <P><PRE>Throws two possible Exception under this Circumstance.
079: Circumstance: If doParse method was never called.
080: Circumstance: If the property/column specified does not exist.
081: </PRE></P>
082: */
083: public Object getObject(String sField) throws ParserException;
084:
085: /**
086: To get the bytes of a column as a string from a specified column in a <CODE>ByteArrayParser</CODE>.
087:
088: <P><PRE>
089: Method: public String getValue(String sProperty) throws Exception
090: Visibility: Public
091: Purpose: To get the value of a column from a parsed object.
092: </PRE></P>
093: @param sProperty Specifies the property/Column that you wish to get the value of.
094: @return Returns the value of the specified column.
095: @exception Exception <P><PRE>Throws one possible Exception under this Circumstance.
096: Circumstance: If the property/column specified does not exist.
097: </PRE></P>
098: */
099: public String getValue(String sField) throws ParserException;
100:
101: /**
102: To get a column precision of a specified column in a <CODE>ByteArrayParser</CODE>.
103:
104: <P><PRE>
105: Method: public int getPrecision(String sProperty)
106: Visibility: Public
107: Purpose: To return the precision of a specified column.
108: </PRE></P>
109: @param sProperty Specifies the property/Column that you wish to get the value of.
110: @return Returns the precision of the specified column.
111: @exception Exception <P><PRE>Throws one possible Exception under this Circumstance.
112: Circumstance: If the property/column specified does not exist.
113: </PRE></P>
114: */
115: public int getPrecision(String sField) throws ParserException;
116:
117: }
|