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  package org.apache.jetspeed.profiler.impl;
18  
19  import org.apache.jetspeed.profiler.ProfileLocatorProperty;
20  import org.apache.jetspeed.profiler.rules.ProfilingRule;
21  import org.apache.jetspeed.profiler.rules.RuleCriterion;
22  
23  /***
24   * ProfileLocatorElement
25   *
26   * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
27   * @version $Id: ProfileLocatorPropertyImpl.java 516448 2007-03-09 16:25:47Z ate $
28   */
29  public class ProfileLocatorPropertyImpl implements ProfileLocatorProperty
30  {
31      private String name;
32      private String value;
33      private String type;
34      private int fallbackType;
35      private boolean isControl = true;
36      private boolean isNavigation = false;
37          
38      public ProfileLocatorPropertyImpl(RuleCriterion criterion, boolean isControl, boolean isNavigation, String value)
39      {
40          this.name = criterion.getName();
41          this.value = value;
42          this.type = criterion.getType();
43          this.fallbackType = criterion.getFallbackType();
44          this.isControl = isControl;
45          this.isNavigation = isNavigation;
46      }
47      
48      public ProfileLocatorPropertyImpl(String name, boolean isControl, boolean isNavigation, String value)
49      {
50          this.name = name;
51          this.value = value;
52          this.type = ProfilingRule.STANDARD;
53          this.fallbackType = RuleCriterion.FALLBACK_CONTINUE;
54          this.isControl = isControl;
55          this.isNavigation = isNavigation;
56      }
57  
58      /***
59       * @return
60       */
61      public String getValue()
62      {
63          return value;
64      }
65  
66      /***
67       * @param string
68       */
69      public void setValue(String value)
70      {
71          this.value = value;
72      }
73  
74  
75      /***
76       * @return
77       */
78      public int getFallbackType()
79      {
80          return fallbackType;
81      }
82  
83      /***
84       * @return
85       */
86      public String getName()
87      {
88          return name;
89      }
90  
91      /***
92       * @return
93       */
94      public String getType()
95      {
96          return type;
97      }
98  
99      /***
100      * @param i
101      */
102     public void setFallbackType(int i)
103     {
104         fallbackType = i;
105     }
106 
107     /***
108      * @param string
109      */
110     public void setName(String string)
111     {
112         name = string;
113     }
114 
115     /***
116      * @param string
117      */
118     public void setType(String string)
119     {
120         type = string;
121     }
122 
123     /***
124      * @return control classification flag
125      */
126     public boolean isControl()
127     {
128         return isControl;
129     }
130 
131     /***
132      * @return navigation classification flag
133      */
134     public boolean isNavigation()
135     {
136         return isNavigation;
137     }
138     
139 }