com.virtualweaver.xotics.datamodel
Interface XoDMInstance

All Superinterfaces:
java.lang.Cloneable, XoNode

public interface XoDMInstance
extends XoNode, java.lang.Cloneable

XoDMInstance is the representation of an XML document in Xotics environment.

Version:
4.1

Method Summary
 XoObject addChild(XoObject child, XoContainer parent)
          Appends param child to the list of children of param parent.
 XoObject addChild(XoObject child, XoContainer parent, int index)
          Inserts param child to the list of children of param parent at specified index.
 void addNSMapping(java.lang.String nsref, java.lang.String nsprefix)
          Sets for this DM instance a prefix to associate to namespace nsref.
 void addPropertyChangeListener(java.beans.PropertyChangeListener l)
          Adds a listener of PropertyChangeEvent fired for this properties and for properties of all XoObject contained in this.
 void addResourceRef(java.net.URL resUrl)
          Adds a resource path URL to the local class loader.
 void addXoContainerListener(XoContainerListener l)
          Adds a listener of XoContainerEvent fired by this when an XoObject is added to or removed from this content tree.
 void addXoUndoableListener(XoUndoableListener l)
          Registers an XoUndoableEvent listener interested in receiving all Undo events fired by this.
 void changeNSMapping(java.lang.String nsref, java.lang.String nsprefix)
          Changes the prefix string as param nsprefix associated to a namespace specified by param nsref.
 void checkValidity()
          Apply all defined validity rules to entire content tree to check its validity.
 void checkValidity(XoObject xo, boolean deep)
          Checks validity from XO object xo.
 java.lang.Object clone()
          Clone method of XoDMInstance.
 XoObject cloneXoObject(XoObject xo, boolean deep)
          Clones an XO object belonging to this.
 boolean contains(XoObject xo)
          Checks whether this contains XO object param xo.
 boolean contains(XoObject xo, XoObject container)
          Checks whether XO object param xo is or is descendant of param container.
 boolean deepEquals(XoObject src, XoObject cmp)
          Checks XO equality of two sub-trees using XoObject.equalsXoObject(XoObject) method.
 XoDMInstance exportDMInstance(XoRoot rpos)
          Creates a new DM instance and sets its content with a deep copy of a rootable object of this.
 java.lang.Class getClassResource(java.lang.String clname)
          Loads a class searched in classpaths of internal resource refs.
 java.net.URL getDMLocation(java.lang.String nsref)
          Gets URL location permitting to load DM module specified by param nsref
 java.net.URL[] getDMLocations()
          Gets URL location list permitting to load all Data-Model modules loaded
 java.lang.String getEncoding()
          Returns the current charset encoding used to save this.
 XoEnvironment getEnvironment()
          Returns the current Xotics Environment.
 int getHistorySize()
          Gets the number of changes on this kept in memory to be able to call undo().
 int getIndexOfChild(XoObject child)
          Returns the index of child in brotherhood.
 java.lang.String getInstanceName()
          Gets the name of this instance.
 void getLock()
          Waits until caller thread acquires a lock on this DM instance.
 java.lang.String getNamespaceURI(java.lang.String nsprefix)
          Returns the namespace URI string associated to param nsprefix prefix.
 java.lang.String[] getNamespaceURIs()
          Gets the list of namespace URIs of Data-Models used by this.
 java.lang.String getNSPrefix(java.lang.String nsref)
          Returns the prefix associated to namespace URI nsref.
 java.lang.String[] getReferencedIds()
          Returns the list of XO object ID values currently registered by this.
 XoRegistry getRegistry()
          Returns the Registry of current Xotics Environment.
 java.net.URL getResourceURL(java.lang.String path)
          Searches URL corresponding to a path string seeked in internal resource refs.
 XoRoot getRoot()
          Returns the root XoRoot object.
 java.lang.String getRootNamespaceURI()
          Helper method which gets the namespace URI of the root XO object.
 java.net.URL getSourceLocation()
          Gets the location URL of the document file from which this is generated and/or to save this to.
 XoUpdateHandler getUpdateHandler()
          This method is not yet implemented and reseved for the next version of this API.
 XoObject getXoObjectById(java.lang.String id)
          Returns the registered Xo object having id paameter as ID value.
 boolean hasNSMapping(java.lang.String nsref)
          Tells whether or not param nsref namespace URI is used by this
 void importDMInstance(XoDMInstance edm, XoContainer ppos)
          Imports entire content copy of external DM instance edm as child of container param ppos. note that this is a deep copy made from content tree that is added as child of ppos
 boolean isInsertDMLocation()
          Indicates whether or not this will insert a processing instruction, when saving this to file, indicating the DM modules needed to create this during XML parsing.
 boolean isLocked()
          Tells whether this is locked by any thread.
 boolean isLockOwner()
          Tells whether calling thread is the lock owner of this.
 boolean isReadOnly()
          Tells whether this is in read-only mode.
 boolean isReleased()
          Tells whether this has been released.
 boolean isRequestable()
          If this methods returns false, it means that this instance can not be requested by XPath.
 boolean isWelcome(XoContainer parent, XoObject child, int index)
          This method is the thread-safe version of XoContainer.isXoObjectWelcome(XoObject, int).
 void redo()
          This method is not yet implemented and reseved for the next version of this API.
 void release()
          This method makes free all XO objects belonging to this : after calling XoRoot.xoRelease(), DM instance owner of all XO objects is set to null.
 XoObject remove(XoObject xo)
          Removes XO object param xo and its sub-tree from this.
 void removePropertyChangeListener(java.beans.PropertyChangeListener l)
          Removes a listener of PropertyChangeEvent fired for this properties and for properties of all XoObject contained in this.
 void removeXoContainerListener(XoContainerListener l)
          Removes a listener of XoContainerEvent fired by this when an XoObject is added to or removed from this content tree.
 void removeXoUndoableListener(XoUndoableListener l)
          Unregisters an XoUndoableEvent listener interested in receiving all Undo events fired by this.
 XoDataType request(java.lang.String reqIdOrXPath, XoNode ctx, java.util.Map xpathVars)
          performs an XPath request from context node ctx, using an optional map of XPath variables xpathVars.
 XoNode[] requestXoNodes(java.lang.String reqIdOrXPath, XoNode ctx, java.util.Map vars)
          The same as request(reqIdOrXPath, ctx, vars) except that result is transformed in an array of XoNode objects.
 void save()
          Saves this as XML document using URL provided by getSourceLocation()
 void save(java.io.OutputStream os)
          Saves this as XML document into output stream os.
 void save(java.net.URL url)
          Saves this as XML document on URL specified by url param.
 void save(java.io.Writer wr)
          Saves this as XML document into writer wr.
 void setDMLocation(java.lang.String nsref, java.net.URL url)
          This method can set or change a Data-Model location URL for a specific namespace.
 void setEncoding(java.lang.String charsetEncoding)
          Sets the charset encoding to use when saving this.
 void setInsertDMLocation(boolean enabled)
          Tells to this whether to insert a processing instruction, when saving this to file, specifying the Data-Model modules needed to create this during XML parsing.
 void setInstanceName(java.lang.String iname)
          Sets the name of this instance.
 void setReadOnly(boolean rd)
          Sets the document in read-only mode.
 void setSourceLocation(java.net.URL loc)
          Sets the location URL of the document file from which this is generated and/or to save this to.
 void setUpdateHandler(XoUpdateHandler uh)
          This method is not yet implemented and reseved for the next version of this API.
 void transferResourceRefs(XoDMInstance extdm)
          Copy into an external DM instance the list of all local resource path URLs.
 void undo()
          Removes the last historized change, to make this in the exact state before last operation (add/remove XO object or property change).
 void unlock()
          Removes any lock previously set on this.
 void update()
          This method is not yet implemented and reseved for the next version of this API.
 

