com.virtualweaver.xotics.datamodel
Interface XoProperty

All Superinterfaces:
java.lang.Cloneable, XoNode

public interface XoProperty
extends java.lang.Cloneable, XoNode

Wrapper for a JavaBean property. It permits both :

There is one instance of XoProperty per property for an instance of XoObject. Only published properties (i.e JavaBean properties visible by Xotics environment) have their XoProperty wrapper, which are created by XoRegistry.getProperties(XoObject) and related methods.

Version:
4.1

Method Summary
 java.beans.PropertyEditor createPropertyEditor()
          Creates a new instance of the PropertyEditor object associated to this property.
 boolean equals(java.lang.Object po)
          Tells whether this XoProperty equals param po.
 java.lang.String getJavaName()
          Returns JavaBean property name
 XoObject getOwnerObject()
          Gets the XoObject instance whose property is represented by this
 int getPosition()
          Returns the property position in the list of properties of XO object owner.
 java.lang.String getShortDescription()
          Returns the short description value coming from java.beans.PropertyDescriptor.
 java.lang.Object getValue()
          Gets the value of this property in a thread-safe way.
 java.lang.String getValueAsText()
          Gets the value of this property as a string.
 java.lang.Class getValueClass()
          Returns the java type of property represented by this
 java.lang.String getXmlName()
          Returns XML attribute name corresponding to this property
 boolean isConstrained()
          Tells whether setter method of this property takes care of JavaBean property veto feature.
 boolean isIndexed()
          Returns true if this property is an indexed JavaBean property (i.e is Java type is an array).
 void setValue(java.lang.Object value)
          Sets the value of this property in a thread-safe way.
 void setValueAsText(java.lang.String text)
          Sets the value of this property from a string in a thread-safe way.
 java.lang.String toString()
          Be careful : this method is not equivalent to getValueAsText().
 

Method Detail

getOwnerObject

public XoObject getOwnerObject()
Gets the XoObject instance whose property is represented by this

Returns:
the XoObject owner of property represented by this

getJavaName

public java.lang.String getJavaName()
Returns JavaBean property name

Returns:
property name

getXmlName

public java.lang.String getXmlName()
Returns XML attribute name corresponding to this property

Returns:
the XML equivalent to this property

getValueClass

public java.lang.Class getValueClass()
Returns the java type of property represented by this

Returns:
the class object of property java type

createPropertyEditor

public java.beans.PropertyEditor createPropertyEditor()
Creates a new instance of the PropertyEditor object associated to this property. Normally, such instances are created internally, as needed, but it can be useful to give access to the PropertyEditor. Every property has a PropertyEditor, even if none has been defined. For self-converted properties, a default Property Editor is associated, so this method should never return null.

Returns:
a newly created instance of the PropertyEditor class used to edit this property.

getPosition

public int getPosition()
Returns the property position in the list of properties of XO object owner. This method should be used by XPath system only

Returns:
the property position

equals

public boolean equals(java.lang.Object po)
Tells whether this XoProperty equals param po. Equality occurs when both XoProperty objects share the same java name and owner XoObject (as instance in memory)

Parameters:
po - the object to compare to
Returns:
true if both objects are equals

isIndexed

public boolean isIndexed()
Returns true if this property is an indexed JavaBean property (i.e is Java type is an array). This value comes from the java.beans.PropertyDescriptor of this property.

Returns:
true if this represents an indexed JavaBean property.

isConstrained

public boolean isConstrained()
Tells whether setter method of this property takes care of JavaBean property veto feature. This value comes from the java.beans.PropertyDescriptor of this property.

Returns:
true if VetoableChange event is fired when the property is changed

getShortDescription

public java.lang.String getShortDescription()
Returns the short description value coming from java.beans.PropertyDescriptor. This value comes from the java.beans.PropertyDescriptor of this property.

Returns:
a short description of this property.

getValue

public java.lang.Object getValue()
                          throws XoException
Gets the value of this property in a thread-safe way. If owner object belongs to a DM instance, this method guaranties that value will be obtained in a thread-safe way.

Returns:
the value object of this property
Throws:
XoLockedException - if DM instance is locked
XoException - if some error occurred during retrieving

setValue

public void setValue(java.lang.Object value)
              throws XoException,
                     java.beans.PropertyVetoException
Sets the value of this property in a thread-safe way. If owner object belongs to a DM instance, this method guaranties that value will be set in a thread-safe way.

Parameters:
value - the value object to set
Throws:
XoLockedException - if DM instance is locked
XoException - if some error occurred during setting
java.beans.PropertyVetoException - if DM instance is read-only

setValueAsText

public void setValueAsText(java.lang.String text)
                    throws XoException,
                           java.beans.PropertyVetoException
Sets the value of this property from a string in a thread-safe way. If owner object belongs to a DM instance, this method guaranties that value will be set in a thread-safe way.

Parameters:
text - the string to set after appropriate conversion
Throws:
XoLockedException - if DM instance is locked
XoException - if some error occurred during conversion then setting
java.beans.PropertyVetoException - if DM instance is read-only

getValueAsText

public java.lang.String getValueAsText()
                                throws XoException
Gets the value of this property as a string. If owner object belongs to a DM instance, this method guaranties that value will be obtained in a thread-safe way.

Returns:
the string value of this property
Throws:
XoLockedException - if DM instance is locked
XoException - if some error occurred during retrieving and string conversion

toString

public java.lang.String toString()
Be careful : this method is not equivalent to getValueAsText(). It just gives a description of informations wrapped by this.

Returns:
a string description of this property