javax.tools.diagnostics.image
Interface ImageFactory


public interface ImageFactory

This interface is used for classes which can produce instances of Image implementors.

Note that this interface forms the contract between the FactoryRegistry and an implementation. The methods on this interface are only intended to be called by the FactoryRegistry


Field Summary
static int MAJOR_VERSION
           The major version number of the current API.
static int MINOR_VERSION
           The minor version number of the current API = ImageFactory.MINOR_VERSION)
 
Method Summary
 Image getImage(java.io.File imageFile)
           Creates a new Image object based on the contents of imageFile.
 Image getImage(java.io.File imageFile, java.io.File metadata)
           Creates a new Image object based on the contents of imageFile and metadata
 JavaRuntime getJavaRuntime(java.io.File file)
           Creates a new JavaRuntime object based on the contents of the file;
 int getMajorVersion()
           Fetch the major version number
 int getMinorVersion()
           Fetch the minor version number
 int getModificationLevel()
           Fetch the modification level
 java.lang.String[] getValidFileExtensions()
           Returns an array of file extensions that the FactoryRegistry can use to determine if an file can be processed by this Image Factory implementation.
 

Field Detail

MAJOR_VERSION

static final int MAJOR_VERSION

The major version number of the current API.

Note that this value will be inlined so users can reference it directly (ie: factory.getMajorVersion() >= ImageFactory.MAJOR_VERSION)

See Also:
Constant Field Values

MINOR_VERSION

static final int MINOR_VERSION

The minor version number of the current API = ImageFactory.MINOR_VERSION)

See Also:
Constant Field Values
Method Detail

getImage

Image getImage(java.io.File imageFile)
               throws java.io.IOException

Creates a new Image object based on the contents of imageFile.

Note that this method is only intended to be called by the FactoryRegistry

Parameters:
imageFile - a file with Image information, typically a core file
Returns:
an instance of Image
Throws:
java.io.IOException - if unable to create an image from the provided file

getImage

Image getImage(java.io.File imageFile,
               java.io.File metadata)
               throws java.io.IOException

Creates a new Image object based on the contents of imageFile and metadata

Note that this method is only intended to be called by the FactoryRegistry

Parameters:
imageFile - a file with Image information, typically a core file
metadata - a file with additional Image information. This is an implementation defined file
Returns:
an instance of Image
Throws:
java.io.IOException - if unable to create an image from the provided file

getMajorVersion

int getMajorVersion()

Fetch the major version number

Returns:
An integer corresponding to the API major version number

getMinorVersion

int getMinorVersion()

Fetch the minor version number

Returns:
An integer corresponding to the API minor version number

getModificationLevel

int getModificationLevel()

Fetch the modification level

Returns:
An integer corresponding to the API modification level

getValidFileExtensions

java.lang.String[] getValidFileExtensions()

Returns an array of file extensions that the FactoryRegistry can use to determine if an file can be processed by this Image Factory implementation.

File extensions are the part of a file name after the last '.'.

The returned array is treated as a case insensitive collection of file extensions.

The returned array is expected to contain at least one entry.

Note that this method is only intended to be called by the FactoryRegistry

Returns:
an array of case insensitive file extension names.

getJavaRuntime

JavaRuntime getJavaRuntime(java.io.File file)
                           throws java.io.IOException

Creates a new JavaRuntime object based on the contents of the file;

Note that this method is only intended to be called by the FactoryRegistry

Parameters:
file - a file with JavaRuntime information
Returns:
an instance of JavaRuntime
Throws:
java.io.IOException - if unable to create a runtime from the provided file


Copyright © 2010. All Rights Reserved.