001: /*
002: * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
003: * Distributed under the terms of either:
004: * - the common development and distribution license (CDDL), v1.0; or
005: * - the GNU Lesser General Public License, v2.1 or later
006: * $Id: BeanErrorImpl.java 3634 2007-01-08 21:42:24Z gbevin $
007: */
008: package com.uwyn.rife.database;
009:
010: import java.math.BigDecimal;
011: import java.sql.Time;
012: import java.sql.Timestamp;
013: import java.util.Calendar;
014:
015: public class BeanErrorImpl {
016: public BeanErrorImpl() {
017: }
018:
019: public int getPropertyInt() throws Exception {
020: throw new Exception("an error");
021: }
022:
023: public void setPropertyInt(int propertyInt) {
024: }
025:
026: public String getPropertyString() throws Exception {
027: throw new Exception("an error");
028: }
029:
030: public void setPropertyString(String propertyString) {
031: }
032:
033: public double getPropertyDouble() throws Exception {
034: throw new Exception("an error");
035: }
036:
037: public void setPropertyDouble(double propertyDouble) {
038: }
039:
040: public StringBuffer getPropertyStringbuffer() throws Exception {
041: throw new Exception("an error");
042: }
043:
044: public void setPropertyStringbuffer(
045: StringBuffer propertyStringbuffer) {
046: }
047:
048: public java.util.Date getPropertyDate() throws Exception {
049: throw new Exception("an error");
050: }
051:
052: public void setPropertyDate(java.util.Date propertyDate) {
053: }
054:
055: public java.util.Calendar getPropertyCalendar() throws Exception {
056: throw new Exception("an error");
057: }
058:
059: public void setPropertyCalendar(java.util.Calendar propertyCalendar) {
060: }
061:
062: public java.sql.Date getPropertySqlDate() throws Exception {
063: throw new Exception("an error");
064: }
065:
066: public void setPropertySqlDate(java.sql.Date propertySqlDate) {
067: }
068:
069: public java.sql.Time getPropertyTime() throws Exception {
070: throw new Exception("an error");
071: }
072:
073: public void setPropertyTime(java.sql.Time propertyTime) {
074: }
075:
076: public java.sql.Timestamp getPropertyTimestamp() throws Exception {
077: throw new Exception("an error");
078: }
079:
080: public void setPropertyTimestamp(
081: java.sql.Timestamp propertyTimestamp) {
082: }
083:
084: public boolean isPropertyBoolean() throws Exception {
085: throw new Exception("an error");
086: }
087:
088: public void setPropertyBoolean(boolean propertyBoolean) {
089: }
090:
091: public byte getPropertyByte() throws Exception {
092: throw new Exception("an error");
093: }
094:
095: public void setPropertyByte(byte propertyByte) {
096: }
097:
098: public float getPropertyFloat() throws Exception {
099: throw new Exception("an error");
100: }
101:
102: public void setPropertyFloat(float propertyFloat) {
103: }
104:
105: public long getPropertyLong() throws Exception {
106: throw new Exception("an error");
107: }
108:
109: public void setPropertyLong(long propertyLong) {
110: }
111:
112: public short getPropertyShort() throws Exception {
113: throw new Exception("an error");
114: }
115:
116: public void setPropertyShort(short propertyShort) {
117: }
118:
119: public char getPropertyChar() throws Exception {
120: throw new Exception("an error");
121: }
122:
123: public void setPropertyChar(char propertyChar) {
124: }
125:
126: public BigDecimal getPropertyBigDecimal() throws Exception {
127: throw new Exception("an error");
128: }
129:
130: public void setPropertyBigDecimal(BigDecimal propertyBigDecimal) {
131: }
132:
133: public static BeanErrorImpl getPopulatedBean() {
134: BeanErrorImpl bean = new BeanErrorImpl();
135: Calendar cal = Calendar.getInstance();
136: cal.set(2002, 5, 18, 15, 26, 14);
137: cal.set(Calendar.MILLISECOND, 764);
138: bean.setPropertyString("someotherstring");
139: bean.setPropertyStringbuffer(new StringBuffer(
140: "someotherstringbuff"));
141: bean.setPropertyDate(cal.getTime());
142: bean.setPropertyCalendar(cal);
143: bean.setPropertySqlDate(new java.sql.Date(cal.getTime()
144: .getTime()));
145: bean.setPropertyTime(new Time(cal.getTime().getTime()));
146: bean
147: .setPropertyTimestamp(new Timestamp(cal.getTime()
148: .getTime()));
149: bean.setPropertyChar('v');
150: bean.setPropertyBoolean(true);
151: bean.setPropertyByte((byte) 89);
152: bean.setPropertyDouble(53348.34d);
153: bean.setPropertyFloat(98634.2f);
154: bean.setPropertyInt(545);
155: bean.setPropertyLong(34563L);
156: bean.setPropertyShort((short) 43);
157: bean.setPropertyBigDecimal(new BigDecimal("219038743.392874"));
158:
159: return bean;
160: }
161:
162: public static BeanErrorImpl getNullBean() {
163: BeanErrorImpl bean = new BeanErrorImpl();
164: bean.setPropertyString(null);
165: bean.setPropertyStringbuffer(null);
166: bean.setPropertyDate(null);
167: bean.setPropertyCalendar(null);
168: bean.setPropertySqlDate(null);
169: bean.setPropertyTime(null);
170: bean.setPropertyTimestamp(null);
171: bean.setPropertyChar((char) 0);
172: bean.setPropertyBoolean(false);
173: bean.setPropertyByte((byte) 0);
174: bean.setPropertyDouble(0d);
175: bean.setPropertyFloat(0f);
176: bean.setPropertyInt(0);
177: bean.setPropertyLong(0L);
178: bean.setPropertyShort((short) 0);
179: bean.setPropertyBigDecimal(null);
180:
181: return bean;
182: }
183: }
|