Skip navigation links

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

E52944-01


oracle.ide.model
Class DataContainer

java.lang.Object
  extended by oracle.ide.model.Node
      extended by oracle.ide.model.DataContainer

All Implemented Interfaces:
Displayable, Element, Folder, LazyLoadable, Locatable, Observer, Subject, Dirtyable, PropertyStorage
Direct Known Subclasses:
HashStructureNode, IdeSystem, ProviderNode

public class DataContainer
extends Node
implements PropertyStorage, Folder, Observer

Field Summary

 

Fields inherited from class oracle.ide.model.Node
LOG_READONLY

 

Fields inherited from interface oracle.javatools.data.PropertyStorage
DATA_KEY

 

Constructor Summary
DataContainer()
           
DataContainer(java.net.URL url)
           

 

Method Summary
 boolean add(java.util.Collection childElements, boolean notify)
          Adds a Collection of Element objects to the child list for the container.
 boolean add(Element element)
          Part of the Folder interface.
 boolean add(Element element, boolean notify)
           
 boolean canAdd(Element element)
          Part of the Folder interface.
 boolean canRemove(Element element)
          Part of the Folder interface.
protected  void closeImpl()
          Subclasses should override this method to customize the close() behavior.
 boolean containsChild(Element child)
          Returns true if the folder contains the specified child Element; returns false otherwise.
 boolean equals(java.lang.Object obj)
           
protected  boolean equalsImpl(DataContainer other)
           
 java.lang.String getBaseDirectory()
           
 java.util.Iterator<Element> getChildren()
          Part of the Element interface.
 java.util.List getListOfChildren()
          Fulfills the public accessor part of the Folder contract.

WARNING: it is suggested that you verify the types of each element in the returned list, as there is no guarantee that all elements share the same type.

protected  java.lang.Object getObjectStoreTarget()
           
 HashStructure getProperties()
          Returns the root HashStructure object that holds properties for this Project.
 java.lang.String getProperty(java.lang.String name)
          Convenience method equivalent to calling project.getProperties().getString(name).
 java.lang.String getProperty(java.lang.String name, java.lang.String defaultValue)
          Convenience method equivalent to calling project.getProperties().getString(name, defaultValue).
 HashStructure getSharedPropertiesOnly()
          This method returns the persistent HashStructure that is not user-private.
 java.net.URL getURL()
          This override marks the URL property as transient.
 HashStructure getUserPropertiesOnly()
          For DataContainer subtypes that distinguish between user-private properties and shared properties, this method returns only the user-private HashStructure.
 boolean mayHaveChildren()
          Part of the Element interface.
protected  ObjectStore newObjectStore()
           
 boolean remove(Element element)
          Part of the Folder interface.
 boolean remove(Element element, boolean notify)
           
 void removeAll()
          Removes all children from the folder.
 void removeAll(boolean notify)
           
protected  void resetSubDirtyableOwners(java.util.List children)
          Resets the owner of each element listed.
protected  void saveImpl()
          Subclasses should override this method to customize the save() behavior.
 void setListOfChildren(java.util.List<?> list)
          Fulfills the public accessor part of the Folder contract.
 void setProperty(java.lang.String name, java.lang.String value)
          Convenience method equivalent to calling project.getProperties().putString(name, value).
protected  void setSubDirtyableOwner(Element element, Dirtyable owner)
          Sets the owner of this element to the specified element.
 int size()
          Returns the current number of children in the folder.
 void update(java.lang.Object observed, UpdateMessage change)
          Notification message.

 

