View Javadoc

1   /*
2    * Copyright 2000-2004 The Apache Software Foundation.
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  package org.apache.portals.bridges.frameworks.spring;
17  
18  import org.apache.portals.bridges.frameworks.model.ModelBean;
19  
20  
21  /***
22   * BeanModelImpl
23   * 
24   * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
25   * @version $Id: ModelBeanImpl.java 187935 2004-11-12 07:28:56 +0100 (Fri, 12 Nov 2004) taylor $
26   */
27  public class ModelBeanImpl implements ModelBean
28  {
29  
30      private String beanName;
31      private int beanType;
32      private boolean requiresExternalSupport = false;
33      private String lookupKey;
34  
35      public ModelBeanImpl(String beanName, int beanType)
36      {
37          this.beanName = beanName;
38          this.beanType = beanType;
39      }
40      
41      public ModelBeanImpl(String beanName, int beanType, String lookupKey, boolean requiresExternalSupport)
42      {
43          this.beanName = beanName;
44          this.beanType = beanType;
45          this.lookupKey = lookupKey;
46          this.requiresExternalSupport = requiresExternalSupport;
47      }
48      
49      /* (non-Javadoc)
50       * @see org.apache.portals.bridges.velocity.model.ModelBean#getBeanName()
51       */
52      public String getBeanName()
53      {
54          return beanName;
55      }
56  
57      /* (non-Javadoc)
58       * @see org.apache.portals.bridges.velocity.model.ModelBean#getBeanType()
59       */
60      public int getBeanType()
61      {
62          return beanType;
63      }
64  
65      /***
66       * @return Returns the lookupKey.
67       */
68      public String getLookupKey()
69      {
70          return lookupKey;
71      }
72      /***
73       * @param lookupKey The lookupKey to set.
74       */
75      public void setLookupKey(String lookupKey)
76      {
77          this.lookupKey = lookupKey;
78      }
79      /***
80       * @return Returns the requiresExternalSupport.
81       */
82      public boolean isRequiresExternalSupport()
83      {
84          return requiresExternalSupport;
85      }
86      /***
87       * @param requiresExternalSupport The requiresExternalSupport to set.
88       */
89      public void setRequiresExternalSupport(boolean requiresExternalSupport)
90      {
91          this.requiresExternalSupport = requiresExternalSupport;
92      }
93      
94      public boolean isRequiresLookup()
95      {
96          return (lookupKey!= null);
97      }
98      
99  }