oracle.ide.model
Class PropertiesNode
java.lang.Object
oracle.ide.model.DefaultDisplayable
oracle.ide.model.DefaultElement
oracle.ide.model.DefaultDocument
oracle.ide.model.DefaultNode
oracle.ide.model.PropertiesNode
- All Implemented Interfaces:
- Category, Data, Dirtyable, Displayable, Document, Element, LazyLoadable, Locatable, Node, PropertyAccess, Subject
- Direct Known Subclasses:
- PropertiesContainer
- public class PropertiesNode
- extends DefaultNode
- implements PropertyAccess
This is a complete implementation of the Node
interface
that uses a single HashMap
to hold all of its data.
PropertiesNode
takes care of marshalling the HashMap
to XML and unmarshalling it from XML back into a HashMap
.
Unmarshalling (loading) and marshalling (saving) are done only
on-demand. Access to the properties occurs through the
PropertyAccess
interface.
This class serves primarily as an example of how a Node
implementation can interact with Object2Dom
to produce
marshalling behavior that differs from the approach taken by
XMLDataNode
. The XMLDataNode
class is the main
class that is responsible for XML marshalling in the Oracle IDE
framework and in JDeveloper.
Method Summary |
void |
close()
Closes the Document and unloads any associated data. |
protected java.util.Map |
getProperties()
|
java.lang.String |
getProperty(java.lang.String key,
java.lang.String defaultValue)
Retrieves the value associated with a property. |
protected java.lang.String |
getXMLRootElementName()
|
void |
open()
Document method. |
java.lang.Object |
removeProperty(java.lang.String key)
Removes the property. |
void |
reopen()
|
void |
save(boolean shallow)
Saves the contents of the document. |
protected void |
setProperties(java.util.Map properties,
boolean markDirty)
|
java.lang.Object |
setProperty(java.lang.String key,
java.lang.String value)
Sets the value for a property. |
Methods inherited from class oracle.ide.model.DefaultDocument |
attach, copyToImpl, createSubject, detach, ensureOpen, equalsImpl, getInputStream, getLongLabel, getShortLabel, getSubject, getTimestamp, getTimestampDirectly, getToolTipText, getURL, isDirty, isNew, isOpen, isReadOnly, markDirty, notifyObservers, refreshTimestamp, setOpen, setTimestampDirectly, setURLDirectly |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface oracle.ide.model.Data |
getData |
PropertiesNode
public PropertiesNode()
PropertiesNode
protected PropertiesNode(java.net.URL url)
open
public void open()
Document
method. This implementation first checks if the
document is already open. If it is not open, then the task of
opening the document is delegated to reopen()
.
- Specified by:
open
in interface Document
- Overrides:
open
in class DefaultDocument
- See Also:
Document.open()
close
public void close()
- Description copied from interface:
Document
- Closes the
Document
and unloads any associated data.
When this method returns, the state of the Document
object should be equivalent to when the Document
object has just been instantiated but not yet opened.
- Specified by:
close
in interface Document
- Overrides:
close
in class DefaultDocument
- See Also:
Document.close()
reopen
public void reopen()
save
public void save(boolean shallow)
- Description copied from interface:
Document
- Saves the contents of the document.
- Specified by:
save
in interface Document
- Overrides:
save
in class DefaultDocument
- See Also:
Document.save(boolean)
getProperty
public java.lang.String getProperty(java.lang.String key,
java.lang.String defaultValue)
- Description copied from interface:
PropertyAccess
- Retrieves the value associated with a property. If no value
exists for the requested property, the specified default value
is returned.
- Specified by:
getProperty
in interface PropertyAccess
- Parameters:
key
- the property key for which a value is desired.defaultValue
- the value to return if no value currently
exists.
- Returns:
- the value of the requested property, or the default value
if the property does not exist.
setProperty
public java.lang.Object setProperty(java.lang.String key,
java.lang.String value)
- Description copied from interface:
PropertyAccess
- Sets the value for a property.
- Specified by:
setProperty
in interface PropertyAccess
- Parameters:
key
- the property key to setvalue
- the string value to set
- Returns:
- the previous value
removeProperty
public java.lang.Object removeProperty(java.lang.String key)
- Description copied from interface:
PropertyAccess
- Removes the property.
- Specified by:
removeProperty
in interface PropertyAccess
- Parameters:
key
- the property key to remove
- Returns:
- the previous value
getProperties
protected java.util.Map getProperties()
setProperties
protected void setProperties(java.util.Map properties,
boolean markDirty)
getXMLRootElementName
protected java.lang.String getXMLRootElementName()
Copyright © 1997, 2004, Oracle. All rights reserved.