oracle.ide.net
Class URLRecognizer
java.lang.Object
|
+--oracle.ide.model.DefaultRecognizer
|
+--oracle.ide.net.URLRecognizer
- All Implemented Interfaces:
- Recognizer
- public final class URLRecognizer
- extends DefaultRecognizer
The URLRecognizer
is the default Recognizer
implementation used in the IDE. It contains support for recognizing
an URL
based on its protocol, extension, or XML root
element name. When an URL
is recognized, the appropriate
Node
class for the URL
can be determined.
Method Summary |
static java.lang.Class |
getClassForExtension(java.lang.String extension)
Return the class that has been registered with the given extension
or null if not has been registered. |
java.util.Map |
getExtensionToClassMap()
|
static void |
mapExtensionToClass(java.lang.String extension,
java.lang.Class cls)
Maps the given extension , which is a file extension,
to the given Class which must be a
Node class. |
static void |
mapProtocolToClass(java.lang.String protocol,
java.lang.Class cls)
Maps the given protocol to the given Class ,
which must be a Node class. |
java.lang.Class |
recognize(java.net.URL url)
Gets the Class of the data item associated with the
specified URL . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
URLRecognizer
public URLRecognizer()
- Constructor.
mapProtocolToClass
public static void mapProtocolToClass(java.lang.String protocol,
java.lang.Class cls)
- Maps the given
protocol
to the given Class
,
which must be a Node
class. The protocol should not
include the trailing ":" character.
mapExtensionToClass
public static void mapExtensionToClass(java.lang.String extension,
java.lang.Class cls)
- Maps the given
extension
, which is a file extension,
to the given Class
which must be a
Node
class.
The extension
passed in is allowed to contain
or omit the leading "."; if it is omitted, it will be added
automatically.
getClassForExtension
public static java.lang.Class getClassForExtension(java.lang.String extension)
- Return the class that has been registered with the given extension
or null if not has been registered.
recognize
public java.lang.Class recognize(java.net.URL url)
- Description copied from interface:
Recognizer
- Gets the
Class
of the data item associated with the
specified URL
. Implementations must return
null
if the URL
is not recognized. The
Class
returned must be the data model class. This
value is passed to the Recognizer.create(URL, Class)
method
which will create the design-time node.
- Overrides:
recognize
in class DefaultRecognizer
- Following copied from interface:
oracle.ide.model.Recognizer
- Parameters:
url
- unique URL
identifying the document.- Returns:
- the data
Class
.
getExtensionToClassMap
public java.util.Map getExtensionToClassMap()
- Overrides:
getExtensionToClassMap
in class DefaultRecognizer