001 /**
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements. See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License. You may obtain a copy of the License at
008 *
009 * http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017 package org.apache.xbean.spring.context.impl;
018
019 /**
020 * DefaultProperty contains the default value assigned to a property with a specific name and type.
021 * @author Dain Sundstrom
022 * @version $Id$
023 * @since 2.0
024 */
025 public class DefaultProperty {
026 private String name;
027 private Class type;
028 private Object value;
029
030 /**
031 * Creates a new empty default property. This instance is unusable until the name, type and values are assigned.
032 */
033 public DefaultProperty() {
034 }
035
036 /**
037 * Creates new default property value for a property with the specified name and type.
038 * @param name the name of the property
039 * @param type the type of the property
040 * @param value the default value
041 */
042 public DefaultProperty(String name, Class type, Object value) {
043 this.name = name;
044 this.type = type;
045 this.value = value;
046 }
047
048 /**
049 * Gets the property name.
050 * @return the property name
051 */
052 public String getName() {
053 return name;
054 }
055
056 /**
057 * Sets the property name.
058 * @param name the property name
059 */
060 public void setName(String name) {
061 this.name = name;
062 }
063
064 /**
065 * Gets the property type.
066 * @return the property type
067 */
068 public Class getType() {
069 return type;
070 }
071
072 /**
073 * Sets the property type.
074 * @param type the property type
075 */
076 public void setType(Class type) {
077 this.type = type;
078 }
079
080 /**
081 * Gets the default value.
082 * @return the default value
083 */
084 public Object getValue() {
085 return value;
086 }
087
088 /**
089 * Sets the default value.
090 * @param value the default value
091 */
092 public void setValue(Object value) {
093 this.value = value;
094 }
095
096 /**
097 * {@inheritDoc}
098 */
099 public String toString() {
100 return "[" + name + ", " + type + ", " + value + "]";
101 }
102 }