01: //** Copyright Statement ***************************************************
02: //The Salmon Open Framework for Internet Applications (SOFIA)
03: // Copyright (C) 1999 - 2002, Salmon LLC
04: //
05: // This program is free software; you can redistribute it and/or
06: // modify it under the terms of the GNU General Public License version 2
07: // as published by the Free Software Foundation;
08: //
09: // This program is distributed in the hope that it will be useful,
10: // but WITHOUT ANY WARRANTY; without even the implied warranty of
11: // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12: // GNU General Public License for more details.
13: //
14: // You should have received a copy of the GNU General Public License
15: // along with this program; if not, write to the Free Software
16: // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17: //
18: // For more information please visit http://www.salmonllc.com
19: //** End Copyright Statement ***************************************************
20:
21: package com.salmonllc.parser;
22:
23: /**
24: * This interface is a mechanism to describe a custom translation for a column in the byte array. <BR>
25: * For Example if the data value in the byte array is A, this A can be translated to a more meaningful <BR>
26: * description, such as Allowed.
27: */
28:
29: public interface CustomType {
30:
31: /**
32: To get the translated object representation of a specified value at the column represented by this <CODE>CustomType</CODE>.
33: This gets called by the getObject method in ByteArrayParser to give the object representation of a column.
34:
35: <P><PRE>
36: Method: public Object getDataValue(String sLookup);
37: Visibility: Public
38: Purpose: To return the translated object representation of the data.
39: </PRE></P>
40: @param sLookup The data at the location of this column in the ByteArrayParser.
41: @return Returns the translated object representation of the data.
42: */
43: public Object getDataValue(String sLookup);
44:
45: /**
46: To get the string value representation of an object to be set at the column for this <CODE>CustomType</CODE>.
47: This gets called by the setObject method in ByteArrayParser to set the string value representation of the column.
48:
49: <P><PRE>
50: Method: public String toString(Object oValue);
51: Visibility: Public
52: Purpose: To return the string value representation of the passed object.
53: </PRE></P>
54: @param oValue The Object to set this column to in the ByteArrayParser.
55: @return Returns the string value representation of this object.
56: */
57: public String toString(Object oValue);
58: }
|