public abstract class Recognizer
extends java.lang.Object
mapExtensionToClass(String,Class).
  To configure the XML recognizer to map an XML document type to a Node
  type, see XMLRecognizer.  There are methods in XMLRecognizer for
  recognizing based on the doctype declaration, the root element name
  (with or without namespace URI), and schema instance URI.
If the mapping of a URL to a Node type is more complex than what the IDE provides by default, there is an API for registering custom Recognizer implementations via one of the following methods:
registerRecognizer(String,Recognizer)
    registerRecognizer(String[],Recognizer)
    registerLowPriorityRecognizer(Recognizer)
  registerLowPriorityRecognizer(Recognizer),
  the custom Recognizer is not evaluated until after the IDE's built-in
  XML and URL recognizers.
  When none of the custom, XML, or URL recognizers is able to map a URL
  to a Node type, the IDE may make a final attempt to recognize the URL
  based on byte signatures.  If that fails, then the URL is mapped to
  UnrecognizedTextNode.
registerConversion(Class,Class) for details.| Modifier and Type | Class and Description | 
|---|---|
| static class  | Recognizer.DeclarativeDocumentInfo | 
| Constructor and Description | 
|---|
| Recognizer() | 
| Modifier and Type | Method and Description | 
|---|---|
| boolean | canConvert(java.net.URL oldURL,
          java.net.URL newURL)Check if the old  URLcan be converted to the newURL. | 
| Node | create(java.net.URL url,
      java.lang.Class nodeType)This method creates a  Nodeinstance of the specified
  type with the specifiedURL. | 
| static Recognizer | findRecognizer(java.net.URL url)Returns the instance of  Recognizerthat is able to specify
  theNodeclass that should be instantiated for the givenURL. | 
| static java.lang.Class | getClassForExtension(java.lang.String extension)Deprecated. 
 | 
| static ContentType | getContentTypeForExtension(java.lang.String extension)Deprecated. 
 | 
| static java.util.Map<java.io.File,MetaClass<?>> | getDeclarativeExtensionToClassMap() | 
| static java.util.Map<java.io.File,ContentType> | getDeclarativeExtensionToContentTypeMap() | 
| static java.lang.Class<? extends Node> | getDefaultNodeType()Returns the Node class that will be recognized when no  Recognizerrecognizes a givenURL. | 
| static MetaClass<? extends Node> | getDefaultNodeTypeAsMeta()Returns the Node meta class that will be recognized when no  Recognizerrecognizes a givenURLand when the calling code queries recognizer 
  through metaclasses. | 
| static Recognizer | getDefaultRecognizer()Returns the default Recognizer. | 
| static DocumentInfo | getDocumentInfo(java.lang.Class nodeClass) | 
| static DocumentInfo | getDocumentInfo(java.lang.String nodeClassName) | 
| static DocumentInfo | getDocumentInfoForDeclarativeEntries(java.lang.String nodeClassName) | 
| static java.util.Map | getExtensionToClassMap()Deprecated. 
 Causes excessive extension loading to occur.  Use
    getExtensionToMetaClassMap()instead. | 
| static java.util.Map | getExtensionToContentTypeMap() | 
| static java.util.Map<java.io.File,MetaClass> | getExtensionToMetaClassMap()Get the mapping from file extension to meta class. | 
| protected static java.util.logging.Logger | getLogger() | 
| static boolean | isXmlExtension(java.lang.String extension)Asks whether the given extension is registered to be handled by the IDE's
 built-in XML recognizer. | 
| static void | mapExtensionToClass(java.lang.String extension,
                   java.lang.Class cls)Deprecated. 
 replaced by declarative registration through a node-recognizers-hook/url-recognizer/file-extension trigger hook. | 
| static void | mapExtensionToContentType(java.lang.String extension,
                         ContentType contentType)Deprecated. 
 replaced by declarative registration through a node-recognizers-hook/url-recognizer/extension-to-content-type trigger hook. | 
| static void | mapExtensionToMetaClass(java.lang.String extension,
                       MetaClass cls)Maps a file extension to a  Nodeclass. | 
| static void | mapExtensionToXML(java.lang.String extension)Registers the specified extension to be handled by the IDE's
  built-in XML recognizer. | 
| java.lang.Class<? extends Node> | recognize(java.net.URL url)This method implements the fundamental responsibility of a
  Recognizer -- to map a URL to a  Nodetype. | 
| MetaClass<? extends Node> | recognizeAsMeta(java.net.URL url)This method allows gets the MetaClass of a recognized  Node. | 
| static java.lang.Class<? extends Node> | recognizeURL(java.net.URL url) | 
| static java.lang.Class<? extends Node> | recognizeURL(java.net.URL url,
            java.lang.Class<? extends Node> defaultNodeType) | 
