Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.7.0)

E13403-08

oracle.ide.model
Class XMLDataContainer

java.lang.Object
  extended by oracle.ide.model.Node
      extended by oracle.ide.model.XMLDataNode
          extended by oracle.ide.model.XMLDataContainer
All Implemented Interfaces:
Displayable, Element, Folder, LazyLoadable, Locatable, Subject, Dirtyable

public class XMLDataContainer
extends XMLDataNode
implements Folder

The XMLDataContainer is the Node wrapper for a Folder-implementing JavaBean that can be persisted to XML using the XML marshalling framework in oracle.ide.marshal.xml.

XMLDataContainer wraps objects that can contain children. In order to interact with XMLDataContainer, wrapped objects must implement Folder.

All methods to the XMLDataContainer's Element and Folder methods are forwarded to the wrapped Folder object.

If the wrapped object is not an instance of Folder, then an IllegalStateException will be thrown every time an operation that requires the children list is called.

See Also:
Object2Dom

Nested Class Summary
 
Nested classes/interfaces inherited from class oracle.ide.model.XMLDataNode
XMLDataNode.DataCastPacket
 
Field Summary
 
Fields inherited from class oracle.ide.model.Node
LOG_READONLY
 
Constructor Summary
XMLDataContainer()
           
 
Method Summary
 boolean add(Element element)
          Appends a child Element to the end of the Folder.
 boolean add(Element element, boolean notify)
           
 boolean canAdd(Element element)
          Other classes can call this method to determine whether the given Element can be added to the Folder.
 boolean canRemove(Element element)
          Other classes can call this method to determine whether the specified Element can be removed from this Folder.
 boolean containsChild(Element child)
          Returns true if the folder contains the specified child Element; returns false otherwise.
protected  Folder getDataFolder()
          Retrieves the Folder object associated with this XMLDataContainer instance.
 boolean mayHaveChildren()
          This method is part of the Element interface to provide a convenient way of determining whether an object may have children without having to test the object's type with the instanceof operator or having to downcast to a more specific type.
 boolean remove(Element element)
          Removes the specified child Element.
 boolean remove(Element element, boolean notify)
           
 void removeAll()
          Removes all children from the folder.
 void removeAll(boolean notify)
           
 int size()
          Returns the current number of children in the folder.
 
Methods inherited from class oracle.ide.model.XMLDataNode
closeImpl, getAttributes, getChildren, getData, getDataCastPacketDirectly, getDefaultClass, getIcon, getToolTipText, getXMLRootElementName, markDirty, newObject2Dom, openImpl, saveImpl, setData, setDataCastPacketDirectly, setNodeInfo, setURL
 
Methods inherited from class oracle.ide.model.Node
addNodeListener, addNodeListenerForType, addNodeListenerForTypeHierarchy, attach, beginThreadNodeUsageCycle, callUnderReadLock, callUnderWriteLock, close, createSubject, delete, deleteImpl, detach, endThreadNodeUsage, endThreadNodeUsageCycle, ensureOpen, equalsImpl, getInputStream, getLongLabel, getShortLabel, getSubject, getTimestamp, getTimestampLoadedUnsafe, getTransientProperties, getUnmodifiedTimestamp, getURL, isDirty, isLoaded, isMigrating, isNew, isOpen, isReadLocked, isReadOnly, isReadOrWriteLocked, isTrackedInNodeCache, isWriteLocked, lockCount, markDirtyImpl, nodeLock, notifyObservers, open, readLock, readLockCount, readUnlock, refreshTimestamp, removeNodeListener, removeNodeListenerForType, removeNodeListenerForTypeHierarchy, rename, renameImpl, reportOpenException, revert, revertImpl, runUnderReadLock, runUnderWriteLock, save, setEventLog, setMigrating, setOpen, setReadOnly, setTimestampDirectly, toString, tryRunUnderReadLock, tryRunUnderWriteLock, unsetMigrating, upgradeLock, upgradeUnlock, urlReadOnlyChanged, writeLock, writeLockCount, writeUnlock
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface oracle.ide.model.Element
getAttributes, getChildren, getData
 
Methods inherited from interface oracle.ide.model.Displayable
getIcon, getLongLabel, getShortLabel, getToolTipText, toString
 

Constructor Detail

XMLDataContainer

public XMLDataContainer()
Method Detail

mayHaveChildren

public boolean mayHaveChildren()
Description copied from interface: Element
This method is part of the Element interface to provide a convenient way of determining whether an object may have children without having to test the object's type with the instanceof operator or having to downcast to a more specific type.

An implementation of Element that represents a leaf in a tree structure should return false from this method. An implementation of Element that could represent a non-leaf in a tree structure should return true from this method, even if it does not currently contain any children.

Specified by:
mayHaveChildren in interface Element
Overrides:
mayHaveChildren in class XMLDataNode
Returns:
true if this Element may contain child Elements.

canAdd

public boolean canAdd(Element element)
Description copied from interface: Folder
Other classes can call this method to determine whether the given Element can be added to the Folder.

Specified by:
canAdd in interface Folder
Parameters:
element - the Element that is about to be added to this Folder.
Returns:
true if the specified Element can be added to this Folder; false if the Element cannot be added.

add

public boolean add(Element element)
Description copied from interface: Folder
Appends a child Element to the end of the Folder.

Specified by:
add in interface Folder

canRemove

public boolean canRemove(Element element)
Description copied from interface: Folder
Other classes can call this method to determine whether the specified Element can be removed from this Folder.

Specified by:
canRemove in interface Folder
Parameters:
element - the Element that is about to be removed from this Folder.
Returns:
true if the specified Element can be removed from this Folder; false if the Element cannot be removed.

remove

public boolean remove(Element element)
Description copied from interface: Folder
Removes the specified child Element. If the child object appears more than once, only the first instance is removed.

Specified by:
remove in interface Folder
Parameters:
element - The child object to remove.

containsChild

public boolean containsChild(Element child)
Description copied from interface: Folder
Returns true if the folder contains the specified child Element; returns false otherwise.

Specified by:
containsChild in interface Folder

size

public int size()
Description copied from interface: Folder
Returns the current number of children in the folder.

Specified by:
size in interface Folder

removeAll

public void removeAll()
Description copied from interface: Folder
Removes all children from the folder.

Specified by:
removeAll in interface Folder

add

public boolean add(Element element,
                   boolean notify)

remove

public boolean remove(Element element,
                      boolean notify)

removeAll

public void removeAll(boolean notify)

getDataFolder

protected final Folder getDataFolder()
                              throws java.lang.IllegalStateException
Retrieves the Folder object associated with this XMLDataContainer instance. If there is no Folder currently associated with the XMLDataContainer, however, then an IllegalStateException is thrown.

Throws:
java.lang.IllegalStateException - if the XMLDataContainer is not capable of holding a Folder.

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.7.0)

E13403-08

Copyright © 1997, 2013, Oracle. All rights reserved.