|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.4.0) E13403-05 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.ide.model.Node oracle.ide.model.XMLDataNode
public class XMLDataNode
The XMLDataNode
class is the Node
wrapper for
a JavaBean class that can be persisted to XML using the XML
marshalling framework Object2Dom
.
XMLDataNode
is capable of wrapping any object.
Persistence of the object's state will be mediated by the
Object2Dom
class.
If the wrapped object is an instance of Element
, then calls
to XMLDataNode
's Element
interface will be
forwarded to the wrapped Element
.
Object2Dom
Nested Class Summary | |
---|---|
protected static class |
XMLDataNode.DataCastPacket
The DataCastPacket class is a data class that is
helpful for reducing the number of type-cast operations that
need to occur. |
Field Summary |
---|
Fields inherited from class oracle.ide.model.Node |
---|
LOG_READONLY |
Constructor Summary | |
---|---|
XMLDataNode()
Default constructor required for JavaBeans status. |
|
XMLDataNode(java.lang.Object dataObject,
java.net.URL url)
Creates an XMLDataNode whose data comes from the given
dataObject . |
Method Summary | |
---|---|
protected void |
closeImpl()
Subclasses should override this method to customize the close() behavior. |
Attributes |
getAttributes()
This method returns an Attributes object that encodes the
attributes of the Element . |
java.util.Iterator |
getChildren()
This method is part of the Element interface to
provide a convenient way of getting an Iterator over any
contained child Element s without having to test the
object's type with the instanceof operator or having
to downcast to a more specific type. |
java.lang.Object |
getData()
Part of the Element interface. |
protected XMLDataNode.DataCastPacket |
getDataCastPacketDirectly()
Returns the XMLDataNode.DataCastPacket object directly. |
protected java.lang.Class |
getDefaultClass()
The default class that is specified to Object2Dom during
marshalling and unmarshalling. |
javax.swing.Icon |
getIcon()
Part of the Element interface. |
java.lang.String |
getToolTipText()
Part of the Element interface. |
protected java.lang.String |
getXMLRootElementName()
Returns the XML root element name that is to be used when writing out the XML file. |
void |
markDirty(boolean dirty)
Dirtyable interface method. |
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. |
protected Object2Dom |
newObject2Dom()
Returns an appropriately configured instance of Object2Dom
which will be used to carry out the marshalling. |
protected void |
openImpl()
Subclasses should override this method to customize the open() behavior. |
protected void |
saveImpl()
Subclasses should override this method to customize the save() behavior. |
void |
setData(java.lang.Object object,
boolean dirty)
Binds the specified Object to the XMLDataNode
instance as being its data object. |
protected void |
setDataCastPacketDirectly(XMLDataNode.DataCastPacket data)
Sets the XMLDataNode.DataCastPacket object directly. |
void |
setNodeInfo(NodeInfo info)
Binds the given info to the XMLDataNode
instance as being its node information. |
void |
setURL(java.net.URL url)
Sets the URL associated with this Node and
recaches the Node in the NodeFactory with
the new URL so that subsequent queries for the
Node will return successfully. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public XMLDataNode()
XMLDataNode
can itself
be persisted and loaded by the XML marshalling framework.
The default constructor performs no intialization. That is, the
XMLDataNode
is initially marked as unopened, and there
is no URL
associated with it.
Generally, use of the default constructor should be reserved for
the XML marshalling framework. If other application code does make
use of the default constructor, however, there must be a call to
either setURL(URL)
or setData(Object, boolean)
before any of the other methods in XMLDataNode
will
produce valid results.
public XMLDataNode(java.lang.Object dataObject, java.net.URL url)
XMLDataNode
whose data comes from the given
dataObject
. Because a data object is specified, the
XMLDataNode
is marked as opened and the data object is
marked as dirty, if it implements Dirtyable
.
The specified URL
is used as the output location where
the marshalled XML data will be written to when the
#save(boolean)
method is called.
Method Detail |
---|
public void setURL(java.net.URL url)
Node
URL
associated with this Node
and
recaches the Node
in the NodeFactory
with
the new URL
so that subsequent queries for the
Node
will return successfully.
setURL
in interface Locatable
setURL
in class Node
url
- The URL
to set.Locatable.setURL(URL)
public javax.swing.Icon getIcon()
Element
interface. This method attempts first
to delegate to the underlying JavaBean to determine the
Icon
. If there is no associated JavaBean or if the
JavaBean does not implement Element
, then the determination
of the Icon
is delegated to the superclass.
getIcon
in interface Displayable
getIcon
in class Node
Icon
to be displayed for the
Displayable
.public java.lang.String getToolTipText()
Element
interface. This method attempts first
to delegate to the underlying JavaBean to determine the tooltip
text. If there is no associated JavaBean or if the JavaBean does
not implement Element
, then the determination of the tooltip
text is left to the superclass.
getToolTipText
in interface Displayable
getToolTipText
in class Node
Displayable
.public java.lang.Object getData()
Element
interface. If necessary, this method
will first load the data from the location returned by
Node.getURL()
and unmarshal it with Object2Dom
. Once
loaded and unmarshalled, if the wrapped object is an
Element
then the value of its Element.getData()
method is returned; otherwise the data object itself will be
returned. In any case, the returned object is a JavaBean.
getData
in interface Element
getData
in class Node
Node.getURL()
.Node.open()
public boolean mayHaveChildren()
Element
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.
mayHaveChildren
in interface Element
mayHaveChildren
in class Node
true
if this Element
may contain
child Element
s.public java.util.Iterator getChildren()
Element
Element
interface to
provide a convenient way of getting an Iterator
over any
contained child Element
s 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 null
from this
method. An implementation of Element
that could
represent a non-leaf in a tree structure should return either an
Iterator
over the child Element
s or
null
if there are no children.
getChildren
in interface Element
getChildren
in class Node
Iterator
over any child Element
s
contained by this Element
. If there are no children,
null
is returned.public Attributes getAttributes()
Element
Attributes
object that encodes the
attributes of the Element
. Changing the attribute
settings on the return object changes the element attributes.
Subclasses should use their super class attributes object to
define their own attributes. This allows subclasses to
inherit their super class attributes. If a subclass does not
wish to inherit attributes, they should first call
getAttributes().clear()
and define new attributes.
getAttributes
in interface Element
getAttributes
in class Node
public void markDirty(boolean dirty)
Dirtyable
interface method. If the wrapped object is an
instance of Dirtyable
, then this implementation delegates
the setting of the dirty flag to the wrapped object. Otherwise,
the determination of the return value is delegated to the
superclass.
markDirty
in interface Dirtyable
markDirty
in class Node
dirty
- If true
, sets the object as being
dirty; if false
, sets the object as being up-to-date.protected void openImpl() throws java.io.IOException
Node
Node.open()
invokes this only if the node is not open, under
write lock. The Node
implementation does nothing.
openImpl
in class Node
java.io.IOException
- if an I/O error occurred while openingprotected void closeImpl() throws java.io.IOException
Node
Node.close()
invokes this only if the node is open, under
write lock. The Node
implementation does nothing.
closeImpl
in class Node
java.io.IOException
- if an I/O error occurred while closingprotected void saveImpl() throws java.io.IOException
Node
Node.save()
invokes this only if the node is dirty, under
write lock. The Node
implementation does nothing.
saveImpl
in class Node
java.io.IOException
- if an I/O error occurred while savingpublic void setNodeInfo(NodeInfo info)
info
to the XMLDataNode
instance as being its node information.
public void setData(java.lang.Object object, boolean dirty)
Object
to the XMLDataNode
instance as being its data object. If this method succeeds, the
XMLDataNode
will be marked as opened and the wrapped
data object will have its dirty state set according to the
dirty
parameter.
protected XMLDataNode.DataCastPacket getDataCastPacketDirectly()
XMLDataNode.DataCastPacket
object directly. This
method is primarily intended for subclass customization. In this
method, it is important that the underlying content is not
opened if it is currently closed. It is also important that this
method never return null
and instead return an instance
of XMLDataNode.DataCastPacket
whose wrapped object is
null
.
protected void setDataCastPacketDirectly(XMLDataNode.DataCastPacket data)
XMLDataNode.DataCastPacket
object directly. This
method is primarily intended for subclass customization.
protected java.lang.String getXMLRootElementName()
#save(boolean)
method will use the subclass's
return value for this method when writing out the XML file.
When this method is overridden in a subclass, it is generally also
desirable to have the IDE be able to recognize the XML root element
name so that the IDE will instantiate the correct Node
class for the XML file. Refer to the javadoc for
XMLRecognizer
for details.
XMLRecognizer
protected Object2Dom newObject2Dom()
Object2Dom
which will be used to carry out the marshalling.
protected java.lang.Class getDefaultClass()
Object2Dom
during
marshalling and unmarshalling. Returns null
if
there is no default class.
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.4.0) E13403-05 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |