public class DataContainer extends Node implements PropertyStorage, Folder, Observer
LOG_READONLYDATA_KEY| Constructor and Description |
|---|
DataContainer() |
DataContainer(java.net.URL url) |
| Modifier and Type | Method and Description |
|---|---|
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)
|
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. |
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.
|
int |
hashCode() |
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 |
revertImpl()
Subclasses should override this method to customize the revert()
behavior.
|
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.
|
addNodeListener, addNodeListenerForType, addNodeListenerForTypeHierarchy, addWeakNodeListener, 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, isLockHeld, isMigrating, isNew, isOpen, isReadLocked, isReadLockHeld, isReadOnly, isReadOrWriteLocked, isTrackedInNodeCache, isTrackingThreadNodeUsage, isWriteLocked, isWriteLockHeld, lockCount, markDirty, markDirtyImpl, nodeLock, notifyObservers, open, openImpl, readLock, readLockCount, readLockInterruptibly, readUnlock, refreshTimestamp, removeNodeListener, removeNodeListenerForType, removeNodeListenerForTypeHierarchy, removeWeakNodeListener, rename, renameImpl, reportOpenException, revert, runUnderReadLock, runUnderWriteLock, save, setEventLog, setMigrating, setOpen, setReadOnly, setTimestampDirectly, setURL, toString, tryRunUnderReadLock, tryRunUnderWriteLock, unsetMigrating, upgradeLock, upgradeUnlock, urlReadOnlyChanged, writeLock, writeLockCount, writeLockInterruptibly, writeUnlockclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetAttributes, getDatagetAttributedLabel, getIcon, getLongLabel, getShortLabel, getToolTipText, toStringpublic DataContainer()
public DataContainer(java.net.URL url)
public java.net.URL getURL()
throws TransientMarker
getURL in interface LocatablegetURL in class NodeURL identifying this Locatable.TransientMarkerpublic HashStructure getProperties()
Subclasses that support user-private properties must override this method to return the proper chained HashStructure.
getProperties in interface PropertyStorageHashStructure wrapped by this PropertyStorage.public HashStructure getUserPropertiesOnly()
getSharedPropertiesOnly().Subclasses that support user-private properties must override this method to return the right HashStructure.
public final HashStructure getSharedPropertiesOnly()
public final java.lang.String getProperty(java.lang.String name)
project.getProperties().getString(name).public final java.lang.String getProperty(java.lang.String name,
java.lang.String defaultValue)
project.getProperties().getString(name, defaultValue).public final void setProperty(java.lang.String name,
java.lang.String value)
project.getProperties().putString(name, value).public java.util.List getListOfChildren()
throws TransientMarker
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
Node is added as a child to this DataContainer.
List view of the child elements contained
by this DataFolder. List elements may be of type Element
or Reference.TransientMarkerpublic void setListOfChildren(java.util.List<?> list)
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.public boolean mayHaveChildren()
Element interface. This implementation always
returns true.mayHaveChildren in interface ElementmayHaveChildren in class Nodetrue if this Element may contain
child Elements.Element.mayHaveChildren()public java.util.Iterator<Element> getChildren()
Element interface. This implementation returns
an Iterator over the current list of children.getChildren in interface ElementgetChildren in class NodeIterator over any child Elements
contained by this Element. If there are no children,
null is returned.Element.getChildren()public boolean canAdd(Element element)
Folder interface. The default implementation
returns true if and only if the specified
Element is not null.canAdd in interface Folderelement - the Element that is about to be added
to this Folder.true if and only if the specified
Element is not null.Folder.canAdd(Element)public boolean add(Element element)
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.
add in interface FolderFolder.add(oracle.ide.model.Element)public boolean canRemove(Element element)
Folder interface. The default implementation
returns true if and only if the specified
Element is not null.canRemove in interface Folderelement - the Element that is about to be removed
from this Folder.true if and only if the specified
Element is not null.Folder.canRemove(Element)public boolean remove(Element element)
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.
remove in interface Folderelement - The child object to remove.Folder.remove(Element)public boolean containsChild(Element child)
FoldercontainsChild in interface Folderpublic int size()
Folderpublic void removeAll()
Folderpublic boolean add(Element element, boolean notify)
public boolean remove(Element element, boolean notify)
public void removeAll(boolean notify)
public final java.lang.String getBaseDirectory()
protected void closeImpl()
throws java.io.IOException
NodeNode.close() invokes this only if the node is open, under
write lock. The Node implementation does nothing.protected void saveImpl()
throws java.io.IOException
NodeNode.save() invokes this only if the node is dirty, under
write lock. The Node implementation does nothing.protected void revertImpl()
throws java.io.IOException
NodeNode.revert() invokes this only if the node is dirty, under
write lock. The Node implementation invokes Node.closeImpl()
followed by Node.openImpl().revertImpl in class Nodejava.io.IOException - if an I/O error occurred while revertingprotected ObjectStore newObjectStore()
protected java.lang.Object getObjectStoreTarget()
public void update(java.lang.Object observed,
UpdateMessage change)
Observerpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectprotected final boolean equalsImpl(DataContainer other)
public int hashCode()
hashCode in class java.lang.Objectpublic boolean add(java.util.Collection childElements,
boolean notify)
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.protected void resetSubDirtyableOwners(java.util.List children)
SubDirtyable element. When
a sub-dirtyable element is made dirty it actually makes its owner
dirty.