2009/05/20 - Apache Shale has been retired.

For more information, please explore the Attic.

View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to you under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  
18  /*
19   * $Id: InputTextBuilder.java 464373 2006-10-16 04:21:54Z rahul $
20   */
21  package org.apache.shale.clay.parser.builder;
22  
23  import org.apache.shale.clay.config.beans.ComponentBean;
24  import org.apache.shale.clay.config.beans.ElementBean;
25  import org.apache.shale.clay.parser.Node;
26  
27  /***
28   * <p>
29   * Builds a {@link ElementBean} from a HTML {@link Node} where the
30   * {@link org.apache.shale.clay.parser.builder.chain.TextareaBuilderRule}
31   * handles the mapping.
32   * </p>
33   */
34  public class InputTextBuilder extends Builder {
35  
36      /***
37       * <p>
38       * The default for this builder is that builder will handle the children
39       * html nodes meaning that the default should be <code>true</code>. The
40       * default can be overridden by the "allowBody" attribute in the component
41       * metadata.
42       * </p>
43       *
44       * @param node markup
45       * @param target child config bean
46       * @param root parent config bean
47       */
48      protected void encodeEnd(Node node, ElementBean target,
49              ComponentBean root) {
50      }
51  
52      /***
53       * <p>
54       * Returns the <code>jsfid</code> used to populate the {@link ElementBean}.
55       * </p>
56       *
57       * @param node markup
58       * @return jsfid
59       */
60      protected String getJsfid(Node node) {
61          return "inputText";
62      }
63  
64      /***
65       * <p>
66       * Returns the JSF componentType of
67       * <code>javax.faces.HtmlInputTextarea</code> used to define the
68       * {@link ElementBean} from the HTML {@link Node}.
69       * </p>
70       *
71       * @param node markup
72       * @return component type
73       */
74      protected String getComponentType(Node node) {
75          return "javax.faces.HtmlInputText";
76      }
77  
78  }