001: package com.wutka.jox.test;
002:
003: import com.wutka.jox.*;
004: import java.util.*;
005:
006: public class TestBean3 implements java.io.Serializable {
007: protected int foo;
008: protected String bar;
009: protected java.util.Date baz;
010: protected int[] quux;
011: protected Vector thingies;
012: protected Vector subbeans;
013:
014: public TestBean3() {
015: bar = "";
016: baz = new Date();
017: quux = new int[0];
018: thingies = new Vector();
019: subbeans = new Vector();
020: }
021:
022: public int getFoo() {
023: return foo;
024: }
025:
026: public void setFoo(int aFoo) {
027: foo = aFoo;
028: }
029:
030: public String getBar() {
031: return bar;
032: }
033:
034: public void setBar(String aBar) {
035: bar = aBar;
036: }
037:
038: public java.util.Date getBaz() {
039: return baz;
040: }
041:
042: public void setBaz(java.util.Date aBaz) {
043: baz = aBaz;
044: }
045:
046: public int[] getQuux() {
047: return quux;
048: }
049:
050: public void setQuux(int[] aQuux) {
051: quux = aQuux;
052: }
053:
054: public String[] getThingies() {
055: String[] retThingies = new String[thingies.size()];
056: if (thingies.size() > 0)
057: thingies.copyInto(retThingies);
058:
059: return retThingies;
060: }
061:
062: public void setThingies(String[] newThingies) {
063: thingies = new Vector(newThingies.length);
064: for (int i = 0; i < newThingies.length; i++) {
065: thingies.addElement(newThingies[i]);
066: }
067: }
068:
069: public TestSubbean[] getSubbeans() {
070: TestSubbean[] retSubbeans = new TestSubbean[subbeans.size()];
071: if (subbeans.size() > 0)
072: subbeans.copyInto(retSubbeans);
073:
074: return retSubbeans;
075: }
076:
077: public void setSubbeans(TestSubbean[] newSubbeans) {
078: subbeans = new Vector(newSubbeans.length);
079: for (int i = 0; i < newSubbeans.length; i++) {
080: subbeans.addElement(newSubbeans[i]);
081: }
082: }
083:
084: public String toString() {
085: StringBuffer ret = new StringBuffer("foo=" + foo + ";bar="
086: + bar + ";baz=" + baz.toString() + ";thingies=");
087: for (int i = 0; i < thingies.size(); i++) {
088: if (i > 0)
089: ret.append(",");
090: ret.append((String) thingies.elementAt(i));
091: }
092: ret.append(";quux=");
093: for (int i = 0; i < quux.length; i++) {
094: if (i > 0)
095: ret.append(",");
096: ret.append(quux[i]);
097: }
098:
099: ret.append(";subbeans=");
100: for (int i = 0; i < subbeans.size(); i++) {
101: if (i > 0)
102: ret.append("|");
103: ret.append(subbeans.elementAt(i).toString());
104: }
105:
106: return ret.toString();
107: }
108: }
|