|
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.Factory oracle.ide.model.ElementFactory
The ElementFactory
class is responsible for creating
intances of Element
s.
The type of Element
that gets created depends on the
object identifier that is passed into the
findOrCreate(URL, Project)
. The ElementFactory
makes use of registered ElementRecognizer
instances to determine
what Element
class corresponds to a particular URL
.
Element
instances created by the ElementFactory
are generally not cached. It is up to a ElementRecognizer
to determine if the instances it creates should be cached or not.
Element
,
ElementRecognizer
Nested Class Summary |
Nested classes inherited from class oracle.ide.model.Factory |
Factory.RecognizerList |
Field Summary |
Fields inherited from class oracle.ide.model.Factory |
NODE_CACHED, NODE_CREATED, NODE_UNCACHED |
Constructor Summary | |
ElementFactory()
|
Method Summary | |
static void |
addRecognizer(int index,
Recognizer recognizer)
Registers a Recognizer , placing it in the
specified location in the list of recognizers. |
static void |
addRecognizer(Recognizer recognizer)
Registers a ElementRecognizer , appending it to the end
of the list of recognizers. |
static Element |
findOrCreate(java.net.URL url,
Project project)
Returns an Element associated with the identifier . |
static Recognizer |
findRecognizer(java.net.URL url)
Returns the instance of Recognizer that is able to specify
the Node class that should be instantiated for the given
URL . |
static java.util.Iterator |
getRecognizers()
Returns the list of registered recognizers. |
static java.lang.Class |
recognize(java.net.URL url)
Returns the instance of Recognizer that is able to specify
the Element class that should be instantiated for the given
url . |
static void |
removeRecognizer(Recognizer recognizer)
Unregisters a Recognizer . |
Methods inherited from class oracle.ide.model.Factory |
attach, detach, notify |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ElementFactory()
Method Detail |
public static Element findOrCreate(java.net.URL url, Project project) throws java.lang.IllegalAccessException, java.lang.InstantiationException
Element
associated with the identifier
.
This method requests the ElementRecognizer
that recoginizes
the element identifier
to create or find the associated
element instance. It is left to the recognizer to decide whether
created elements should be cached. A recognizer that does not
cache newly created elements may return a new element instance
every time this method is called.
url
- unique url identifier.project
- the project within which the element should be created.
java.lang.IllegalAccessException
- if the Element
class or
its initializer is not accessible.
java.lang.InstantiationException
- if the Element
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 Recognizer findRecognizer(java.net.URL url)
Recognizer
that is able to specify
the Node
class that should be instantiated for the given
URL
. If no Recognizer
can determine the
Node
class, then null
is returned.
public static java.lang.Class recognize(java.net.URL url)
Recognizer
that is able to specify
the Element
class that should be instantiated for the given
url
. If no Recognizer
can determine
the Element
class, then null
is returned.
public static void addRecognizer(Recognizer recognizer)
ElementRecognizer
, appending it to the end
of the list of recognizers.
recognizer
- instance of a ElementRecognizer
implementation.public static void addRecognizer(int index, Recognizer recognizer)
Recognizer
, placing it in the
specified location in the list of recognizers. Specifying
a position less than or equal to 0 prepends this recognizer to the
list. A position value larger than (or equal to) the current list size
appends this recognizer to the end of the list. All other values
insert this recognizer somewhere in the middle of the list.
index
- the index into the list of recognizers
where this recognizer will be addedrecognizer
- instance of a Recognizer
implementation.public static void removeRecognizer(Recognizer recognizer)
Recognizer
.
recognizer
- instance of a Recognizer
implemenation.public static java.util.Iterator getRecognizers()
|
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.