Method Detail

setUpdateHandler

public void setUpdateHandler(XoUpdateHandler uh)
This method is not yet implemented and reseved for the next version of this API.

Parameters:
uh -

getUpdateHandler

public XoUpdateHandler getUpdateHandler()
This method is not yet implemented and reseved for the next version of this API.


update

public void update()
            throws XoException
This method is not yet implemented and reseved for the next version of this API.

Throws:
XoException

release

public void release()
             throws XoException
This method makes free all XO objects belonging to this : after calling XoRoot.xoRelease(), DM instance owner of all XO objects is set to null. After a call to this method, this DM instance is no more useable.

Throws:
XoException

isReleased

public boolean isReleased()
Tells whether this has been released.

Returns:
true if release() has been called, false otherwise.

getLock

public void getLock()
Waits until caller thread acquires a lock on this DM instance. When this is locked, most methods will throw an XoLockedException if they are called by another thread than the lock owner.


unlock

public void unlock()
            throws XoException
Removes any lock previously set on this.

Throws:
XoLockedException - if this is locked by another thread
XoException

isLockOwner

public boolean isLockOwner()
Tells whether calling thread is the lock owner of this.

Returns:
true if calling thread is the lock owner

isLocked

public boolean isLocked()
Tells whether this is locked by any thread.

