|
Extension SDK 10.1.3.36.73 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectoracle.ide.model.NodeFactory
The NodeFactory class is responsible for creating
intances of Node.
The type of Node that gets created depends on the
URL that is passed into the findOrCreate(URL) and
findOrCreate(Class, URL) methods. The NodeFactory
makes use of registered Recognizer instances to determine
what Node class corresponds to a particular URL.
Every Node instance created by the NodeFactory
is cached. An instance of an already created Node can be
retrieved from the cache by calling the find(URL) method.
Node,
Recognizer| Field Summary | |
static int |
NODE_CACHED
Update message sent when a node is cached by a factory. |
static int |
NODE_UNCACHED
Update message sent when a node is uncached by a factory. |
| Method Summary | |
static void |
attach(Observer observer,
java.lang.Class type)
Associates the specified observer with the given
type. |
static Node |
clone(Node srcNode,
java.net.URL dstNodeURL)
Returns a new Node instance whose contents are identical
to (and copied from) the specified Node. |
static void |
detach(Observer observer,
java.lang.Class type)
Removes the specified observer from the given
type list of observers. |
static Node |
find(java.net.URL url)
Find the Node associated with the URL. |
static Node |
findInFolder(Folder folder,
java.net.URL url)
Searches the specified Folder for an instance of
Node whose URL matches the specified URL.
|
static Node |
findOrCreate(java.lang.Class type,
java.net.URL url)
Returns the Node associated with the URL. |
static Node |
findOrCreate(java.net.URL url)
Returns the Node associated with the URL. |
static Node |
findOrCreateUsingDefault(java.net.URL url,
java.lang.Class defaultNodeType)
Returns the Node associated with the URL. |
static java.util.Iterator |
getCachedNodes()
Returns an Iterator over the Node instances that
are currently cached. |
static java.util.Iterator |
getOpenNodes()
Returns an Iterator over the Node instances that
are currently opened. |
static void |
recache(java.net.URL oldURL,
java.net.URL newURL,
Node node)
Removes the oldURL from the cache and puts the
newURL in the cache so that it is associated
with the given Node. |
static void |
recache(java.net.URL oldURL,
java.net.URL newURL,
Node node,
boolean notify)
Removes the oldURL from the cache and puts the
newURL in the cache so that it is associated
with the given Node. |
static Node |
uncache(java.net.URL url)
Removes the Node with the specified URL from the
NodeFactory's cache. |
static Node |
uncache(java.net.URL url,
boolean notify)
Removes the Node with the specified URL from the
NodeFactory's cache. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int NODE_CACHED
public static final int NODE_UNCACHED
| Method Detail |
public static Node findOrCreate(java.net.URL url)
throws java.lang.IllegalAccessException,
java.lang.InstantiationException
Node associated with the URL. If the
Node does not exist, a new Node is created.
url - unique URL identifying the node.
java.lang.IllegalAccessException - if the Node class or
its initializer is not accessible.
java.lang.InstantiationException - if the Node class is
an abstract class, an interface, an array class, a primitive type,
or void; or if the instantiation fails for some other reason.
public static Node findOrCreate(java.lang.Class type,
java.net.URL url)
throws java.lang.IllegalAccessException,
java.lang.InstantiationException
Node associated with the URL. If the
Node does not exist, a new Node is created.
type - The Class of the node type to create.url - URL identifying the node's persistent location.
Node or a newly created one.
java.lang.IllegalAccessException - if the Class or its
initializer is not accessible.
java.lang.InstantiationException - if the Class is an
abstract class, an interface, an array class, a primitive type, or
void; or if the instantiation fails for some other reason.
public static Node findOrCreateUsingDefault(java.net.URL url,
java.lang.Class defaultNodeType)
throws java.lang.IllegalAccessException,
java.lang.InstantiationException
Node associated with the URL. If the
Node does not exist, a new Node is created.
url - unique URL identifying the node.defaultNodeType - the default Node type to use if none of the
recognizers can recognize the URL. Pass null to indicate that there
is no default type, and that null should be returned if no recognizer
can recognize the URL.
java.lang.IllegalAccessException - if the Node class or
its initializer is not accessible.
java.lang.InstantiationException - if the Node class is
an abstract class, an interface, an array class, a primitive type,
or void; or if the instantiation fails for some other reason.public static Node find(java.net.URL url)
Node associated with the URL. If the
Node does not exist, null is returned.
url - URL identifying the Node.
Node, or null if none
exists.
public static Node findInFolder(Folder folder,
java.net.URL url)
Folder for an instance of
Node whose URL matches the specified URL.
If no such Node can be found, null is
returned.
public static Node clone(Node srcNode,
java.net.URL dstNodeURL)
Node instance whose contents are identical
to (and copied from) the specified Node. The original
Node is not modified. The copying is done based on the
last saved state of the srcNode. The returned
Node is cached and assigned the URL specified by
dstNodeURL.
srcNode - The Node that will be cloned.dstNodeURL - The URL that is to be assigned to the
clone after all of its data has been loaded from the original.
This is the URL under which the new Node will be
cached by the NodeFactory.
Node that is a clone of the
srcNode.public static Node uncache(java.net.URL url)
Node with the specified URL from the
NodeFactory's cache.
public static Node uncache(java.net.URL url,
boolean notify)
Node with the specified URL from the
NodeFactory's cache. If notify is true, it
notifies observers that the node was uncached.
public static void recache(java.net.URL oldURL,
java.net.URL newURL,
Node node)
oldURL from the cache and puts the
newURL in the cache so that it is associated
with the given Node.
public static void recache(java.net.URL oldURL,
java.net.URL newURL,
Node node,
boolean notify)
oldURL from the cache and puts the
newURL in the cache so that it is associated
with the given Node.
public static java.util.Iterator getCachedNodes()
Iterator over the Node instances that
are currently cached. There is no guarantee as to what order the
Nodes will be iterated over. Each object iterated over can
be downcast to Node.
public static java.util.Iterator getOpenNodes()
Iterator over the Node instances that
are currently opened. There is no guarantee as to what order the
Nodes will be iterated over. Each object iterated over can
be downcast to Node.
public static final void attach(Observer observer,
java.lang.Class type)
observer with the given
type. Every time an instance of type
is cached in the node factory, a NODE_CACHED notification is
broadcast to the observer. The type
should be the class of node and not of the data. The reason for
this is that calling Node.getData() may break lazy
loading for some nodes.
public static final void detach(Observer observer,
java.lang.Class type)
observer from the given
type list of observers.
|
Extension SDK 10.1.3.36.73 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Copyright © 1997, 2005, Oracle.All rights reserved.