View Javadoc

1   /*
2    * $Id: NestedReference.java 376843 2006-02-10 21:02:56Z husted $
3    *
4    * Copyright 1999-2004 The Apache Software Foundation.
5    *
6    * Licensed under the Apache License, Version 2.0 (the "License");
7    * you may not use this file except in compliance with the License.
8    * You may obtain a copy of the License at
9    *
10   *      http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   */
18  package org.apache.struts.taglib.nested;
19  
20  import java.io.Serializable;
21  
22  /***
23   * So that a nested hierarchy can penetrate a dynamic JSP include, this class
24   * will hold the details of a bean name and nested property.
25   *
26   * @version $Rev: 376843 $
27   * @since Struts 1.1
28   */
29  public class NestedReference implements Serializable {
30      /* Usual member variables */
31      private String beanName;
32      private String property;
33  
34      /***
35       * Empty constructor.
36       */
37      public NestedReference() {
38      }
39  
40      /***
41       * Constructor takes the all the relevant details to init the object.
42       *
43       * @param name     String name of the bean that the include is to
44       *                 reference
45       * @param property String nested property value that the include will be
46       *                 continuing on with.
47       */
48      public NestedReference(String name, String property) {
49          this.beanName = name;
50          this.property = property;
51      }
52  
53      /***
54       * Getter for the bean name
55       *
56       * @return String value that will be the bean's reference
57       */
58      public String getBeanName() {
59          return beanName;
60      }
61  
62      /***
63       * Setter for the bean name
64       *
65       * @param newName String value to set the bean reference.
66       */
67      public void setBeanName(String newName) {
68          this.beanName = newName;
69      }
70  
71      /***
72       * Getter for the nested property
73       *
74       * @return String value that is the nested property for the current
75       *         nesting
76       */
77      public String getNestedProperty() {
78          return this.property;
79      }
80  
81      /***
82       * Setter for the nested property
83       *
84       * @param newProperty String value of the new current nesting level
85       */
86      public void setNestedProperty(String newProperty) {
87          this.property = newProperty;
88      }
89  }