Returns:
true if this is locked

getHistorySize

public int getHistorySize()
Gets the number of changes on this kept in memory to be able to call undo(). Historized changes are XO child addition or removal and property change. History size is a constant value, set at DM instance creation, either to a specified value or to a default value defined in DMDL document of root element's namespace, by init option XoConstants.INIT_HISTORY_SIZE. A special value, -1, means unlimited size. History size

Returns:
size of changes history

undo

public void undo()
          throws XoException
Removes the last historized change, to make this in the exact state before last operation (add/remove XO object or property change). Does nothing if history is empty.

Throws:
XoException - and more precisely XoLockedException if DM instance is locked

redo

public void redo()
          throws XoException
This method is not yet implemented and reseved for the next version of this API.

Throws:
XoException - and more precisely XoLockedException if DM instance is locked

setReadOnly

public void setReadOnly(boolean rd)
                 throws XoException
Sets the document in read-only mode. In this mode, any attempt to call addChild(XoObject, XoContainer) or remove(XoObject) will cause an XoException to be thrown, and any attempt to modify a property of an XO object in this should throw a PropertyVetoException (provided this JavaBean feature is coded in property setter method). At creation time, a DM instance can be set by default in read-only mode, by init option XoConstants.INIT_READ_ONLY

Parameters:
rd - true to set this in read-only mode.
Throws:
XoException - and more precisely XoLockedException if DM instance is locked

isReadOnly

public boolean isReadOnly()
                   throws XoException
Tells whether this is in read-only mode.

Returns:
true if it is in read-only mode.
Throws:
XoException - and more precisely XoLockedException if DM instance is locked

setSourceLocation

public void setSourceLocation(java.net.URL loc)
                       throws XoException
Sets the location URL of the document file from which this is generated and/or to save this to. In current version, allowed protocols are http and file.

Parameters:
loc - an URL of the XML file storing this instance
Throws:
XoException - and more precisely XoLockedException if DM instance is locked

getSourceLocation

public java.net.URL getSourceLocation()
                               throws XoException
Gets the location URL of the document file from which this is generated and/or to save this to.

Returns:
loc an URL of the XML file storing this instance or null if no URL was set
Throws:
XoException - and more precisely XoLockedException if DM instance is locked

setInsertDMLocation

public void setInsertDMLocation(boolean enabled)
                         throws XoException
Tells to this whether to insert a processing instruction, when saving this to file, specifying the Data-Model modules needed to create this during XML parsing. This value can be set also by default at creation time by init option XoConstants.INIT_DMD_AUTO_LOADING_ENABLED.

Parameters:
enabled - true if this should insert DM modules location URLs to load if needed
Throws:
XoException - and more precisely XoLockedException if DM instance is locked

isInsertDMLocation

public boolean isInsertDMLocation()
                           throws XoException
Indicates whether or not this will insert a processing instruction, when saving this to file, indicating the DM modules needed to create this during XML parsing.

Returns:
true if this will insert DM modules location URLs to load if needed
Throws:
XoException - and more precisely XoLockedException if DM instance is locked

getDMLocations

public java.net.URL[] getDMLocations()
                              throws XoException
Gets URL location list permitting to load all Data-Model modules loaded

