1 /*
2 * Copyright 2006-2016 The JGUIraffe Team.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License")
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16 package net.sf.jguiraffe.gui.builder.components;
17
18 import net.sf.jguiraffe.gui.forms.ComponentHandler;
19 import net.sf.jguiraffe.gui.forms.FieldHandler;
20 import net.sf.jguiraffe.gui.builder.components.tags.InputComponentTag;
21
22 /**
23 * <p>
24 * Definition of an interface for objects that are able to create
25 * <code>{@link net.sf.jguiraffe.gui.forms.FieldHandler FieldHandler}</code>
26 * objects.
27 * </p>
28 * <p>
29 * An implementation of this interface is used by input components creating tags
30 * during a builder operation. It creates the handler objects that are stored in
31 * the constructed <code>{@link net.sf.jguiraffe.gui.forms.Form Form}</code>
32 * object.
33 * </p>
34 *
35 * @author Oliver Heger
36 * @version $Id: FieldHandlerFactory.java 205 2012-01-29 18:29:57Z oheger $
37 */
38 public interface FieldHandlerFactory
39 {
40 /**
41 * Creates a new field handler object. The component handler to be
42 * associated with the new field handler is directly passed. All other
43 * necessary information can be obtained from the specified tag handler tag.
44 *
45 * @param tag the input component tag
46 * @param componentHandler the component handler
47 * @return the new field handler
48 * @throws FormBuilderException if an error occurs
49 */
50 FieldHandler createFieldHandler(InputComponentTag tag,
51 ComponentHandler<?> componentHandler) throws FormBuilderException;
52 }