|
Extension SDK 10.1.2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.ide.model.DefaultDisplayable
oracle.ide.model.DefaultElement
oracle.ide.model.DefaultDocument
oracle.ide.model.DefaultNode
oracle.ide.model.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 interface oracle.ide.addin.Subject |
OBJECT_MODIFIED |
Fields inherited from interface oracle.ide.model.Category |
UNDEFINED |
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 | |
void |
close() Closes the Document and unloads any associated data. |
Attributes |
getAttributes() This method returns an Attributes object that encodes the attributes of the Element . |
int |
getCategory() Get the bit field identifying the different categories this data node falls under. |
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 oracle.ide.marshal.xml.Object2Dom |
newObject2Dom() Returns an appropriately configured instance of Object2Dom which will be used to carry out the marshalling. |
void |
open() Document interface method. |
void |
reopen() |
void |
save(boolean shallow) Document interface method. |
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 DefaultNode and recaches the DefaultNode in the NodeFactory with the new URL so that subsequent queries for the DefaultNode will return successfully. |
Methods inherited from class oracle.ide.model.DefaultNode |
equalsImpl |
Methods inherited from class oracle.ide.model.DefaultDocument |
attach, copyToImpl, createSubject, detach, ensureOpen, equalsImpl, getInputStream, getLongLabel, getShortLabel, getSubject, getTimestamp, getTimestampDirectly, getURL, isDirty, isNew, isOpen, isReadOnly, notifyObservers, refreshTimestamp, setOpen, setTimestampDirectly, setURLDirectly |
Methods inherited from class oracle.ide.model.DefaultDisplayable |
toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface oracle.ide.model.Document |
getInputStream, getTimestamp, isNew, isReadOnly |
Methods inherited from interface oracle.ide.model.Locatable |
getURL |
Methods inherited from interface oracle.ide.model.Displayable |
getLongLabel, getShortLabel, toString |
Methods inherited from interface oracle.ide.addin.Subject |
attach, detach, notifyObservers |
Methods inherited from interface oracle.ide.model.Dirtyable |
isDirty |
Methods inherited from interface oracle.ide.model.LazyLoadable |
isOpen |
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)
DefaultNode
URL
associated with this DefaultNode
and recaches the DefaultNode
in the NodeFactory
with the new URL
so that subsequent queries for the DefaultNode
will return successfully.setURL
in interface Locatable
setURL
in class DefaultNode
Locatable.setURL(URL)
, DefaultDocument.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 DefaultDisplayable
Displayable.getIcon()
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 DefaultDocument
Displayable.getToolTipText()
public java.lang.Object getData()
Element
interface. If necessary, this method will first load the data from the location returned by DefaultDocument.getURL()
and unmarshal it with Object2Dom
. Once loaded and unmarshalled, if the wrapped object is an Element
then the value of its Data.getData()
method is returned; otherwise the data object itself will be returned. In any case, the returned object is a JavaBean.getData
in interface Data
getData
in class DefaultElement
DefaultDocument.getURL()
.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 DefaultElement
Element.mayHaveChildren()
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 DefaultElement
Element.getChildren()
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 DefaultElement
Element.getAttributes()
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 DefaultDocument
public void open() throws java.io.IOException
Document
interface method. This method uses Object2Dom
to unmarshal the XML file into a JavaBean instance. The JavaBean instance then becomes available through the getData()
method.open
in interface Document
open
in class DefaultDocument
java.io.IOException
Object2Dom
public void close()
Document
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.close
in interface Document
close
in class DefaultDocument
Document.close()
public void reopen() throws java.io.IOException
java.io.IOException
public void save(boolean shallow) throws java.io.IOException
Document
interface method. This method uses Object2Dom
to marshal the underlying JavaBean into an XML form.save
in interface Document
save
in class DefaultDocument
java.io.IOException
Object2Dom
public int getCategory()
Category
getCategory
in interface Category
getCategory
in class DefaultNode
public 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 oracle.ide.marshal.xml.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.
|
Extension SDK | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1997, 2004, Oracle. All rights reserved.