|
|||||||||||||||||||
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
BeanSetPropertySetter.java | 100% | 100% | 100% | 100% |
|
1 |
// Copyright 2004, 2005 The Apache Software Foundation
|
|
2 |
//
|
|
3 |
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4 |
// you may not use this file except in compliance with the License.
|
|
5 |
// You may obtain a copy of the License at
|
|
6 |
//
|
|
7 |
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8 |
//
|
|
9 |
// Unless required by applicable law or agreed to in writing, software
|
|
10 |
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11 |
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12 |
// See the License for the specific language governing permissions and
|
|
13 |
// limitations under the License.
|
|
14 |
|
|
15 |
package org.apache.tapestry.parse;
|
|
16 |
|
|
17 |
import org.apache.hivemind.impl.BaseLocatable;
|
|
18 |
import org.apache.tapestry.bean.BindingBeanInitializer;
|
|
19 |
import org.apache.tapestry.spec.IBeanSpecification;
|
|
20 |
|
|
21 |
/**
|
|
22 |
* Holds the data from a <set-property> element while the body is being parsed.
|
|
23 |
*
|
|
24 |
* @author Howard Lewis Ship
|
|
25 |
*/
|
|
26 |
class BeanSetPropertySetter extends BaseLocatable |
|
27 |
{ |
|
28 |
private IBeanSpecification _beanSpecification;
|
|
29 |
|
|
30 |
private BindingBeanInitializer _initializer;
|
|
31 |
|
|
32 |
private String _bindingReference;
|
|
33 |
|
|
34 |
private String _prefix;
|
|
35 |
|
|
36 | 13 |
BeanSetPropertySetter(IBeanSpecification beanSpecification, BindingBeanInitializer initializer, |
37 |
String prefix, String expression) |
|
38 |
{ |
|
39 | 13 |
_beanSpecification = beanSpecification; |
40 | 13 |
_initializer = initializer; |
41 | 13 |
_prefix = prefix; |
42 | 13 |
_bindingReference = expression; |
43 |
} |
|
44 |
|
|
45 | 13 |
void applyBindingReference(String bindingReference)
|
46 |
{ |
|
47 | 13 |
String fullBindingReference = _prefix == null ? bindingReference : _prefix
|
48 |
+ bindingReference; |
|
49 |
|
|
50 | 13 |
_initializer.setBindingReference(fullBindingReference); |
51 |
|
|
52 | 13 |
_beanSpecification.setLocation(getLocation()); |
53 | 13 |
_beanSpecification.addInitializer(_initializer); |
54 |
} |
|
55 |
|
|
56 | 13 |
public String getBindingReference()
|
57 |
{ |
|
58 | 13 |
return _bindingReference;
|
59 |
} |
|
60 |
|
|
61 |
} |
|