View Javadoc

1   /*
2    * Copyright 2010 FatWire Corporation. All Rights Reserved.
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  
17  package com.fatwire.gst.foundation.wra.navigation;
18  
19  import java.util.LinkedList;
20  import java.util.List;
21  
22  import com.fatwire.assetapi.data.AssetId;
23  import com.fatwire.gst.foundation.wra.WebReferenceableAsset;
24  
25  /**
26   * This class represents a node in a navigation bar.
27   * 
28   * 
29   * @author Dolf Dijkstra
30   * @since Feb 8, 2011
31   */
32  public class NavNode {
33      private AssetId page;
34      private int level;
35      private String pagesubtype;
36      private String pagename;
37      private AssetId id;
38      private WebReferenceableAsset wra;
39      private String url;
40      private String linktext;
41      private final List<NavNode> children = new LinkedList<NavNode>();
42      private boolean popup;
43  
44      public void addChild(final NavNode child) {
45          if (child != null) {
46              children.add(child);
47          }
48      }
49  
50      /**
51       * @return the page
52       */
53      public AssetId getPage() {
54          return page;
55      }
56  
57      /**
58       * @param page the page to set
59       */
60      public void setPage(final AssetId page) {
61          this.page = page;
62      }
63  
64      /**
65       * @return the level
66       */
67      public int getLevel() {
68          return level;
69      }
70  
71      /**
72       * @param level the level to set
73       */
74      public void setLevel(final int level) {
75          this.level = level;
76      }
77  
78      /**
79       * @return the pagesubtype
80       */
81      public String getPagesubtype() {
82          return pagesubtype;
83      }
84  
85      /**
86       * @param pagesubtype the pagesubtype to set
87       */
88      public void setPagesubtype(final String pagesubtype) {
89          this.pagesubtype = pagesubtype;
90      }
91  
92      /**
93       * @return the pagename
94       */
95      public String getPagename() {
96          return pagename;
97      }
98  
99      /**
100      * @param pagename the pagename to set
101      */
102     public void setPagename(final String pagename) {
103         this.pagename = pagename;
104     }
105 
106     /**
107      * @return the id
108      */
109     public AssetId getId() {
110         return id;
111     }
112 
113     /**
114      * @param id the id to set
115      */
116     public void setId(final AssetId id) {
117         this.id = id;
118     }
119 
120     /**
121      * @return the children
122      */
123     public List<NavNode> getChildren() {
124         return children;
125     }
126 
127     /**
128      * @return the wra
129      */
130     public WebReferenceableAsset getWra() {
131         return wra;
132     }
133 
134     /**
135      * @param wra the wra to set
136      */
137     public void setWra(final WebReferenceableAsset wra) {
138         this.wra = wra;
139     }
140 
141     public void setUrl(final String url) {
142         this.url = url;
143     }
144 
145     public String getUrl() {
146         return url;
147     }
148 
149     public void setLinktext(final String linktext) {
150         this.linktext = linktext;
151     }
152 
153     public String getLinktext() {
154         return linktext;
155     }
156 
157     /**
158      * @return the popup
159      */
160     public boolean getPopup() {
161         return popup;
162     }
163 
164     public void setPopup(boolean popup) {
165         this.popup = popup;
166     }
167 }