|
|||||||||||||||||||
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 | |||||||||||||||
Any.java | 50% | 88.9% | 100% | 75% |
|
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.components;
|
|
16 |
|
|
17 |
import org.apache.hivemind.ApplicationRuntimeException;
|
|
18 |
import org.apache.tapestry.AbstractComponent;
|
|
19 |
import org.apache.tapestry.IMarkupWriter;
|
|
20 |
import org.apache.tapestry.IRequestCycle;
|
|
21 |
import org.apache.tapestry.Tapestry;
|
|
22 |
|
|
23 |
/**
|
|
24 |
* A component that can substitute for any HTML element.
|
|
25 |
*
|
|
26 |
* [<a href="../../../../../ComponentReference/Any.html">Component Reference</a>]
|
|
27 |
*
|
|
28 |
* @author Howard Lewis Ship
|
|
29 |
*
|
|
30 |
**/
|
|
31 |
|
|
32 |
public abstract class Any extends AbstractComponent |
|
33 |
{ |
|
34 | 11 |
protected void renderComponent(IMarkupWriter writer, IRequestCycle cycle) |
35 |
{ |
|
36 | 11 |
String element = getElement(); |
37 |
|
|
38 | 11 |
if (element == null) |
39 | 0 |
throw new ApplicationRuntimeException( |
40 |
Tapestry.getMessage("Any.element-not-defined"),
|
|
41 |
this,
|
|
42 |
null,
|
|
43 |
null);
|
|
44 |
|
|
45 | 11 |
if (!cycle.isRewinding())
|
46 |
{ |
|
47 | 11 |
writer.begin(element); |
48 |
|
|
49 | 11 |
renderInformalParameters(writer, cycle); |
50 |
} |
|
51 |
|
|
52 | 11 |
renderBody(writer, cycle); |
53 |
|
|
54 | 11 |
if (!cycle.isRewinding())
|
55 |
{ |
|
56 | 11 |
writer.end(element); |
57 |
} |
|
58 |
|
|
59 |
} |
|
60 |
|
|
61 |
public abstract String getElement();
|
|
62 |
} |
|