Methods inherited from class oracle.ide.model.Node
addNodeListener, addNodeListenerForType, addNodeListenerForTypeHierarchy, attach, beginThreadNodeUsageCycle, callUnderReadLock, callUnderWriteLock, close, createSubject, delete, deleteImpl, detach, endThreadNodeUsage, endThreadNodeUsageCycle, ensureOpen, equalsImpl, getAttributes, getData, getIcon, getInputStream, getLongLabel, getShortLabel, getSubject, getTimestamp, getTimestampLoadedUnsafe, getToolTipText, getTransientProperties, getUnmodifiedTimestamp, isDirty, isLoaded, isMigrating, isNew, isOpen, isReadLocked, isReadOnly, isReadOrWriteLocked, isTrackedInNodeCache, isWriteLocked, lockCount, markDirty, markDirtyImpl, nodeLock, notifyObservers, open, openImpl, readLock, readLockCount, readUnlock, refreshTimestamp, removeNodeListener, removeNodeListenerForType, removeNodeListenerForTypeHierarchy, rename, renameImpl, reportOpenException, revert, revertImpl, runUnderReadLock, runUnderWriteLock, save, setEventLog, setMigrating, setOpen, setReadOnly, setTimestampDirectly, setURL, toString, tryRunUnderReadLock, tryRunUnderWriteLock, unsetMigrating, upgradeLock, upgradeUnlock, urlReadOnlyChanged, writeLock, writeLockCount, writeUnlock

 

Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

 

Methods inherited from interface oracle.ide.model.Element
getAttributes, getData

 

Methods inherited from interface oracle.ide.model.Displayable
getIcon, getLongLabel, getShortLabel, getToolTipText, toString

 

Constructor Detail

DataContainer

public DataContainer()

DataContainer

public DataContainer(java.net.URL url)

Method Detail

getURL

public java.net.URL getURL()
                    throws TransientMarker
This override marks the URL property as transient.
Specified by:
getURL in interface Locatable
Overrides:
getURL in class Node
Returns:
The URL identifying this Locatable.
Throws:
TransientMarker

getProperties

public HashStructure getProperties()
Returns the root HashStructure object that holds properties for this Project. This method is guaranteed to return non-null.

Subclasses that support user-private properties must override this method to return the proper chained HashStructure.

Specified by:
getProperties in interface PropertyStorage
Returns:
The HashStructure wrapped by this PropertyStorage.

getUserPropertiesOnly

public HashStructure getUserPropertiesOnly()
For DataContainer subtypes that distinguish between user-private properties and shared properties, this method returns only the user-private HashStructure. If user-private properties are not supported, this method returns the same value as getSharedPropertiesOnly().

Subclasses that support user-private properties must override this method to return the right HashStructure.


getSharedPropertiesOnly

public final HashStructure getSharedPropertiesOnly()
This method returns the persistent HashStructure that is not user-private. Usually such a file is "shared" on a development team through source control.

getProperty

public final java.lang.String getProperty(java.lang.String name)
Convenience method equivalent to calling project.getProperties().getString(name).

getProperty

public final java.lang.String getProperty(java.lang.String name,
                                          java.lang.String defaultValue)
Convenience method equivalent to calling project.getProperties().getString(name, defaultValue).

setProperty

public final void setProperty(java.lang.String name,
                              java.lang.String value)
Convenience method equivalent to calling project.getProperties().putString(name, value).

getListOfChildren

public java.util.List getListOfChildren()
                                 throws TransientMarker
Fulfills the public accessor part of the Folder contract.

WARNING: it is suggested that you verify the types of each element in the returned list, as there is no guarantee that all elements share the same type. Usually all of them are of type @{link Element} but there can be a few elements of type @{link Reference} as well, this happens when a

Returns:
a List view of the child elements contained by this DataFolder. List elements may be of type @{link Element} or @{link Reference}.
Throws:
TransientMarker

setListOfChildren

public void setListOfChildren(java.util.List<?> list)
Fulfills the public accessor part of the Folder contract. Sets the child list of the DataFolder instance to match the specified List. Only objects in the List that can be cast to Element are added. The implementation uses the DefaultFolder.add(Element) method to add the child to the list, so that subclass implementations can override DefaultFolder.add(Element) without having to also override this method.

mayHaveChildren

