summaryrefslogtreecommitdiffstats
path: root/sca-java-1.x/branches/sca-java-1.6.2/vtest/java-api/annotations/property/src/main/java/org/apache/tuscany/sca/vtest/javaapi/annotations/property/impl/AServiceImpl.java
blob: b385083533ef8b4f7c79092eb3d242fb7ade10d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 * 
 *   http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.    
 */

package org.apache.tuscany.sca.vtest.javaapi.annotations.property.impl;

import java.util.List;

import org.apache.tuscany.sca.vtest.javaapi.annotations.property.AService;
import org.osoa.sca.annotations.Service;
import org.osoa.sca.annotations.Property;

@Service(AService.class)
public class AServiceImpl implements AService {

	@Property
	protected String p1;			// simple Java type injected via field
	
	@Property
	public String p2;				// simple Java type injected via field

	protected String p3;			// simple Java type injected via setter
	
	public String p4;				// simple Java type injected via setter

	protected String p5;			// simple Java type injected via constructor parameter
	
	public String p6;				// simple Java type injected via constructor parameter

	@Property(required=true)
	protected AObject p7;			// complex Java type injected via field
	
	@Property
	public AObject p8;				// complex Java type injected via field

	protected AObject p9;			// complex Java type injected via setter
	
	public AObject p10;				// complex Java type injected via setter

	protected AObject p11;			// complex Java type injected via constructor parameter
	
	public AObject p12;				// complex Java type injected via constructor parameter

	@Property(name="pFifteen")
	protected String p15;			// injected via field with different name

	protected String p16;			// injected via setter with different name

	@Property(name="p17", required=false)
	public String p17;				// injected via field but not defined in composite

	public String p18;				// injected via setter but not defined in composite

	@Property(name="p19", required=true)
	public List<String> p19;		// a List and injected via field with no element

	public List<String> p20;		// a List and injected via setter

	@Property(required=false)
	public Integer[] p21;			// an array and injected via field
	
    public String getName() {
        return "AService";
    }
    
    public AServiceImpl(
    		@Property(name = "p5") String p5, 
    		@Property(name = "p6") String p6,
    		@Property(name = "p11") AObject p11,
    		@Property(name = "p12") AObject p12
    		) {
    	super();
    	this.p5 = p5;
    	this.p6 = p6;
    	this.p11 = p11;
    	this.p12 = p12;
    }

    @Property
    public void setP3(String p3) {
		this.p3 = p3;
	}

    @Property(required=true)
    public void setP4(String p4) {
		this.p4 = p4;
	}

    @Property
    public void setP9(AObject p9) {
		this.p9 = p9;
	}

    @Property
    public void setP10(AObject p10) {
		this.p10 = p10;
	}
    
    @Property(name="pSixteen")
    public void setP16(String p16) {
		this.p16 = p16;
	}
    
	@Property(name="p18", required=false)
    public void setP18(String p18) {
		this.p18 = p18;
	}
    
	@Property(name="p20", required=true)
	public void setP20(List<String> p20) {
		this.p20 = p20;
	}

	public String getP1() {
		return p1;
	}

	public String getP2() {
		return p2;
	}

	public String getP3() {
		return p3;
	}

	public String getP4() {
		return p4;
	}

	public String getP5() {
		return p5;
	}

	public String getP6() {
		return p6;
	}

	public String getP7AString() {
		return p7.aString;
	}

	public int getP7BInt() {
		return p7.bInt;
	}
	
	public String getP8AString() {
		return p8.aString;
	}

	public int getP8BInt() {
		return p8.bInt;
	}
	
	public String getP9AString() {
		return p9.aString;
	}

	public int getP9BInt() {
		return p9.bInt;
	}
	
	public String getP10AString() {
		return p10.aString;
	}

	public int getP10BInt() {
		return p10.bInt;
	}

	public String getP11AString() {
		return p11.aString;
	}

	public int getP11BInt() {
		return p11.bInt;
	}

	public String getP12AString() {
		return p12.aString;
	}

	public int getP12BInt() {
		return p12.bInt;
	}

	public String getP15() {
		return p15;
	}

	public String getP16() {
		return p16;
	}

	public String getP17() {
		return p17;
	}

	public String getP18() {
		return p18;
	}

	public int getP19Size() {
		return p19.size();
	}

	public String getP20(int i) {
		return p20.get(i);
	}

	public int getP20Size() {
		return p20.size();
	}

	public int getP21(int i) {
		return p21[i].intValue();
	}

	public int getP21Size() {
		return p21.length;
	}

}