View Javadoc

1   /*
2    * Copyright 2005-2008 The Kuali Foundation
3    * 
4    * Licensed under the Educational Community 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.opensource.org/licenses/ecl2.php
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.kuali.rice.kns.datadictionary;
17  
18  import org.apache.commons.lang.StringUtils;
19  
20  /**
21   * Abstract superclass for all maintainable fields and collections.  Never used directly.
22   */
23  public abstract class MaintainableItemDefinition extends DataDictionaryDefinitionBase {
24      private static final long serialVersionUID = 4564613758722159747L;
25      
26  	private String name;
27  
28      public MaintainableItemDefinition() {
29      }
30  
31  
32      /**
33       * @return name
34       */
35      public String getName() {
36          return name;
37      }
38  
39      /**
40       * Sets name to the given value.
41       * 
42       * @param name
43       * @throws IllegalArgumentException if the given name is blank
44       */
45      public void setName(String name) {
46          if (StringUtils.isBlank(name)) {
47              throw new IllegalArgumentException("invalid (blank) name");
48          }
49          this.name = name;
50      }
51  
52  
53      /**
54       * @see java.lang.Object#toString()
55       */
56      public String toString() {
57          return "MaintainableItemDefinition for item " + getName();
58      }
59  }