| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| BeanBlockOverrideSource |
|
| 0.0;0 |
| 1 | // Copyright 2008 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.services; | |
| 16 | ||
| 17 | import org.apache.tapestry5.Block; | |
| 18 | import org.apache.tapestry5.ioc.annotations.UsesConfiguration; | |
| 19 | ||
| 20 | /** | |
| 21 | * Used to override the default {@link org.apache.tapestry5.services.BeanBlockSource} for a particular data type. The | |
| 22 | * service accepts the same configuration of {@link org.apache.tapestry5.services.BeanBlockContribution}s as the main | |
| 23 | * service. | |
| 24 | */ | |
| 25 | @UsesConfiguration(BeanBlockContribution.class) | |
| 26 | public interface BeanBlockOverrideSource | |
| 27 | { | |
| 28 | /** | |
| 29 | * Returns a block which can be used to render an editor for the given data type, in the form of a field label and | |
| 30 | * input field. | |
| 31 | * | |
| 32 | * @param datatype logical name for the type of data to be displayed | |
| 33 | * @return the Block | |
| 34 | * @throws null if no override is available | |
| 35 | */ | |
| 36 | Block getEditBlock(String datatype); | |
| 37 | ||
| 38 | /** | |
| 39 | * Returns a block which can be used to render output for the given data type. | |
| 40 | * | |
| 41 | * @param datatype logical name for the type of data to be displayed | |
| 42 | * @return the Block | |
| 43 | * @throws null if no override is available | |
| 44 | */ | |
| 45 | Block getDisplayBlock(String datatype); | |
| 46 | ||
| 47 | /** | |
| 48 | * Checks to see if there is a display block for the indicated data type. | |
| 49 | * | |
| 50 | * @param datatype to check for | |
| 51 | * @return true if an override display block is available | |
| 52 | */ | |
| 53 | boolean hasDisplayBlock(String datatype); | |
| 54 | } |