Returns:
an array of these URLs, of size the number of NS mappings made, so some or all items of this array could be null if no DM location was found for a Data-Model.
Throws:
XoException - and more precisely XoLockedException if DM instance is locked

getDMLocation

public java.net.URL getDMLocation(java.lang.String nsref)
                           throws XoException
Gets URL location permitting to load DM module specified by param nsref

Returns:
the URL of DM module location or null if not found
Throws:
XoLockedException - if this is locked
XoException - for invalid nsref

setDMLocation

public void setDMLocation(java.lang.String nsref,
                          java.net.URL url)
                   throws XoException
This method can set or change a Data-Model location URL for a specific namespace. Useful if automatic insertion of DM locs (in the form of a PI) is enabled

Parameters:
nsref - the namespace of DM
url - the DM location URL
Throws:
XoLockedException - if this is locked
XoException - for invalid nsref

setInstanceName

public void setInstanceName(java.lang.String iname)
                     throws XoException
Sets the name of this instance.

Parameters:
iname - instance name of this
Throws:
XoException - and more precisely XoLockedException if DM instance is locked

getInstanceName

public java.lang.String getInstanceName()
                                 throws XoException
Gets the name of this instance.

Returns:
instance name as string
Throws:
XoException - and more precisely XoLockedException if DM instance is locked

getReferencedIds

public java.lang.String[] getReferencedIds()
                                    throws XoException
Returns the list of XO object ID values currently registered by this.

Returns:
an array of ID values
Throws:
XoException - and more precisely XoLockedException if DM instance is locked

getXoObjectById

public XoObject getXoObjectById(java.lang.String id)
                         throws XoException
Returns the registered Xo object having id paameter as ID value.

Parameters:
id - the string value of an Xo object ID property
Returns:
the Xo object found by param id value, or null if not found
Throws:
XoLockedException - if this is locked
XoException - if no object was found with ID id

getRoot

public XoRoot getRoot()
               throws XoException
Returns the root XoRoot object.

Returns:
the XoRoot root object of content tree.
Throws:
XoLockedException - if this is locked by another thread
XoException

getIndexOfChild

public int getIndexOfChild(XoObject child)
                    throws XoException
Returns the index of child in brotherhood. This is a secured version (thread-safe, lock aware) of XoUtilities.getIndexOfChild(XoObject).

Returns:
the index of child in the list of children of its parent, or -1 if child has no parent
Throws:
XoLockedException - if this is locked by another thread
XoException - if child belongs to another DM instance, or if some error occurred during index searching

getRegistry

public XoRegistry getRegistry()
Returns the Registry of current Xotics Environment. This is an helper method to access easely to the frequently used Registry.

Returns:
The XoRegistry unique instance

getEnvironment

public XoEnvironment getEnvironment()
Returns the current Xotics Environment. This is an helper method to get easy access to this frequently used object.

Returns:
the current XoEnvironment instance

getEncoding

public java.lang.String getEncoding()
                             throws XoException
Returns the current charset encoding used to save this.

Returns:
current charset encoding used to save this instance.
Throws:
XoException - and more precisely XoLockedException if DM instance is locked
See Also:
save()

setEncoding

public void setEncoding(java.lang.String charsetEncoding)
                 throws XoException
Sets the charset encoding to use when saving this.

Parameters:
charsetEncoding -
Throws:
XoException - and more precisely XoLockedException if DM instance is locked
See Also:
save()

checkValidity

public void checkValidity()
                   throws XoException
Apply all defined validity rules to entire content tree to check its validity.

Throws:
XoLockedException - if this is locked by another thread
XoValidityException - if content tree is not valid against all validity rules defined.
XoException

checkValidity

public void checkValidity(XoObject xo,
                          boolean deep)
                   throws XoException
Checks validity from XO object xo.

Parameters:
xo - root of sub-tree to check
deep - if true, checks possible sub-tree, if false checks xo only
Throws:
XoLockedException - if this is locked by antoher thread
XoValidityException - if xo and its sub-tree is not valid
XoException - if xo belongs to another DM instance

deepEquals

public boolean deepEquals(XoObject src,
                          XoObject cmp)
                   throws XoException
Checks XO equality of two sub-trees using XoObject.equalsXoObject(XoObject) method.

