Evolvica Core API Version 0.6.2
Last Modified: June 29 2004

org.evolvica.engine
Class AttributeDescriptor

java.lang.Object
  extended byorg.evolvica.engine.AbstractDescriptor
      extended byorg.evolvica.engine.AttributeDescriptor
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Comparable, java.io.Serializable

public class AttributeDescriptor
extends AbstractDescriptor

Descriptor of an attribute/property of an operator.

Since:
0.5.0
Version:
$Revision: 1.7 $ $Date: 2004/05/26 11:58:22 $
Author:
Andreas Rummler
See Also:
Serialized Form

Constructor Summary
AttributeDescriptor(java.beans.PropertyDescriptor descriptor)
          Copy Constructor.
AttributeDescriptor(java.lang.String name)
          Constructor.
AttributeDescriptor(java.lang.String name, java.lang.String displayName, java.lang.Object bean)
          Constructor.
 
Method Summary
 java.lang.Object clone()
          Clones this attribute descriptor.
 int compareTo(java.lang.Object o)
           
 java.lang.Class getIndexedPropertyType()
          Returns the indexed property type (if there is any)
 java.lang.reflect.Method getIndexedReadMethod()
          Returns the read method for indexed properties.
 java.lang.reflect.Method getIndexedWriteMethod()
          Returns the write method for indexed properties.
 java.lang.Class getPropertyType()
          Returns the property type.
 java.lang.reflect.Method getReadMethod()
          Returns the read method for the property.
 java.lang.reflect.Method getWriteMethod()
          Returns the write method for this property.
 boolean isBound()
          Returns whether this property is bound.
 boolean isConstrained()
          Returns whether this property is constrained.
 boolean isResolved()
          Returns whether this property has already been resolved.
 void load(org.w3c.dom.Element element)
          Deprecated. use DescriptorBuilder to create XML elements from attribute descriptors
 void resolve(java.lang.Class parent)
          Deprecated. use DescriptorResolver instead of this method
 org.w3c.dom.Element save(org.w3c.dom.Document doc)
          Deprecated. use DescriptorWriter for saving
 void setBound(boolean b)
          Sets the bound flag.
 void setConstrained(boolean b)
          Sets the constrained flag.
 void setIndexedPropertyType(java.lang.Class class1)
          Sets the indexed property type.
 void setIndexedReadMethod(java.lang.reflect.Method method)
          Sets the read method for indexed properties.
 void setIndexedWriteMethod(java.lang.reflect.Method method)
          Sets the write method for index porperties.
 void setPropertyType(java.lang.Class class1)
          Sets the property type.
 void setReadMethod(java.lang.reflect.Method method)
          Sets the read method for the property.
 void setWriteMethod(java.lang.reflect.Method method)
          Sets the write method for the property.
 java.lang.String toString()
          Returns a string representation.
 
Methods inherited from class org.evolvica.engine.AbstractDescriptor
getDisplayName, getName, getShortDescription, isExpert, isHidden, isPreferred, setDisplayName, setExpert, setHidden, setName, setPreferred, setShortDescription
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AttributeDescriptor

public AttributeDescriptor(java.lang.String name)
Constructor.

Parameters:
name - name of the attribute

AttributeDescriptor

public AttributeDescriptor(java.lang.String name,
                           java.lang.String displayName,
                           java.lang.Object bean)
                    throws java.lang.IllegalAccessException,
                           java.lang.reflect.InvocationTargetException,
                           java.lang.NoSuchMethodException
Constructor. Creates a new descriptor describing the given attribute/property.

Parameters:
name - name of the attribute
displayName - display name of the attribute
bean - bean from which to retrieve the property
Throws:
java.lang.IllegalAccessException - thrown in case the property cannot be retrieve
java.lang.reflect.InvocationTargetException - thrown in case the property cannot be retrieve
java.lang.NoSuchMethodException - thrown in case the property cannot be retrieve

AttributeDescriptor

public AttributeDescriptor(java.beans.PropertyDescriptor descriptor)
Copy Constructor. Creates a new descriptor from an existing property descriptor.

Parameters:
descriptor - property descriptor
Method Detail

clone

public java.lang.Object clone()
Clones this attribute descriptor.

Returns:
cloned descriptor

getIndexedPropertyType

public java.lang.Class getIndexedPropertyType()
Returns the indexed property type (if there is any)

Returns:
indexed property type or null

getIndexedReadMethod

public java.lang.reflect.Method getIndexedReadMethod()
Returns the read method for indexed properties.

Returns:
read method or null

getIndexedWriteMethod

public java.lang.reflect.Method getIndexedWriteMethod()
Returns the write method for indexed properties.

Returns:
write method or null

getPropertyType

public java.lang.Class getPropertyType()
Returns the property type.

Returns:
property type

getReadMethod

public java.lang.reflect.Method getReadMethod()
Returns the read method for the property.

Returns:
read method

getWriteMethod

public java.lang.reflect.Method getWriteMethod()
Returns the write method for this property.

Returns:
write method or null

isBound

public boolean isBound()
Returns whether this property is bound.

Returns:
bound flag

isConstrained

public boolean isConstrained()
Returns whether this property is constrained.

Returns:
contrained flag

isResolved

public boolean isResolved()
Returns whether this property has already been resolved.

Returns:
true if the property has been resolved, false instead

resolve

public void resolve(java.lang.Class parent)
Deprecated. use DescriptorResolver instead of this method

Attempts to resolve this property.

Parameters:
parent - parent class

load

public void load(org.w3c.dom.Element element)
          throws java.lang.IllegalArgumentException
Deprecated. use DescriptorBuilder to create XML elements from attribute descriptors

Loads the descriptor from an XML element.

Parameters:
element - XML element
Throws:
java.lang.IllegalArgumentException - thrown in case the descriptor cannot be loaded

setBound

public void setBound(boolean b)
Sets the bound flag.

Parameters:
b - bound flag

setConstrained

public void setConstrained(boolean b)
Sets the constrained flag.

Parameters:
b - constrained flag

setIndexedPropertyType

public void setIndexedPropertyType(java.lang.Class class1)
Sets the indexed property type.

Parameters:
class1 - indexed property type

setIndexedReadMethod

public void setIndexedReadMethod(java.lang.reflect.Method method)
Sets the read method for indexed properties.

Parameters:
method - read method

setIndexedWriteMethod

public void setIndexedWriteMethod(java.lang.reflect.Method method)
Sets the write method for index porperties.

Parameters:
method - write method

setPropertyType

public void setPropertyType(java.lang.Class class1)
Sets the property type.

Parameters:
class1 - property type

setReadMethod

public void setReadMethod(java.lang.reflect.Method method)
Sets the read method for the property.

Parameters:
method - read method

setWriteMethod

public void setWriteMethod(java.lang.reflect.Method method)
Sets the write method for the property.

Parameters:
method - write method

save

public org.w3c.dom.Element save(org.w3c.dom.Document doc)
Deprecated. use DescriptorWriter for saving

Saves the descriptor into an XML element.

Parameters:
doc - XML document to use for element creation
Returns:
created XML element

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable
Specified by:
compareTo in class AbstractDescriptor
See Also:
Comparable.compareTo(java.lang.Object)

toString

public java.lang.String toString()
Returns a string representation.

Returns:
string representation

Evolvica Core API Version 0.6.2
Last Modified: June 29 2004

Copyright © 2000-2004 Technical University of Ilmenau, Department Electronic Circuits and Systems