Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.0.0)

E17493-01

oracle.ide.config
Class FileTypesRecognizer

java.lang.Object
  extended by oracle.ide.model.Recognizer
      extended by oracle.ide.config.FileTypesRecognizer

public final class FileTypesRecognizer
extends Recognizer

A Recognizer class for custom file type mappings that also provides extensions with consolidated information on file type registrations. Custom configured file types are returned or iterated by utility methods alongside registrations established through node-recognizer-hook and governed by Recognizer.

Since:
11.1.2.0.0 (Sherman)

Nested Class Summary
 
Nested classes/interfaces inherited from class oracle.ide.model.Recognizer
Recognizer.DeclarativeDocumentInfo
 
Constructor Summary
FileTypesRecognizer()
           
 
Method Summary
static java.util.Collection<java.io.File> allMappedExtensionsToNodes()
          Returns a Collection of all file extensions known to the IDE.
static java.lang.String getClassNameForExtension(java.lang.String extension)
          Return the class name that has been registered with the given extension or null if not has been registered.
static ContentType getContentTypeForExtension(java.lang.String extension)
          Returns the ContentType associated with the given extension.
static java.util.Set<java.lang.String> getNodeExtensions(java.lang.Class nodeClass)
          Returns an unmodifiable Set of String extensions for the given nodeClass matching as specified.
static java.util.Set<java.lang.String> getNodeExtensions(java.lang.Class[] nodeClasses)
          Returns an unmodifiable Set of String extensions for the given nodeClasses matching as specified.
static java.util.Set<java.lang.String> getNodeExtensions(java.lang.String nodeClass)
          Returns an unmodifiable Set of String extensions for the given nodeClass matching as specified.
static ContentType getNonNullContentTypeForExtension(java.lang.String extension)
          Returns the ContentType associated with the given extension.
static boolean isCustomMappedExtension(java.lang.String extension)
          Asks whether the given extension/node mapping is a custom (user) configured file type, as opposed to an IDE registered type.
static void mapCustomExtensionToClass(java.lang.String extension, java.lang.String nodeClassName)
          Maps the given extension, which is a file extension, to the given String which must be the classname of a Node class.
static void mapCustomExtensionToContentType(java.lang.String extension, ContentType contentType)
          Maps the given extension, which is a file extension, to the given ContentType.
 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 Node type.
 
Methods inherited from class oracle.ide.model.Recognizer
canConvert, create, findRecognizer, getClassForExtension, getDeclarativeExtensionToClassMap, getDeclarativeExtensionToContentTypeMap, getDefaultNodeType, getDefaultNodeTypeAsMeta, getDefaultRecognizer, getDocumentInfo, getDocumentInfo, getDocumentInfoForDeclarativeEntries, getExtensionToClassMap, getExtensionToContentTypeMap, getLogger, isXmlExtension, mapExtensionToClass, mapExtensionToContentType, mapExtensionToXML, recognizeAsMeta, recognizeURL, recognizeURL, recognizeURLAsMeta, recognizeURLAsMeta, registerConversion, registerDocumentInfo, registerLowPriorityRecognizer, registerRecognizer, registerRecognizer, sanitizeExtension, setDefaultRecognizer, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileTypesRecognizer

public FileTypesRecognizer()
Method Detail

allMappedExtensionsToNodes

public static final java.util.Collection<java.io.File> allMappedExtensionsToNodes()
Returns a Collection of all file extensions known to the IDE.

Returns:
the Collection of extensions each represented by a File for the purpose of comparison.

isCustomMappedExtension

public static final boolean isCustomMappedExtension(java.lang.String extension)
Asks whether the given extension/node mapping is a custom (user) configured file type, as opposed to an IDE registered type.

Parameters:
extension - the extension.
Returns:
a verdict on whether the extension is custom mapped.

mapCustomExtensionToClass

public static final void mapCustomExtensionToClass(java.lang.String extension,
                                                   java.lang.String nodeClassName)
Maps the given extension, which is a file extension, to the given String which must be the classname of a Node class. The resulting mapping is a custom configured file type mapping that will be persisted in IDE preferences.

Parameters:
extension - the extension to be mapped.
nodeClassName - the classname of the Node.

mapCustomExtensionToContentType

public static final void mapCustomExtensionToContentType(java.lang.String extension,
                                                         ContentType contentType)
Maps the given extension, which is a file extension, to the given ContentType. The resulting mapping is a custom configured content type mapping that will be persisted in IDE preferences.

Parameters:
extension - the extension to be mapped.
contentType - the ContentType.

getNodeExtensions

public static final java.util.Set<java.lang.String> getNodeExtensions(java.lang.Class[] nodeClasses)
Returns an unmodifiable Set of String extensions for the given nodeClasses matching as specified.

Parameters:
nodeClasses - The Node implementations to compare against
Returns:
an unmodifiable Set of String extensions for the given nodeClasses matching as specified

getNodeExtensions

public static final java.util.Set<java.lang.String> getNodeExtensions(java.lang.Class nodeClass)
Returns an unmodifiable Set of String extensions for the given nodeClass matching as specified.

Parameters:
nodeClass - The Node implementation to compare against
Returns:
an unmodifiable Set of String extensions for the given nodeClass matching as specified

getNodeExtensions

public static final java.util.Set<java.lang.String> getNodeExtensions(java.lang.String nodeClass)
Returns an unmodifiable Set of String extensions for the given nodeClass matching as specified.

Parameters:
nodeClass - The Node implementation to compare against
Returns:
an unmodifiable Set of String extensions for the given nodeClass matching as specified

getClassNameForExtension

public static final java.lang.String getClassNameForExtension(java.lang.String extension)
Return the class name that has been registered with the given extension or null if not has been registered.


getNonNullContentTypeForExtension

public static final ContentType getNonNullContentTypeForExtension(java.lang.String extension)
Returns the ContentType associated with the given extension. If no ContentType association has been registered, this method returns ContentType.TEXT.

Parameters:
extension - the extension.
Returns:
the associated ContentType.

getContentTypeForExtension

public static final ContentType getContentTypeForExtension(java.lang.String extension)
Returns the ContentType associated with the given extension. If no ContentType association has been registered, this method returns null.


recognize

public final java.lang.Class<? extends Node> recognize(java.net.URL url)
Description copied from class: Recognizer
This method implements the fundamental responsibility of a Recognizer -- to map a URL to a 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 Recognizer.create(URL,Class) method which creates the Node instance.

Overrides:
recognize in class Recognizer
Parameters:
url - unique URL identifying the document.
Returns:
the Node type as a Class object.

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK
11g Release 2 (11.1.2.0.0)

E17493-01

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