Throws:
XoLockedException - if this is locked by antoher thread
XoException - if src or cmp belongs to another DM instance, or if some error occurred during sub-tree walking.

contains

public boolean contains(XoObject xo)
                 throws XoException
Checks whether this contains XO object param xo.

Parameters:
xo - an XoObject instance to control.
Returns:
true if xo belongs to this
Throws:
XoLockedException - if this is locked by antoher thread
XoException

contains

public boolean contains(XoObject xo,
                        XoObject container)
                 throws XoException
Checks whether XO object param xo is or is descendant of param container.

Parameters:
xo - an XoObject instance to control.
container - an XoContainer instance
Returns:
true if xo is descendant of container or if xo is container, return false otherwise, especially if xo or container belong to another DM instance
Throws:
XoLockedException - if this is locked by antoher thread
XoException

isWelcome

public boolean isWelcome(XoContainer parent,
                         XoObject child,
                         int index)
                  throws XoException
This method is the thread-safe version of XoContainer.isXoObjectWelcome(XoObject, int). If child is a polymorph wrapper, appropriate implementation is resolved.

Parameters:
parent - a container belonging to this
child - an XO object (including XoPolymorphWrapper) to check
index - desired insertion index
Returns:
true if child is welcome as child of parent at specified index
Throws:
XoException - if this is locked, parent belongs to another DM instance, or if some error occurred during testing

addNSMapping

public void addNSMapping(java.lang.String nsref,
                         java.lang.String nsprefix)
                  throws XoException
Sets for this DM instance a prefix to associate to namespace nsref. A unique prefix must be set for all namespace used in this DM instance, first to be able to save as XML document. A namespace is used when an XO object of this namespace belongs to content tree. If a new namespace is encountered when an XO object is added to content tree, this method is automatically called with a prefix of the form : nsx where x is an incremented counter. This method has also a side effect : when calling this method for a namespace not already used, all corresponding Data-Model informations are loaded in this. This permits to load XS datatypes and XPath functions specifically defined for this namespace.

Parameters:
nsref - the namespace reference
nsprefix - the unique prefix for this namespace
Throws:
XoLockedException - if this is locked
XoException - if nsprefix is already used for another namespace, or if some error occurred during method call.

hasNSMapping

public boolean hasNSMapping(java.lang.String nsref)
                     throws XoException
Tells whether or not param nsref namespace URI is used by this

Parameters:
nsref - the namespace URI to check
Returns:
true if nsref is used by this
Throws:
XoException

changeNSMapping

public void changeNSMapping(java.lang.String nsref,
                            java.lang.String nsprefix)
                     throws XoException
Changes the prefix string as param nsprefix associated to a namespace specified by param nsref.

Parameters:
nsref - the namespace URI string
nsprefix - the new prefix to associate to
Throws:
XoException

getNamespaceURI

public java.lang.String getNamespaceURI(java.lang.String nsprefix)
                                 throws XoException
Returns the namespace URI string associated to param nsprefix prefix.

Parameters:
nsprefix -
Returns:
the namespace URI associated to, or null if not found
Throws:
XoException

getRootNamespaceURI

public java.lang.String getRootNamespaceURI()
                                     throws XoException
Helper method which gets the namespace URI of the root XO object. Indeed, it is often needed to get the namespace of the root element.

Returns:
root's namespace URI
Throws:
XoException

getNamespaceURIs

public java.lang.String[] getNamespaceURIs()
                                    throws XoException
Gets the list of namespace URIs of Data-Models used by this.

Returns:
an array of namespace URIs of DM modules used by this.
Throws:
XoException

getNSPrefix

public java.lang.String getNSPrefix(java.lang.String nsref)
                             throws XoException
Returns the prefix associated to namespace URI nsref.

Parameters:
nsref - the namespace URI
Returns:
associated prefix or null if not found
Throws:
XoException

importDMInstance

public void importDMInstance(XoDMInstance edm,
                             XoContainer ppos)
                      throws XoException
Imports entire content copy of external DM instance edm as child of container param ppos. note that this is a deep copy made from content tree that is added as child of ppos

