Extension SDK 10.1.2

oracle.ide.net
Class URLRecognizer

java.lang.Object
  extended byoracle.ide.model.DefaultRecognizer
      extended byoracle.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.


Constructor Summary
URLRecognizer()
          Constructor.
 
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 oracle.ide.model.DefaultRecognizer
canConvert, clearExtensionToClassMap, create, getDocumentInfo, getValidConversions, registerConversion, registerDocumentInfo, sanitizeExtension, sanitizeExtensionAsString, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URLRecognizer

public URLRecognizer()
Constructor.

Method Detail

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.

Specified by:
recognize in interface Recognizer
Overrides:
recognize in class DefaultRecognizer

getExtensionToClassMap

public java.util.Map getExtensionToClassMap()
Overrides:
getExtensionToClassMap in class DefaultRecognizer
Returns:
An unsynchronized Map that should be synchronized upon when used.

Extension SDK

 

Copyright © 1997, 2004, Oracle. All rights reserved.