com.virtualweaver.xotics.datamodel
Interface XoObject

All Superinterfaces:
java.lang.Cloneable, XoNode
All Known Subinterfaces:
XoContainer, XoRoot, XoText, XoTextContainer
All Known Implementing Classes:
XoContainerSupport, XoObjectSupport, XoTextContainerSupport, XoTextSupport

public interface XoObject
extends java.lang.Cloneable, XoNode

Here is the base interface XO Objects have to implement. Classes implementing XoObject are Java representations of an XML element.

Version:
4.1

Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
          Adds a listener of PropertyChangeEvent fired by this.
 void addVetoableChangeListener(java.beans.VetoableChangeListener l)
          Adds a VetoableChangeListener to the listener list.
 void checkXoValidity()
          Checks whether object is valid in regard of original XML Schema.
 java.lang.Object clone()
          Returns a copy of this object only (not a deep copy).
 boolean equalsXoObject(XoObject xo)
          Checks whether or not this could be equal to xo.
 java.util.Locale getLocale()
          Returns the currently selected locale, previously and directly set according to XML attribute xml:lang.
 java.lang.String getXmlLocalName()
          Returns the XML local name of the element represented by this.
 java.lang.String getXmlNameSpace()
          Returns the XML NameSpace of the element represented by this.
 byte getXmlWhiteSpace()
          Returns the currently selected space management directive, previously and directly set according to XML attribute xml:space.
 XoDMInstance getXoDMInstance()
          Returns the XO Data-Model instance owning this XO Object.
 XoContainer getXoParent()
          Returns the XO Container parent of this.
 boolean isXoPropertyToWrite(java.lang.String pname)
          Informs XML writing system of what to do with this property : write or not ?
 void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
          Removes a listener of PropertyChangeEvent previously registered by corresponding add method.
 void removeVetoableChangeListener(java.beans.VetoableChangeListener l)
          Removes a VetoableChangeListener from the listener list.
 void setIntegrated(boolean integrated)
          Informs this that it has just been completely integrated in a DM Instance as child of an XoContainer or completely removed from a DM Instance.
 void setLocale(java.util.Locale locale)
          This property is directly set according to XML attribute xml:lang.
 void setXmlLocalName(java.lang.String localName)
          Sets the XML local name used with this.
 void setXmlNameSpace(java.lang.String xmlNameSpace)
          Sets the XML local name used with this.
 void setXmlWhiteSpace(byte wsd)
          This property is directly set according to XML attribute xml:space.
 void setXoDMInstance(XoDMInstance mi)
          Sets the XO Data-Model instance owning this XO Object.
 void setXoParent(XoContainer parent)
          Sets the XO Container parent of tthis.
 

Method Detail

getXmlLocalName

public java.lang.String getXmlLocalName()
Returns the XML local name of the element represented by this.

Returns:
the XML local name

setXmlLocalName

public void setXmlLocalName(java.lang.String localName)
Sets the XML local name used with this. This method is useful only when this can serve as implementation of several elements.

Parameters:
localName - the XML local name

getXmlNameSpace

public java.lang.String getXmlNameSpace()
Returns the XML NameSpace of the element represented by this.

Returns:
the XML NameSpace

setXmlNameSpace

public void setXmlNameSpace(java.lang.String xmlNameSpace)
Sets the XML local name used with this. This method is useful only when this can serve as implementation of several elements, in multiple name spaces.

Parameters:
xmlNameSpace - the XML name space.

setXoDMInstance

public void setXoDMInstance(XoDMInstance mi)
Sets the XO Data-Model instance owning this XO Object. Every XO Object of a Java representation of XML document must belong to the holding instance of XO Data-Model.

Parameters:
mi - the Data-Model instance owner, or null if this object is not in an XO Data-Model instance.

getXoDMInstance

public XoDMInstance getXoDMInstance()
Returns the XO Data-Model instance owning this XO Object. Every XO Object of a Java representation of XML document must belong to the holding instance of XO Data-Model.

Returns:
the Data-Model instance owner, or null if this object is not in an XO Data-Model instance.

setXoParent

public void setXoParent(XoContainer parent)
Sets the XO Container parent of tthis. Only the root object has no parent.

Parameters:
parent - XO Container parent of this, or null if this object is not in a DM instance.

getXoParent

public XoContainer getXoParent()
Returns the XO Container parent of this. Only the root object has no parent.

Returns:
XO Container parent instance of this, or null if this object is not in a DM instance

clone

public java.lang.Object clone()
Returns a copy of this object only (not a deep copy). Properties only are copied, except it's ID value, XoParent and owner DM instance properties.

Returns:
a new instance of this XO Object

equalsXoObject

public boolean equalsXoObject(XoObject xo)
Checks whether or not this could be equal to xo. This method can be used to check equality from an XML point of vue. Content children are not considered in this checking.

Parameters:
xo - an XO object to compare to this
Returns:
a boolean indicating whether this can be equivalent to param xo.

checkXoValidity

public void checkXoValidity()
                     throws XoValidityException
Checks whether object is valid in regard of original XML Schema. Properties as themselves or against content children are checked.

Throws:
XoException - when this element is not valid, with the reason why
XoValidityException

isXoPropertyToWrite

public boolean isXoPropertyToWrite(java.lang.String pname)
Informs XML writing system of what to do with this property : write or not ?

Parameters:
pname - the name of a property of this
Returns:
a boolean indicating whether property named pname is to write or not.

getLocale

public java.util.Locale getLocale()
Returns the currently selected locale, previously and directly set according to XML attribute xml:lang. If no value specified, can return null.

Returns:
a Locale object holding xml:lang value.

setLocale

public void setLocale(java.util.Locale locale)
               throws java.beans.PropertyVetoException
This property is directly set according to XML attribute xml:lang.

Parameters:
locale - a Locale object holding xml:lang value.
Throws:
java.beans.PropertyVetoException - if this is in a DM instance in read-only mode

getXmlWhiteSpace

public byte getXmlWhiteSpace()
Returns the currently selected space management directive, previously and directly set according to XML attribute xml:space. By default, must return XoConstants.WS_COLLAPSE which corresponds to xml:space=DEFAULT.

Returns:
either XoConstants.WS_PRESERVE or XoConstants.WS_COLLAPSE (default).

setXmlWhiteSpace

public void setXmlWhiteSpace(byte wsd)
                      throws java.beans.PropertyVetoException
This property is directly set according to XML attribute xml:space.

Parameters:
wsd - either XoConstants.WS_PRESERVE or XoConstants.WS_COLLAPSE (xml:space=DEFAULT).
Throws:
java.beans.PropertyVetoException - if this is in a DM instance in read-only mode

setIntegrated

public void setIntegrated(boolean integrated)
Informs this that it has just been completely integrated in a DM Instance as child of an XoContainer or completely removed from a DM Instance. This method is not called for XoRoot objects

Parameters:
integrated - true if integrated, false if completely removed

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a listener of PropertyChangeEvent fired by this. PropertyChange events are fired (if necessary) when properties are changed.

Parameters:
listener - a PropertyChangeEvent listener

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a listener of PropertyChangeEvent previously registered by corresponding add method.

Parameters:
listener - a PropertyChangeEvent listener registered

addVetoableChangeListener

public void addVetoableChangeListener(java.beans.VetoableChangeListener l)
Adds a VetoableChangeListener to the listener list.

Parameters:
l - The listener to add.

removeVetoableChangeListener

public void removeVetoableChangeListener(java.beans.VetoableChangeListener l)
Removes a VetoableChangeListener from the listener list.

Parameters:
l - The listener to remove.