net.infonode.properties.util
Class AbstractProperty

java.lang.Object
  extended by net.infonode.properties.util.AbstractProperty
All Implemented Interfaces:
Property
Direct Known Subclasses:
ValueHandlerProperty

public abstract class AbstractProperty
extends java.lang.Object
implements Property

An abstract base class for properties.

Version:
$Revision: 1.4 $
Author:
$Author: jesper $

Field Summary
private  java.lang.String description
           
private  PropertyGroup group
           
private  java.lang.String name
           
private  java.lang.Class type
           
 
Constructor Summary
protected AbstractProperty(PropertyGroup group, java.lang.String name, java.lang.Class type, java.lang.String description)
          Constructor.
 
Method Summary
 boolean canBeAssiged(java.lang.Object value)
          Returns true if the value can be assigned to this property.
 java.lang.String getDescription()
          Returns a description of this property.
 PropertyGroup getGroup()
          Returns the property group that this property belongs to.
 java.lang.String getName()
          Returns the property name.
 java.lang.Class getType()
          Returns the value type of this property.
 boolean isMutable()
          Returns true if this property is mutable.
 void setValue(java.lang.Object object, java.lang.Object value)
          Sets the value of this property in an object.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.infonode.properties.base.Property
getValue, removeValue, valueIsRemovable, valueIsSet
 

Field Detail

group

private PropertyGroup group

name

private java.lang.String name

type

private java.lang.Class type

description

private java.lang.String description
Constructor Detail

AbstractProperty

protected AbstractProperty(PropertyGroup group,
                           java.lang.String name,
                           java.lang.Class type,
                           java.lang.String description)
Constructor.

Parameters:
group - the property group
name - the property name
type - the property type
description - the property description
Method Detail

getGroup

public PropertyGroup getGroup()
Description copied from interface: Property
Returns the property group that this property belongs to.

Specified by:
getGroup in interface Property
Returns:
the property group that this property belongs to

getName

public java.lang.String getName()
Description copied from interface: Property
Returns the property name.

Specified by:
getName in interface Property
Returns:
the property name

getType

public java.lang.Class getType()
Description copied from interface: Property
Returns the value type of this property. The property can only be set to values that are of this class or a sub class of this class.

Specified by:
getType in interface Property
Returns:
the value type of this property

getDescription

public java.lang.String getDescription()
Description copied from interface: Property
Returns a description of this property.

Specified by:
getDescription in interface Property
Returns:
a description of this property

isMutable

public boolean isMutable()
Description copied from interface: Property
Returns true if this property is mutable.

Specified by:
isMutable in interface Property
Returns:
true if this property is mutable

setValue

public void setValue(java.lang.Object object,
                     java.lang.Object value)
Description copied from interface: Property
Sets the value of this property in an object.

Specified by:
setValue in interface Property
Parameters:
object - the object to set the property value in
value - the value of the property

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

canBeAssiged

public boolean canBeAssiged(java.lang.Object value)
Description copied from interface: Property
Returns true if the value can be assigned to this property.

Specified by:
canBeAssiged in interface Property
Parameters:
value - the value to assign
Returns:
true if the value can be assigned to this property