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: JsfDefaultBuilderRule.java 464373 2006-10-16 04:21:54Z rahul $
20   */
21  package org.apache.shale.clay.parser.builder.chain;
22  
23  import org.apache.commons.chain.Command;
24  import org.apache.commons.chain.Context;
25  import org.apache.shale.clay.parser.builder.JsfDefaultBuilder;
26  
27  
28  /***
29   * <p>Delegates all handling to a common
30   * {@link org.apache.shale.clay.parser.builder.JsfDefaultBuilder} that can
31   * transform markup that looks like JSP tags to a graph of
32   * {@link org.apache.shale.clay.config.beans.InnerComponentBean} beans.</p>
33   *
34   */
35  public class JsfDefaultBuilderRule implements Command {
36  
37      /***
38       * <p>Generic {@link Builder} that handles JSP style of markup's.</p>
39       */
40      private final JsfDefaultBuilder builder = new JsfDefaultBuilder();
41  
42      /***
43       * <p>Assigns handling of the markup to {@link org.apache.shale.clay.parser.builder.JsfDefaultBuilder}
44       * without condition.</p>
45       *
46       * @param context common chains
47       * @return <code>true</code> if the chain is done
48       */
49      public boolean execute(Context context) {
50  
51          BuilderRuleContext builderRuleContext = (BuilderRuleContext) context;
52          builderRuleContext.setBuilder(builder);
53  
54          return true;
55      }
56  
57      /***
58       * <p>Returns the namespace prefix that will be added to the
59       * node name when resolving the clay config.</p>
60       *
61       * @return URI prefix
62       */
63      public String getPrefix() {
64          return builder.getPrefix();
65      }
66  
67      /***
68       * <p>Sets the namespace preix that will override the template
69       * nodeds qname.</p>
70       *
71       * @param prefix URI prefix
72       */
73      public void setPrefix(String prefix) {
74          builder.setPrefix(prefix);
75      }
76  
77  }
78