Parameters:
edm - DM instance whose content copy is to be imported
ppos - container accepting edm copy as child
Throws:
XoLockedException - if this or edm is locked by antoher thread
XoException - if ppos belongs to another DM instance, or if some error occurred during sub-tree walking

exportDMInstance

public XoDMInstance exportDMInstance(XoRoot rpos)
                              throws XoException
Creates a new DM instance and sets its content with a deep copy of a rootable object of this. Notes that rpos is not mandatory to be the root of this, but can be any instance of XoRoot anywhere in this. Notice also that instance name is not copied, as it can serve as some kind of ID.

Returns:
a new XoDMInstance created based on content of this
Throws:
XoLockedException - if this is locked by antoher thread
XoException - if rpos belongs to another DM instance, or if some error occurred during sub-tree walking

clone

public java.lang.Object clone()
Clone method of XoDMInstance. If some error occurred during cloning process, null is returned, no exception thrown. To have better visibility, you should rather use exportDMInstance(XoRoot).

Returns:
a copy of this

cloneXoObject

public XoObject cloneXoObject(XoObject xo,
                              boolean deep)
                       throws XoException
Clones an XO object belonging to this. Cloning can be a deep copy or single object copy. If xo is a XoPolymorphWrapper, param deep has no effect.

Parameters:
xo - object to clone
deep - true if deep copy is wanted
Returns:
a (deep)copy of xo
Throws:
XoLockedException - if this is locked by antoher thread
XoException - if xo belongs to another DM instance, or if some error occurred during sub-tree walking

addChild

public XoObject addChild(XoObject child,
                         XoContainer parent)
                  throws XoException
Appends param child to the list of children of param parent. Equivalent to call addChild(XoObject, XoContainer, int) with index at -1.

Parameters:
child - the child to add
parent - the futur parent
Returns:
the XO object really added, useful when param child is a polymorph wrapper (XoPolymorphWrapper)
Throws:
XoLockedException - if this is locked by antoher thread
XoException - if unable to add param child

addChild

public XoObject addChild(XoObject child,
                         XoContainer parent,
                         int index)
                  throws XoException
Inserts param child to the list of children of param parent at specified index. Concerning index, adding rules of XoContainer.addXoChild(XoObject, int) are used.

Parameters:
child - the child to add
parent - the futur parent
index - the insert index
Returns:
the Xo object really added, useful when param child is a polymorph wrapper (XoPolymorphWrapper)
Throws:
XoLockedException - if this is locked by antoher thread
XoException - if unable to add param child

remove

public XoObject remove(XoObject xo)
                throws XoException
Removes XO object param xo and its sub-tree from this.

Parameters:
xo - XO object to remove
Returns:
the removed object, as a polymorhp wrapper if xo is a polymorph object (XoPolymorph)
Throws:
XoLockedException - if this is locked by antoher thread
XoException - if unable to remove param xo

isRequestable

public boolean isRequestable()
If this methods returns false, it means that this instance can not be requested by XPath. Thus, in such a case, request(String, XoNode, Map) and requestXoNodes(String, XoNode, Map) will throw an XoException. This requestable property is set at creation time by init option XoConstants.INIT_REQUESTABLE and can not be changed, as it influences the way DM instance is created.

Returns:
true if this is requestable, false otherwise

request

public XoDataType request(java.lang.String reqIdOrXPath,
                          XoNode ctx,
                          java.util.Map xpathVars)
                   throws XoException
performs an XPath request from context node ctx, using an optional map of XPath variables xpathVars.

Parameters:
reqIdOrXPath - the XPath request string or an ID of it
ctx - the context node of XPath request, or null for using root node as context node (i.e this, as XML document).
xpathVars - the XPath variables in a map (String name, value object) or null if no variable to provide
Returns:
the result as an XoDataType object
Throws:
XoLockedException - if this is locked by antoher thread
XoException - if some error occurred during XPath request processing or if ctx belongs to another DM instance (if ctx is an XO object)

requestXoNodes

public XoNode[] requestXoNodes(java.lang.String reqIdOrXPath,
                               XoNode ctx,
                               java.util.Map vars)
                        throws XoException
The same as request(reqIdOrXPath, ctx, vars) except that result is transformed in an array of XoNode objects. If the result doesn't contains any XoNode, empty array is returned. If result contains anything else that XoNode, it is discarded.