public boolean mayHaveChildren()
Part of the Element interface. This implementation always returns true.
Specified by:
mayHaveChildren in interface Element
Overrides:
mayHaveChildren in class Node
Returns:
true if this Element may contain child Elements.
See Also:
Element.mayHaveChildren()

getChildren

public java.util.Iterator<Element> getChildren()
Part of the Element interface. This implementation returns an Iterator over the current list of children.
Specified by:
getChildren in interface Element
Overrides:
getChildren in class Node
Returns:
an Iterator over any child Elements contained by this Element. If there are no children, null is returned.
See Also:
Element.getChildren()

canAdd

public boolean canAdd(Element element)
Part of the Folder interface. The default implementation returns true if and only if the specified Element is not null.
Specified by:
canAdd in interface Folder
Parameters:
element - the Element that is about to be added to this Folder.
Returns:
true if and only if the specified Element is not null.
See Also:
Folder.canAdd(Element)

add

public boolean add(Element element)
Part of the Folder interface. The specified Element is added to the end of the child list. However, if the Element is null, this method does nothing.

No notification is fired by this method.

Specified by:
add in interface Folder
See Also:
Folder.add(oracle.ide.model.Element)

canRemove

public boolean canRemove(Element element)
Part of the Folder interface. The default implementation returns true if and only if the specified Element is not null.
Specified by:
canRemove in interface Folder
Parameters:
element - the Element that is about to be removed from this Folder.
Returns:
true if and only if the specified Element is not null.
See Also:
Folder.canRemove(Element)

remove

public boolean remove(Element element)
Part of the Folder interface. The specified Element is removed from the child list. However, if the Element is null, this method does nothing. If the Element occurs more than once in the child list, then only the first instance is removed.

No notification is fired by this method.

Specified by:
remove in interface Folder
Parameters:
element - The child object to remove.
See Also:
Folder.remove(Element)

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)

getBaseDirectory

public final java.lang.String getBaseDirectory()

closeImpl

protected void closeImpl()
                  throws java.io.IOException
Description copied from class: Node
Subclasses should override this method to customize the close() behavior. Node.close() invokes this only if the node is open, under write lock. The Node implementation does nothing.
Overrides:
closeImpl in class Node
Throws:
java.io.IOException - if an I/O error occurred while closing

saveImpl

protected void saveImpl()
                 throws java.io.IOException
Description copied from class: Node
Subclasses should override this method to customize the save() behavior. Node.save() invokes this only if the node is dirty, under write lock. The Node implementation does nothing.
Overrides:
saveImpl in class Node
Throws:
java.io.IOException - if an I/O error occurred while saving

newObjectStore

protected ObjectStore newObjectStore()

getObjectStoreTarget

protected java.lang.Object getObjectStoreTarget()

update

public void update(java.lang.Object observed,
                   UpdateMessage change)
Description copied from interface: Observer
Notification message. Subjects call this method when they notify their observers that the subjects state has changed.
Specified by:
update in interface Observer
Parameters:
observed - the subject whose state has changed.
change - what has changed.

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

equalsImpl

protected final boolean equalsImpl(DataContainer other)

add

public boolean add(java.util.Collection childElements,
                   boolean notify)
Adds a Collection of Element objects to the child list for the container. Each Element is added with the add(Element, boolean) method. If an Object in the Collection is not an Element or if an Element cannot be added to the container, then it is skipped and false is returned; the other Element objects in the Collection will still be added, however.

resetSubDirtyableOwners

protected void resetSubDirtyableOwners(java.util.List children)
Resets the owner of each element listed. Ownership here refers to the element that owns a SubDirtyable element. When a sub-dirtyable element is made dirty it actually makes its owner dirty.

setSubDirtyableOwner

protected void setSubDirtyableOwner(Element element,
                                    Dirtyable owner)
Sets the owner of this element to the specified element. When a sub-dirtyable object is made dirty it actually makes its owner dirty.

Skip navigation links

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

E52944-01


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