| static MetaClass<? extends Node> | recognizeURLAsMeta(java.net.URL url) | 
| static MetaClass<? extends Node> | recognizeURLAsMeta(java.net.URL url,
                  MetaClass<? extends Node> defaultNodeType) | 
| static void | registerConversion(java.lang.Class<? extends Node> oldNodeType,
                  java.lang.Class<? extends Node> newNodeType)Registers a conversion between  Nodeclasses that is to be
  considered valid. | 
| static void | registerDocumentInfo(java.lang.Class nodeClass,
                    DocumentInfo info)Deprecated. 
 replaced by declarative registration through a node-recognizers-hook/document-infos/document-info trigger hook. | 
| static void | registerLowPriorityRecognizer(Recognizer recognizer)This method allows a Recognizer to be registered without an
  associated file extension. | 
| static void | registerRecognizer(java.lang.String[] fileExtensions,
                  Recognizer recognizer)Registers the specified file extensions so that an URL that ends with
  one of the specified extensions is recognized using the specified
  Recognizer, so long as no earlier Recognizer has already recognized
  the URL. | 
| static void | registerRecognizer(java.lang.String fileExtension,
                  Recognizer recognizer)Registers the specified file extension so that an URL that ends with
  it is recognized using the specified Recognizer, so long as no
  earlier Recognizer has already recognized the URL. | 
| static java.io.File | sanitizeExtension(java.lang.String extension)Makes sure that the  extensionbegins with a '.'. | 
| static void | setDefaultRecognizer(Recognizer recognizer)Sets the default Recognizer. | 
| java.net.URL | validate(java.net.URL newURL,
        java.net.URL oldURL)Validate the specified new name. | 
public java.lang.Class<? extends Node> recognize(java.net.URL url)
Node type.  Efficient
  implementation of this method is essential for the IDE's
  performance.  In particular, I/O operations should be avoided or
  deferred as much as possible.  If a Recognizer does not recognize
  a particular URL, this method must return null.  The
  returned Class representing the Node type is later passed to the
  create(URL,Class) method which creates the Node
  instance.url - unique URL identifying the document.Node type as a Class object.public MetaClass<? extends Node> recognizeAsMeta(java.net.URL url)
Node.
 This is useful for cases in which the classloader of a metaclass is not the 
 same as the real classloader of the node class. It may also be useful, 
 for cases when we need to get the MetaClass of a recognized node without 
 initializing the node extensions.public Node create(java.net.URL url, java.lang.Class nodeType) throws java.lang.IllegalAccessException, java.lang.InstantiationException
Node instance of the specified
  type with the specified URL.  If the type is
  null, then the returned Node is also
  null.url - unique URL identifying the document.nodeType - the type of the Node.  The specified
  Class object must represent a type of Node, or else
  a ClassCastException will occur.Node.java.lang.IllegalAccessExceptionjava.lang.InstantiationExceptionpublic java.net.URL validate(java.net.URL newURL,
                             java.net.URL oldURL)
                      throws RecognizerException
null if the
  name does not validate.  This method may modify the URL to
  make it valid, such as adding a file extension.  The old
  URL is used as the validation base.  For example, if the
  new URL does not have the correct file extension, the old
  URL extension may be added to the new URL during
  the validation process.newURL - the new URL to validate.oldURL - the old URL used as the validation base.URL or null if the
  name does not validate.RecognizerException - if validation fails.  The reason
  why validation failed is in the exception's message.  The message
  should be suitably formatted so that it can be displayed to the
  user.public boolean canConvert(java.net.URL oldURL,
                          java.net.URL newURL)
URL can be converted to the new
  URL.  This method is called on the new URL's
  Recognizer.  It is called when a Node is being
  renamed and the new name causes a Node type conversion.
  If the call to canConvert(URL, URL) returns
  true, the Node conversion will go through,
  otherwise, it will not.
  The base implementation looks at the two URLs to see what the
  corresponding Node class will be.  If the conversion is compatible,
  then it is allowed.  Compatibility is tested by checking the
  Node class types that have been registered through
  registerConversion(Class, Class).  If a mapping from the
  oldURL's recognized Node class can be found
  to the newURL's recognized Node class, then
  this method returns true.  Otherwise, this method
  returns false.
  Of course, if the Node class for the oldURL
  and the newURL are identical, then conversion is
  allowed.
oldURL - the url of the node being renamed.newURL - the new url for the node.@Deprecated
public static void mapExtensionToClass(java.lang.String extension,
                                                   java.lang.Class cls)
extension, which is a file extension,
  to the given Class which must be a Node class.
  Addins that extend this class must provide their own
  static implementation of this method. Using the default implementation
  for any other purpose than to map extension defined by end users
  to registered node types will break current IDE behavior. In other
  words, this method is only for internal IDE purposes.
  The extension passed in is allowed to contain
  or omit the leading "."; if it is omitted, it will be added
  automatically.
