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: BuilderRuleContext.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.impl.ContextBase;
24  import org.apache.shale.clay.parser.Node;
25  import org.apache.shale.clay.parser.builder.Builder;
26  
27  /***
28   * <p>
29   * This context is used by the {@link org.apache.shale.clay.parser.builder.BuilderFactory}
30   * to invoke the <code>Globals.FIND_BUILDER_COMMAND_NAME</code> chain passing this context.
31   * When the chain has stopped, the context will contain the
32   * {@link org.apache.shale.clay.parser.builder.Builder}
33   * needed to convert the html {@link org.apache.shale.clay.parser.Node}
34   * into a {@link org.apache.shale.clay.config.beans.ElementBean}.
35   */
36  public class BuilderRuleContext extends ContextBase {
37  
38      /***
39       * <p>Unique serial id.</p>
40       */
41      private static final long serialVersionUID = 4123103940092377137L;
42  
43      /***
44       * <p>
45       * The current html node.
46       * </p>
47       */
48      private Node node = null;
49  
50      /***
51       * <p>
52       * Returns the current html {@link org.apache.shale.clay.parser.Node}.
53       * </p>
54       *
55       * @return current node
56       */
57      public Node getNode() {
58          return node;
59      }
60  
61      /***
62       * <p>
63       * Sets the current html {@link org.apache.shale.clay.parser.Node}.
64       * </p>
65       *
66       * @param node current html node
67       */
68      public void setNode(Node node) {
69          this.node = node;
70      }
71  
72      /***
73       * <p>
74       * The target builder that the
75       * <code>Globals.FIND_BUILDER_COMMAND_NAME</code> chain will set.
76       */
77      private Builder builder = null;
78  
79      /***
80       * <p>
81       * Returns the target {@link org.apache.shale.clay.parser.builder.Builder}.
82       * </p>
83       *
84       * @return assigned builder
85       */
86      public Builder getBuilder() {
87          return builder;
88      }
89  
90      /***
91       * <p>
92       * Sets the target {@link org.apache.shale.clay.parser.builder.Builder}.
93       * </p>
94       *
95       * @param builder assigned to the node
96       */
97      public void setBuilder(Builder builder) {
98          this.builder = builder;
99      }
100 }