View Javadoc

1   /*
2    * Copyright 2004-2006 the Seasar Foundation and the Others.
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, 
13   * either express or implied. See the License for the specific language
14   * governing permissions and limitations under the License.
15   */
16  /*
17   * Created on 2005/08/06
18   */
19  package org.seasar.tuigwaa.model.core.impl;
20  
21  import org.apache.commons.logging.Log;
22  import org.apache.commons.logging.LogFactory;
23  import org.seasar.tuigwaa.model.core.TgwAttribute;
24  import org.seasar.tuigwaa.model.core.TgwEntity;
25  
26  
27  /***
28   * @author nishioka
29   */
30  public abstract class AbstractAttribute extends TgwElementImpl implements
31  		TgwAttribute {
32  
33  	protected Log log = LogFactory.getLog(getClass());
34  
35  	private boolean required;
36  
37  	private String option;
38  
39  	public final void setEntity(TgwEntity entity) {
40  		setParent(entity);
41  	}
42  
43  	public final TgwEntity getEntity() {
44  		return (TgwEntity)getParent();
45  	}
46  
47  	public void setType(String type) {
48  		// Do nothing for Struts....
49  	}
50  
51  	public final boolean isRequired() {
52  		return required;
53  	}
54  
55  	public final void setRequired(boolean required) {
56  		this.required = required;
57  	}
58  
59  	public final String getOption() {
60  		return option;
61  	}
62  
63  	public final void setOption(String option) {
64  		this.option = option;
65  	}
66  
67  	public abstract String getType();
68  }