| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| InvariantBinding |
|
| 0.0;0 |
| 1 | // Copyright 2008, 2009 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.tapestry5.internal.bindings; | |
| 16 | ||
| 17 | import org.apache.tapestry5.ioc.Location; | |
| 18 | ||
| 19 | /** | |
| 20 | * Extends {@link org.apache.tapestry5.internal.bindings.AbstractBinding} with a description and a binding type, with | |
| 21 | * invariant forced to true. | |
| 22 | */ | |
| 23 | public abstract class InvariantBinding extends AbstractBinding | |
| 24 | { | |
| 25 | private final Class bindingType; | |
| 26 | ||
| 27 | protected final String description; | |
| 28 | ||
| 29 | public InvariantBinding(Location location, Class bindingType, String description) | |
| 30 | { | |
| 31 | 215 | super(location); |
| 32 | ||
| 33 | 215 | this.bindingType = bindingType; |
| 34 | 215 | this.description = description; |
| 35 | 215 | } |
| 36 | ||
| 37 | /** | |
| 38 | * Returns true. | |
| 39 | */ | |
| 40 | @Override | |
| 41 | public boolean isInvariant() | |
| 42 | { | |
| 43 | 2685 | return true; |
| 44 | } | |
| 45 | ||
| 46 | @Override | |
| 47 | public Class getBindingType() | |
| 48 | { | |
| 49 | 0 | return bindingType; |
| 50 | } | |
| 51 | ||
| 52 | @Override | |
| 53 | public String toString() | |
| 54 | { | |
| 55 | 0 | return String.format("InvariantBinding[%s]", description); |
| 56 | } | |
| 57 | } |