View Javadoc

1   /*
2    * Copyright 2012 Vincent Demeester<vincent+shortbrain@demeester.fr>.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5    * use this file except in compliance with the License. You may obtain a copy of
6    * 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, WITHOUT
12   * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13   * License for the specific language governing permissions and limitations under
14   * the License.
15   */
16  package org.shortbrain.vaadin.container.property;
17  
18  /**
19   * Metedata used to create a property of a Vaadin Container.
20   * 
21   * @author Vincent Demeester <vincent@demeeester.fr>
22   * 
23   */
24  public class PropertyMetadata {
25  
26  	/**
27  	 * Name of the property.
28  	 */
29  	private final String propertyName;
30  	/**
31  	 * Type of the property.
32  	 */
33  	private final Class<?> propertyClass;
34  	/**
35  	 * Default value of the property.
36  	 */
37  	private final Object defaultValue;
38  	/**
39  	 * Attribute of the property – might be used to get the value of the
40  	 * property.
41  	 */
42  	private final String propertyAttribute;
43  
44  	/**
45  	 * Creates a {@link PropertyMetadata}
46  	 * 
47  	 * @param propertyName
48  	 * @param propertyClass
49  	 * @param defaultValue
50  	 * @param propertyAttribute
51  	 */
52  	public PropertyMetadata(String propertyName, Class<?> propertyClass,
53  			Object defaultValue, String propertyAttribute) {
54  		super();
55  		this.propertyName = propertyName;
56  		this.propertyClass = propertyClass;
57  		this.defaultValue = defaultValue;
58  		this.propertyAttribute = propertyAttribute;
59  	}
60  
61  	public String getPropertyName() {
62  		return propertyName;
63  	}
64  
65  	public Class<?> getPropertyClass() {
66  		return propertyClass;
67  	}
68  
69  	public Object getDefaultValue() {
70  		return defaultValue;
71  	}
72  
73  	public String getPropertyAttribute() {
74  		return propertyAttribute;
75  	}
76  
77  }