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