01: // Copyright 2007 The Apache Software Foundation
02: //
03: // Licensed under the Apache License, Version 2.0 (the "License");
04: // you may not use this file except in compliance with the License.
05: // You may obtain a copy of the License at
06: //
07: // http://www.apache.org/licenses/LICENSE-2.0
08: //
09: // 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.services;
16:
17: import org.apache.tapestry.corelib.components.BeanEditForm;
18: import org.apache.tapestry.corelib.components.Grid;
19: import org.apache.tapestry.ioc.services.PropertyAdapter;
20:
21: /**
22: * Used by {@link BeanModelSource} to identify the type of data associated with a particular
23: * property (represented as a {@link PropertyAdapter}). The data type is a string used to determine
24: * what kind of interface to use for displaying the value of the property, or what kind of interface
25: * to use for editting the value of the property. Common property types are "text", "enum",
26: * "checkbox", but the list is extensible.
27: *
28: * @see Grid
29: * @see BeanEditForm
30: * @see BeanBlockSource
31: */
32: public interface DataTypeAnalyzer {
33: /** Identifies the data type, if known, or returns null if not known. */
34: String identifyDataType(PropertyAdapter adapter);
35: }
|