public static void mapExtensionToMetaClass(java.lang.String extension,
                                           MetaClass cls)
Node class.  Extensions should
 typically use the node-recognizers-hook, url-recognizer, and
 file-extension hooks instead of this method.  This method is for
 special cases where an a file extension class is registered from
 another extension.extension - the file extensioncls - the meta class for the Node classpublic static void mapExtensionToXML(java.lang.String extension)
public static void registerRecognizer(java.lang.String fileExtension,
                                      Recognizer recognizer)
fileExtension - The file extension to recognize.  The extension
  may or may not begin with '.' but an extension is presumed to follow
  a '.' in the URL.  So, for example, calling
  registerRecognizer("txt", MyRecognizer); will cause
  "file:/C:/readme.txt" to be recognized by MyRecognizer,
  but not "file:/C:/readmetxt".recognizer - The Recognizer that handles the recognition of a
  URL with the specified file extension.public static void registerRecognizer(java.lang.String[] fileExtensions,
                                      Recognizer recognizer)
fileExtensions - The file extensions to recognize.  The extensions
  may or may not begin with '.' but an extension is presumed to follow
  a '.' in the URL.  So, for example, calling
  registerRecognizer(new String[]{"txt"}, MyRecognizer); will cause
  "file:/C:/readme.txt" to be recognized by MyRecognizer,
  but not "file:/C:/readmetxt".recognizer - The Recognizer that handles the recognition of a
  URL with the specified file extension.public static void registerLowPriorityRecognizer(Recognizer recognizer)
registerRecognizer(String,Recognizer) or
  registerRecognizer(String[],Recognizer).recognizer - The low-priority Recognizer to register.public static Recognizer getDefaultRecognizer()
public static void setDefaultRecognizer(Recognizer recognizer)
public static java.lang.Class<? extends Node> getDefaultNodeType()
Recognizer
  recognizes a given URL.public static MetaClass<? extends Node> getDefaultNodeTypeAsMeta()
Recognizer
  recognizes a given URL and when the calling code queries recognizer 
  through metaclasses.public static boolean isXmlExtension(java.lang.String extension)
extension - the extension.public static final void registerConversion(java.lang.Class<? extends Node> oldNodeType, java.lang.Class<? extends Node> newNodeType)
Node classes that is to be
  considered valid.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<? extends Node> recognizeURL(java.net.URL url)
Class of the Node that should be
  instantiated for the specified url.  If no
  Recognizer can determine the Node class, then
  the value of getDefaultNodeType() is returned.public static MetaClass<? extends Node> recognizeURLAsMeta(java.net.URL url)
MetaClass of the Node that should be
  instantiated for the specified url.  If no
  Recognizer can determine the Node class, then
  the value of getDefaultNodeTypeAsMeta() is returned.public static java.lang.Class<? extends Node> recognizeURL(java.net.URL url, java.lang.Class<? extends Node> defaultNodeType)
public static MetaClass<? extends Node> recognizeURLAsMeta(java.net.URL url, MetaClass<? extends Node> defaultNodeType)
@Deprecated public static final java.util.Map getExtensionToClassMap()
getExtensionToMetaClassMap() instead.public static final java.util.Map<java.io.File,MetaClass> getExtensionToMetaClassMap()
public static final java.util.Map<java.io.File,MetaClass<?>> getDeclarativeExtensionToClassMap()
public static final java.util.Map getExtensionToContentTypeMap()
public static final java.util.Map<java.io.File,ContentType> getDeclarativeExtensionToContentTypeMap()
public static final DocumentInfo getDocumentInfo(java.lang.Class nodeClass)
public static final DocumentInfo getDocumentInfo(java.lang.String nodeClassName)
public static final DocumentInfo getDocumentInfoForDeclarativeEntries(java.lang.String nodeClassName)
@Deprecated public static final java.lang.Class getClassForExtension(java.lang.String extension)
FileTypesRecognizer.getClassNameForExtension(java.lang.String).@Deprecated public static ContentType getContentTypeForExtension(java.lang.String extension)
FileTypesRecognizer.getContentTypeForExtension(String).ContentType associated with the given extension.
 If no ContentType association has been registered, this method returns
 null.@Deprecated
public static final void mapExtensionToContentType(java.lang.String extension,
                                                               ContentType contentType)
extension, which is a file extension,
  to the given ContentType.@Deprecated
public static final void registerDocumentInfo(java.lang.Class nodeClass,
                                                          DocumentInfo info)
public static final java.io.File sanitizeExtension(java.lang.String extension)
extension begins with a '.'.  If
  it does, the extension is just returned as-is.  If it
  doesn't, one is prepended to the extension, and the
  result is returned.
  The extension is returned as a File to make the extension
  follow the case-sensitivity rules of the local file system.protected static java.util.logging.Logger getLogger()