Parameters:
reqIdOrXPath - the XPath request string or an ID of it
ctx - the context node of XPath request
vars - the XPath variables in a map (String name, value object)
Returns:
the result as an array (possibly empty) of XoNode objects
Throws:
XoLockedException - if this is locked by antoher thread
XoException - if some error occurred during XPath request processing or if ctx belongs to another DM instance

getClassResource

public java.lang.Class getClassResource(java.lang.String clname)
                                 throws XoException
Loads a class searched in classpaths of internal resource refs.

Parameters:
clname - a class name with package
Returns:
the class for param clname
Throws:
XoException - if this is locked or if some error occurred during class loading process

getResourceURL

public java.net.URL getResourceURL(java.lang.String path)
                            throws XoException
Searches URL corresponding to a path string seeked in internal resource refs.

Parameters:
path - a path string
Returns:
the URL resolved from param path
Throws:
XoException - if this is locked or if some error occurred during URL resolving process

addResourceRef

public void addResourceRef(java.net.URL resUrl)
                    throws XoException
Adds a resource path URL to the local class loader.

Parameters:
resUrl - a path URL to a resource location.
Throws:
XoException - if this is locked or if some error occurred during URL adding process

transferResourceRefs

public void transferResourceRefs(XoDMInstance extdm)
                          throws XoException
Copy into an external DM instance the list of all local resource path URLs.

Parameters:
extdm - the target DM instance
Throws:
XoException - if this is locked or if some error occurred during URL transfer process

addXoUndoableListener

public void addXoUndoableListener(XoUndoableListener l)
Registers an XoUndoableEvent listener interested in receiving all Undo events fired by this.

Parameters:
l - a listener of XoUndoableEvent
See Also:
XoUndoableEvent

removeXoUndoableListener

public void removeXoUndoableListener(XoUndoableListener l)
Unregisters an XoUndoableEvent listener interested in receiving all Undo events fired by this.

Parameters:
l - a listener of XoUndoableEvent
See Also:
XoUndoableEvent

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
Adds a listener of PropertyChangeEvent fired for this properties and for properties of all XoObject contained in this.

Parameters:
l - a listener of PropertyChangeEvent

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
Removes a listener of PropertyChangeEvent fired for this properties and for properties of all XoObject contained in this.

Parameters:
l - a listener of PropertyChangeEvent

addXoContainerListener

public void addXoContainerListener(XoContainerListener l)
Adds a listener of XoContainerEvent fired by this when an XoObject is added to or removed from this content tree.

Parameters:
l - a listener of XoContainerEvent

removeXoContainerListener

public void removeXoContainerListener(XoContainerListener l)
Removes a listener of XoContainerEvent fired by this when an XoObject is added to or removed from this content tree.

Parameters:
l - a listener of XoContainerEvent

save

public void save(java.net.URL url)
          throws java.io.IOException,
                 XoException
Saves this as XML document on URL specified by url param. Valids protocols are file and http.

Parameters:
url - URL to save this to
Throws:
java.io.IOException - if an IO error occurred during saving
XoLockedException - if this is locked
XoException - if URL is not of proto file or http or if some other error occured during saving

save

public void save()
          throws java.io.IOException,
                 XoException
Saves this as XML document using URL provided by getSourceLocation()

Throws:
java.io.IOException - if an IO error occurred during saving
XoLockedException - if this is locked
XoException - if this.getSourceLocation() is null or if some other error occured during saving

save

public void save(java.io.OutputStream os)
          throws java.io.IOException,
                 XoException
Saves this as XML document into output stream os. Uses getEncoding() as charset name to convert chars in appropriate byte values.

Parameters:
os - the output stream used to save this
Throws:
java.io.IOException - if an IO error occurred during saving
XoLockedException - if this is locked
XoException - if some error occured during saving

save

public void save(java.io.Writer wr)
          throws java.io.IOException,
                 XoException
Saves this as XML document into writer wr.

Parameters:
wr - the Writer used to save this
Throws:
java.io.IOException - if an IO error occurred during saving
XoLockedException - if this is locked
XoException - if some error occured during saving