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