001: /***
002: * Retrotranslator: a Java bytecode transformer that translates Java classes
003: * compiled with JDK 5.0 into classes that can be run on JVM 1.4.
004: *
005: * Copyright (c) 2005 - 2008 Taras Puchko
006: * All rights reserved.
007: *
008: * Redistribution and use in source and binary forms, with or without
009: * modification, are permitted provided that the following conditions
010: * are met:
011: * 1. Redistributions of source code must retain the above copyright
012: * notice, this list of conditions and the following disclaimer.
013: * 2. Redistributions in binary form must reproduce the above copyright
014: * notice, this list of conditions and the following disclaimer in the
015: * documentation and/or other materials provided with the distribution.
016: * 3. Neither the name of the copyright holders nor the names of its
017: * contributors may be used to endorse or promote products derived from
018: * this software without specific prior written permission.
019: *
020: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
021: * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
022: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
023: * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
024: * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
025: * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
026: * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
027: * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
028: * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
029: * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
030: * THE POSSIBILITY OF SUCH DAMAGE.
031: */package net.sf.retrotranslator.tests.custom;
032:
033: import net.sf.retrotranslator.tests.TestBean;
034:
035: /**
036: * @author Taras Puchko
037: */
038: public class _TestBean {
039:
040: public static class FirstTestBeanBuilder {
041: private boolean visible;
042: private char sign;
043: private byte code;
044: private short width;
045: private int height;
046: private float opacity;
047: private long area;
048: private double weight;
049: private String name;
050:
051: protected FirstTestBeanBuilder(boolean visible, char sign,
052: byte code, short width, int height, float opacity,
053: long area, double weight, String name) {
054: this .visible = visible;
055: this .sign = sign;
056: this .code = code;
057: this .width = width;
058: this .height = height;
059: this .opacity = opacity;
060: this .area = area;
061: this .weight = weight;
062: this .name = name;
063: }
064:
065: public String argument1() {
066: return name;
067: }
068:
069: public double argument2() {
070: return weight;
071: }
072:
073: public long argument3() {
074: return area;
075: }
076:
077: public float argument4() {
078: return opacity;
079: }
080:
081: public int argument5() {
082: return height;
083: }
084:
085: public short argument6() {
086: return width;
087: }
088:
089: public byte argument7() {
090: return code;
091: }
092:
093: public boolean argument9() {
094: return visible;
095: }
096:
097: public char argument8() {
098: return sign;
099: }
100:
101: public void initialize(TestBean testBean) {
102: testBean.setState("initialized");
103: }
104:
105: }
106:
107: public static class SecondTestBeanBuilder {
108:
109: private String state;
110:
111: public SecondTestBeanBuilder(String state) {
112: this .state = state;
113: }
114:
115: public void initialize(TestBean testBean) {
116: testBean.setState(state);
117: }
118:
119: }
120:
121: public static FirstTestBeanBuilder createInstanceBuilder(
122: boolean visible, char sign, byte code, short width,
123: int height, float opacity, long area, double weight,
124: String name) {
125: return new FirstTestBeanBuilder(visible, sign, code, width,
126: height, opacity, area, weight, name);
127: }
128:
129: public static SecondTestBeanBuilder createInstanceBuilder(
130: String state) {
131: return new SecondTestBeanBuilder(state);
132: }
133:
134: }
|