Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-03

oracle.jdeveloper.java
Class JavaModelFactory

java.lang.Object
  extended by oracle.jdeveloper.java.JavaModelFactory
Direct Known Subclasses:
JdevJavaModelFactory

public class JavaModelFactory
extends java.lang.Object

Defines the interface for creating new environments and locator factories. The default factory creates base implementations. Subclasses should override to be create more complex implementations.

To plug in a new context or new locator factory, make a subclass of JavaModelFactory and then use setInstance(oracle.jdeveloper.java.JavaModelFactory)to set the factory instance used to create new JavaModels.


Field Summary
protected  ClassLocatorFactory locatorFactory
          The locator factory.
 
Constructor Summary
protected JavaModelFactory()
           
 
Method Summary
static JavaModelFactory getInstance()
          Gets the JavaModelFactory.
 ClassLocatorFactory getLocatorFactory()
          Gets the factory we'll use to create new class locators with.
 ProviderContext newContext()
          Creates a new context for the provider.
protected  ProviderContext newContextImpl()
          Creates a new context for the provider.
protected  JavaModel newInstance(CachedFileProvider provider)
          Creates a new JavaModel instance with the given provider.
 JavaModel newInstance(URLPath sourcepath, URLPath classpath)
          Creates a new JavaModel instance for the given arguments.
protected  ClassLocatorFactory newLocatorFactory()
          Creates a new locator factory.
static void setInstance(JavaModelFactory factory)
          Sets the JavaModelFactory instance to use for creating new JavaModel instances.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

locatorFactory

protected ClassLocatorFactory locatorFactory
The locator factory.

Constructor Detail

JavaModelFactory

protected JavaModelFactory()
Method Detail

getInstance

public static JavaModelFactory getInstance()
Gets the JavaModelFactory.

Returns:
Always non-null.

setInstance

public static void setInstance(JavaModelFactory factory)
Sets the JavaModelFactory instance to use for creating new JavaModel instances.

Parameters:
factory - Must be non-null.

newInstance

public final JavaModel newInstance(URLPath sourcepath,
                                   URLPath classpath)
Creates a new JavaModel instance for the given arguments.

Throws:
java.lang.IllegalArgumentException - if both sourcepath and classpath are null.

newInstance

protected JavaModel newInstance(CachedFileProvider provider)
Creates a new JavaModel instance with the given provider.

Subclasses should override this if they want to create a JavaModel that is different from the default implementation.

Returns:
A new ProviderEnvironment. Always non-null.

getLocatorFactory

public final ClassLocatorFactory getLocatorFactory()
Gets the factory we'll use to create new class locators with.

Returns:
Always non-null.

newLocatorFactory

protected ClassLocatorFactory newLocatorFactory()
Creates a new locator factory.

Subclasses should override this if they want to create a ClassLocatorFactory that is different from the default implementation.

Returns:
A new ProviderEnvironment. Always non-null.

newContext

public final ProviderContext newContext()
Creates a new context for the provider.

Returns:
A new ProviderEnvironment. Always non-null.

newContextImpl

protected ProviderContext newContextImpl()
Creates a new context for the provider.

Subclasses should override this if they want to create a ProviderEnvironment that is different from the default implementation.

Returns:
A new ProviderEnvironment. Always non-null.

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-03

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