public class JavaModelFactory
extends java.lang.Object
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.
Modifier and Type | Field and Description |
---|---|
protected ClassLocatorFactory |
locatorFactory
The locator factory.
|
Modifier | Constructor and Description |
---|---|
protected |
JavaModelFactory() |
Modifier and Type | Method and Description |
---|---|
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.
|
CachedFileProvider |
newFileProvider(URLPath sourcepath,
URLPath classpath)
Create a CachedFileProvider for the given source and class paths.
|
CachedFileProvider |
newFileProvider(URLPath sourcepath,
URLPath classpath,
URLPath modulepath)
Deprecated.
Use
newFileProvider(URLPath, URLPath) instead.
There is no need for a separate module path in a FileProvider since
classes are looked up in a combined class and module path. |
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.
|
JavaModel |
newInstance(URLPath sourcepath,
URLPath classpath,
URLPath modulepath)
Deprecated.
Use
newInstance(URLPath, URLPath) instead.
There is no need for a separate module path in a JavaModel since
classes are looked up in a combined class and module path. |
protected ClassLocatorFactory |
newLocatorFactory()
Creates a new locator factory.
|
static void |
setInstance(JavaModelFactory factory)
Sets the JavaModelFactory instance to use for creating new
JavaModel instances.
|
protected ClassLocatorFactory locatorFactory
public static JavaModelFactory getInstance()
public static void setInstance(JavaModelFactory factory)
factory
- Must be non-null.public final JavaModel newInstance(URLPath sourcepath, URLPath classpath)
sourcepath
- A source path used to locate sourcesclasspath
- A class path used to locate classesjava.lang.IllegalArgumentException
- if sourcepath and classpath are both null@Deprecated public final JavaModel newInstance(URLPath sourcepath, URLPath classpath, URLPath modulepath)
newInstance(URLPath, URLPath)
instead.
There is no need for a separate module path in a JavaModel since
classes are looked up in a combined class and module path.public final CachedFileProvider newFileProvider(URLPath sourcepath, URLPath classpath)
sourcepath
- A source path used to locate sourcesclasspath
- A class path used to locate classesjava.lang.IllegalArgumentException
- if sourcepath and classpath are both nullpublic final CachedFileProvider newFileProvider(URLPath sourcepath, URLPath classpath, URLPath modulepath)
newFileProvider(URLPath, URLPath)
instead.
There is no need for a separate module path in a FileProvider since
classes are looked up in a combined class and module path.protected JavaModel newInstance(CachedFileProvider provider)
Subclasses should override this if they want to create a JavaModel that is different from the default implementation.
public final ClassLocatorFactory getLocatorFactory()
protected ClassLocatorFactory newLocatorFactory()
Subclasses should override this if they want to create a ClassLocatorFactory that is different from the default implementation.
public final ProviderContext newContext()
protected ProviderContext newContextImpl()
Subclasses should override this if they want to create a ProviderEnvironment that is different from the default implementation.