|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.emf.common.notify.impl.SingletonAdapterImpl org.eclipse.emf.codegen.ecore.generator.AbstractGeneratorAdapter
public abstract class AbstractGeneratorAdapter
A base GeneratorAdapter
implementation. This base provides support for
JET-based
generation of Java and other text artifacts, as well as
GIFEmitter-based
colourization of icons, via the following methods:
generateJava(String, String, String, JETEmitter, Object[], Monitor)
for generating Java code, with
import management
,
merging
, and
code formatting
capabilities.
generateProperties(String, JETEmitter, Object[], Monitor)
for generating property files, with
merging
capability.
generateText(String, JETEmitter, Object[], boolean, String, Monitor)
for generating other text
artifacts.
generateGIF()
for generating icons by
colourizing grey-scale images.
Code generation is supported in the Eclipse IDE or stand-alone. However, merging and formatting of Java code are not available in the latter scenario.
At a minimum, subclasses must implement canGenerate(Object, Object)
, to determine whether code can be
generated for an object, and doGenerate()
, to actually generate code
for it.
They may also override getCanGenerateChildren(Object, Object)
,
getCanGenerateParent(Object, Object)
, getGenerateChildren(Object, Object)
, and
getGenerateParent(Object, Object)
, to involve more objects these operations, as well as
doPreGenerate(Object, Object)
and doPostGenerate(Object, Object)
, to perform setup and cleanup
before and after code generation.
This class is designed to support singleton generator adapters, where a single adapter instance can be attached
to multiple objects of the same type. State relevant to a single object is only cached during a call to
preGenerate(Object, Object)
, generate(Object, Object, Monitor)
, or
postGenerate(Object, Object)
.
Nested Class Summary | |
---|---|
protected static class |
AbstractGeneratorAdapter.JETEmitterDescriptor
The information required to construct and initialize a JETEmitter ,
namely the file name of the template (relative to the template path) and the qualified name of the template class. |
Nested classes/interfaces inherited from interface org.eclipse.emf.common.notify.Adapter |
---|
Adapter.Internal |
Field Summary | |
---|---|
protected GeneratorAdapterFactory |
adapterFactory
|
protected java.lang.Object |
generatingObject
The object for which this adapter is currently being used to generate code. |
protected GIFEmitter[] |
gifEmitters
All the GIFEmitter s used by this adapter. |
protected ImportManager |
importManager
The ImportManager currently being used in generating Java code. |
protected JETEmitter[] |
jetEmitters
All the JETEmitter s used by this adapter. |
protected java.lang.String |
lineDelimiter
The line delimiter currently being used in generating textual results. |
protected static java.lang.String |
MANIFEST_ENCODING
|
protected java.lang.String |
message
The message describing what is being done. |
protected static java.lang.Class<?>[] |
OBJECT_ARGUMENT
|
protected static java.lang.String |
PROPERTIES_ENCODING
|
protected URIConverter |
uriConverter
An appropriate URIConverter for use during code generation. |
Fields inherited from class org.eclipse.emf.common.notify.impl.SingletonAdapterImpl |
---|
targets |
Constructor Summary | |
---|---|
AbstractGeneratorAdapter()
If this default constructor is used, the setAdapterFactory()
method must be called immediately to set the generator adapter factory that created this adapter. |
|
AbstractGeneratorAdapter(GeneratorAdapterFactory adapterFactory)
|
Method Summary | |
---|---|
protected void |
addBaseTemplatePathEntries(java.util.List<java.lang.String> templatePath)
Adds template locations to the base portion of the dynamic template path, an ordered list of URIs corresponding to locations under which to find templates. |
protected void |
addClasspathEntries(JETEmitter jetEmitter)
Override this to add classpath variables
to the JETEmitter. |
abstract boolean |
canGenerate(java.lang.Object object,
java.lang.Object projectType)
Returns whether code of the given object type can be generated for the specified object. |
protected void |
clearImportManager()
Clears the cached ImportManager . |
protected java.lang.Object |
createCodeFormatter(java.util.Map<?,?> options,
URI workspacePath)
When running under Eclipse, returns a code formatter; when stand-alone, returns null. |
protected GIFEmitter |
createGIFEmitter(java.lang.String inputPathName)
Creates a GIFEmitter based on the image at the give template-path-relative file name. |
protected void |
createImportManager(java.lang.String packageName,
java.lang.String className)
Creates and caches an ImportManager for use in generating Java
code. |
protected java.io.InputStream |
createInputStream(URI workspacePath)
Creates an InputStream for the file identified by the given workspace path URI. |
protected JETEmitter |
createJETEmitter(AbstractGeneratorAdapter.JETEmitterDescriptor jetEmitterDescriptor)
Creates and initializes a JETEmitter according to the given descriptor. |
protected Monitor |
createMonitor(Monitor monitor,
int ticks)
Creates and returns a sub-monitor for the given progress monitor. |
protected java.io.OutputStream |
createOutputStream(URI workspacePath)
Creates an OutputStream for the file identified by the given workspace path URI. |
protected abstract Diagnostic |
doGenerate(java.lang.Object object,
java.lang.Object projectType,
Monitor monitor)
Implement this to perform code generation of the given project type for the specified object. |
protected Diagnostic |
doPostGenerate(java.lang.Object object,
java.lang.Object projectType)
Does nothing and returns OK . |
protected Diagnostic |
doPreGenerate(java.lang.Object object,
java.lang.Object projectType)
Does nothing and returns OK . |
protected void |
ensureContainerExists(URI workspacePath,
Monitor monitor)
Ensures that a container corresponding to the specified relative URI exists. |
protected void |
ensureProjectExists(java.lang.String workspacePath,
java.lang.Object object,
java.lang.Object projectType,
boolean force,
Monitor monitor)
Ensures that a project, corresponding to the first segment in the specified workspace path, exists. |
protected boolean |
exists(URI workspacePath)
Determines whether a given workspace path URI represents a file that already exists. |
protected java.lang.String |
formatCode(java.lang.String contents,
java.lang.Object codeFormatter)
If non-null, use the specified code formatter to format the given compilation unit contents. |
Diagnostic |
generate(java.lang.Object object,
java.lang.Object projectType,
Monitor monitor)
If code can be generated for the object, as determined by canGenerate(Object, Object) , delegates code
generation to doGenerate(Object, Object, Monitor) . |
protected void |
generateGIF(java.lang.String targetPathName,
GIFEmitter gifEmitter,
java.lang.String parentKey,
java.lang.String childKey,
boolean overwrite,
Monitor monitor)
Generates an icon using a GIFEmitter to colourize a grey-scale GIF
image. |
protected void |
generateJava(java.lang.String targetPath,
java.lang.String packageName,
java.lang.String className,
JETEmitter jetEmitter,
java.lang.Object[] arguments,
Monitor monitor)
Generates a Java source file using JET, with import management
and, when running under Eclipse, merging and
code formatting capabilities. |
protected void |
generateProperties(java.lang.String targetPathName,
JETEmitter jetEmitter,
java.lang.Object[] arguments,
Monitor monitor)
Generates a properties file using JET, with merging
capability. |
protected void |
generateText(java.lang.String targetPathName,
JETEmitter jetEmitter,
java.lang.Object[] arguments,
boolean overwrite,
java.lang.String encoding,
Monitor monitor)
Generates an arbitrary text artifact using JET. |
GeneratorAdapterFactory |
getAdapterFactory()
Returns the adapter factory that created this adapter. |
java.util.Collection<?> |
getCanGenerateChildren(java.lang.Object object,
java.lang.Object projectType)
Returns an empty collection, indicating that by default no children are involved in determining whether code can be generated for an object. |
java.lang.Object |
getCanGenerateParent(java.lang.Object object,
java.lang.Object projectType)
Returns null, indicating that by default no parent is involved in determining whether code can be generated for an object. |
protected java.lang.String |
getContents(URI workspacePath,
java.lang.String encoding)
Returns the contents of the file identified by the given workspace path URI, as read using the specified encoding. |
protected java.lang.String |
getEncoding(URI workspacePath)
When running under Eclipse, queries the workspace to determine the correct encoding for the file identified by the given workspace path URI. |
java.util.Collection<?> |
getGenerateChildren(java.lang.Object object,
java.lang.Object projectType)
Returns an empty collection, indicating that by default there are no children of an object for which code should be generated. |
java.lang.Object |
getGenerateParent(java.lang.Object object,
java.lang.Object projectType)
Returns null, indicating that by default there is no parent of an object for which could should be generated. |
protected Generator |
getGenerator()
Returns the generator for this adapter's factory. |
protected GIFEmitter |
getGIFEmitter(java.lang.String[] inputPathNames,
int id)
Returns the GIFEmitter for the input path name at the index specified by id in the given
array. |
protected ImportManager |
getImportManager()
Returns the ImportManager that is currently in use for
generating Java code, or null if there is none. |
protected JETEmitter |
getJETEmitter(AbstractGeneratorAdapter.JETEmitterDescriptor[] jetEmitterDescriptors,
int id)
Returns the JETEmitter for the JETEmitterDescriptor at the index specified by
id in the given array. |
protected java.lang.String |
getLineDelimiter()
Returns the current line delimiter used for generating textual results. |
java.lang.String |
getLineDelimiter(URI workspacePath,
java.lang.String encoding)
|
protected URIConverter |
getURIConverter()
Returns an appropriate URIConverter for use during code generation. |
protected java.util.List<java.lang.String> |
getUserTemplatePath()
Returns the user-specified portion of the dynamic template path, an ordered list of URIs corresponding to locations under which to find templates. |
boolean |
isAdapterForType(java.lang.Object type)
Returns true when the type is this adapter's factory . |
protected boolean |
isReadOnly(URI workspacePath)
Determines whether a given workspace path URI represents a read-only file. |
Diagnostic |
postGenerate(java.lang.Object object,
java.lang.Object projectType)
Caches the object as generatingObject , calls doPostGenerate(Object, Object) , and clears it again. |
Diagnostic |
preGenerate(java.lang.Object object,
java.lang.Object projectType)
Caches the object as generatingObject , calls doPreGenerate(Object, Object) , and clears it again. |
void |
setAdapterFactory(GeneratorAdapterFactory adapterFactory)
Sets the adapter factory that created this adapter. |
protected void |
setLineDelimiter(java.lang.String lineDelimiter)
Sets the current line delimiter used for generating textual results. |
protected void |
setStaticTemplateClass(JETEmitter jetEmitter,
java.lang.String className)
If dynamic templates are not being used, attempts to set the emitter to
use an existing, precompiled template class. |
protected void |
setWriteable(URI workspacePath)
Sets the file represented by a workspace path URI to be writable. |
protected Diagnostic |
toDiagnostic(java.lang.Exception exception,
java.lang.String currentMessage)
Converts the given exception to a Diagnostic . |
protected URI |
toPlatformResourceURI(URI uri)
Converts the given workspace path URI to an absolute, platform resource URI, with encoding to eliminate any invalid characters. |
protected URI |
toURI(java.lang.String pathName)
Converts the given workspace path to a URI . |
protected boolean |
validateEdit(URI workspacePath,
Monitor monitor)
When running under Eclipse, performs an IWorkspace.validateEdit(IFile[], Object)
for the file identified by the given workspace path URI. |
Methods inherited from class org.eclipse.emf.common.notify.impl.SingletonAdapterImpl |
---|
dispose, getTarget, notifyChanged, setTarget, unsetTarget |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.eclipse.emf.codegen.ecore.generator.GeneratorAdapter |
---|
dispose |
Field Detail |
---|
protected static final java.lang.String MANIFEST_ENCODING
protected static final java.lang.String PROPERTIES_ENCODING
protected GeneratorAdapterFactory adapterFactory
protected java.lang.Object generatingObject
preGenerate(Object, Object)
, generate(Object, Object, Monitor)
, and
postGenerate(Object, Object)
.
protected java.lang.String message
doGenerate(Object, Object, Monitor)
and will be used in the diagnostic message if an exception is caught.
protected JETEmitter[] jetEmitters
JETEmitter
s used by this adapter. This are cached so that they can be reused at least for
different objects with the same adapter. When dynamic templateS
are
not being used, they can actually be reused for multiple code generation invocations.
protected GIFEmitter[] gifEmitters
GIFEmitter
s used by this adapter. This are cached so that they can be reused at least for
different objects with the same adapter. When dynamic templateS
are
not being used, they can actually be reused for multiple code generation invocations.
protected ImportManager importManager
ImportManager
currently being used in generating Java code. This should only be created and
cleared via createImportManager(String, String)
and clearImportManager()
, so that subclasses may
respond to such changes.
protected java.lang.String lineDelimiter
setLineDelimiter(String)
so that subclasses may respond to such changes.
protected URIConverter uriConverter
URIConverter
for use during code generation. This is usually applicable to the whole
set of objects for which code is being generated, so it can be cached long-term.
protected static final java.lang.Class<?>[] OBJECT_ARGUMENT
Constructor Detail |
---|
public AbstractGeneratorAdapter()
setAdapterFactory()
method must be called immediately to set the generator adapter factory that created this adapter.
public AbstractGeneratorAdapter(GeneratorAdapterFactory adapterFactory)
Method Detail |
---|
public GeneratorAdapterFactory getAdapterFactory()
GeneratorAdapter
getAdapterFactory
in interface GeneratorAdapter
GeneratorAdapter.setAdapterFactory(GeneratorAdapterFactory)
public void setAdapterFactory(GeneratorAdapterFactory adapterFactory)
GeneratorAdapter
setAdapterFactory
in interface GeneratorAdapter
GeneratorAdapter.getAdapterFactory()
public boolean isAdapterForType(java.lang.Object type)
true
when the type is this adapter's factory
.
This allows generator adapters from different factories to be attached to the same objects.
isAdapterForType
in interface Adapter
isAdapterForType
in class SingletonAdapterImpl
type
- the type.
false
AdapterFactory.isFactoryForType(java.lang.Object)
public java.util.Collection<?> getCanGenerateChildren(java.lang.Object object, java.lang.Object projectType)
getCanGenerateChildren
in interface GeneratorAdapter
public java.lang.Object getCanGenerateParent(java.lang.Object object, java.lang.Object projectType)
getCanGenerateParent
in interface GeneratorAdapter
public abstract boolean canGenerate(java.lang.Object object, java.lang.Object projectType)
GeneratorAdapter
canGenerate
in interface GeneratorAdapter
public java.util.Collection<?> getGenerateChildren(java.lang.Object object, java.lang.Object projectType)
getGenerateChildren
in interface GeneratorAdapter
public java.lang.Object getGenerateParent(java.lang.Object object, java.lang.Object projectType)
getGenerateParent
in interface GeneratorAdapter
public final Diagnostic preGenerate(java.lang.Object object, java.lang.Object projectType)
generatingObject
, calls doPreGenerate(Object, Object)
, and clears it again.
If dynamic templates
are enabled on the generator, any cached
JETEmitter
s and GIFEmitter
s are also removed, so that templates
will be recompiled during generate(Object, Object, Monitor)
.
preGenerate
in interface GeneratorAdapter
protected Diagnostic doPreGenerate(java.lang.Object object, java.lang.Object projectType)
OK
. Override this to perform
setup for code generation.
public final Diagnostic generate(java.lang.Object object, java.lang.Object projectType, Monitor monitor)
canGenerate(Object, Object)
, delegates code
generation to doGenerate(Object, Object, Monitor)
. Otherwise, simply returns
OK
. The object is cached as generatingObject
and the message
is
cleared before calling doGenerate(Object, Object, Monitor)
; both are cleared again afterwards.
generate
in interface GeneratorAdapter
canGenerate(Object, Object)
,
doGenerate(Object, Object, Monitor)
protected abstract Diagnostic doGenerate(java.lang.Object object, java.lang.Object projectType, Monitor monitor) throws java.lang.Exception
generate()
. If a message
is set, it will
be used in this diagnostic.
java.lang.Exception
public final Diagnostic postGenerate(java.lang.Object object, java.lang.Object projectType)
generatingObject
, calls doPostGenerate(Object, Object)
, and clears it again.
If dynamic templates
are enabled on the generator, any cached
JETEmitter
and GIFEmitters
are also removed, so that templates will be
recompiled during the next generate(Object, Object, Monitor)
.
postGenerate
in interface GeneratorAdapter
protected Diagnostic doPostGenerate(java.lang.Object object, java.lang.Object projectType)
OK
. Override this to perform
cleanup from code generation.
protected Diagnostic toDiagnostic(java.lang.Exception exception, java.lang.String currentMessage)
Diagnostic
. The currentMessage
, if non-null, should
describe what was being done when the exception occurred, and will be used in forming the diagnostic's message.
protected Generator getGenerator()
protected JETEmitter getJETEmitter(AbstractGeneratorAdapter.JETEmitterDescriptor[] jetEmitterDescriptors, int id)
JETEmitter
for the JETEmitterDescriptor
at the index specified by
id
in the given array. If the JETEmitter
has not yet been created, it will be created,
initialized, and cached at the same index in jetEmitters
.
jetEmitterDescriptors
- an array of descriptors for all of the JETEmitter
s used by this
generator adapter.id
- the identifier for the desired JETEmitter
, also the index of the descriptor in the array.protected JETEmitter createJETEmitter(AbstractGeneratorAdapter.JETEmitterDescriptor jetEmitterDescriptor)
JETEmitter
according to the given descriptor.
protected java.util.List<java.lang.String> getUserTemplatePath()
This method is only consulted if the generator's templatePath
option is
set to null.
Generator.Options.templatePath
,
JETEmitter.JETEmitter(String[], String)
,
JETCompiler.find(String[], String)
protected void addBaseTemplatePathEntries(java.util.List<java.lang.String> templatePath)
This method is only consulted if the generator's templatePath
option is
set to null.
Generator.Options.templatePath
,
JETEmitter.JETEmitter(String[], String)
,
JETCompiler.find(String[], String)
protected void setStaticTemplateClass(JETEmitter jetEmitter, java.lang.String className)
dynamic templates
are not being used, attempts to set the emitter to
use an existing, precompiled template class.
protected void addClasspathEntries(JETEmitter jetEmitter) throws JETException
add classpath variables
to the JETEmitter. These will be used to build and execute dynamic templates.
JETException
JETEmitter.addVariable(String, String)
protected GIFEmitter getGIFEmitter(java.lang.String[] inputPathNames, int id)
GIFEmitter
for the input path name at the index specified by id
in the given
array. If the GIFEmitter
has not yet been created, it will be created and cached at the same index in
gifEmitters
.
inputPathNames
- an array of input path names for all the GIFEmitter
s used by this generator
adapter. These are the file names, relative to the template path, of grey-scale images to be colourized.id
- the identifier for the desired GIFEmitter
, also the index of the input path name in the
array.protected GIFEmitter createGIFEmitter(java.lang.String inputPathName)
GIFEmitter
based on the image at the give template-path-relative file name.
protected void generateText(java.lang.String targetPathName, JETEmitter jetEmitter, java.lang.Object[] arguments, boolean overwrite, java.lang.String encoding, Monitor monitor)
targetPathName
- the path name of the target file. This should be a workspace path; when running stand-alone,
it will be converted to a platform resource URI that should be mapped to a physical file URI by the
URIConverter
.jetEmitter
- the JETEmitter
to use for generating the text.arguments
- the argument array to pass to the JETEmitter
's
generate(Monitor, Object[])
method. If null, an array will
be constructed containing only the object
for which code is being generated.overwrite
- whether an existing file should be overwritten.encoding
- an override of the default encoding. If "ISO-8859-1" is specified,
Unicode escape encoding
is performed to represent non-Latin characters. The default encoding, when running under Eclipse, is
determined from the workspace. Failing that, or in stand-alone, the platform default is used.monitor
- the Monitor
through which to report progress.
This method also consults the following generator options
:
protected void generateProperties(java.lang.String targetPathName, JETEmitter jetEmitter, java.lang.Object[] arguments, Monitor monitor)
merging
capability.
The encoding used for the generated file is "ISO-8859-1".
Unicode escape encoding
is
performed to represent non-Latin characters.
targetPathName
- the path name of the target file. This should be a workspace path; when running stand-alone,
it will be converted to a platform resource URI that should be mapped to a physical file URI by the
URIConverter
.jetEmitter
- the JETEmitter
to use for generating the text.arguments
- the argument array to pass to the JETEmitter
's
generate(Monitor, Object[])
method. If null, an array will
be constructed containing only the object
for which code is being generated.monitor
- the Monitor
through which to report progress.
This method also consults the following generator options
:
protected void generateGIF(java.lang.String targetPathName, GIFEmitter gifEmitter, java.lang.String parentKey, java.lang.String childKey, boolean overwrite, Monitor monitor)
GIFEmitter
to colourize a grey-scale GIF
image. The colours to use are calculated from one or, optionally, two text keys.
targetPathName
- the path name of the target file. This should be a workspace path; when running stand-alone,
it will be converted to a platform resource URI that should be mapped to a physical file URI by the
URIConverter
.gifEmitter
- the GIFEmitter
to use for generating the icon.parentKey
- the key used to determine the first colour set.childKey
- the key used to determine the second colour set. If null, this key is ignored.overwrite
- whether an existing file should be overwritten.monitor
- the Monitor
through which to report progress.
This method also consults the following generator options
:
protected void generateJava(java.lang.String targetPath, java.lang.String packageName, java.lang.String className, JETEmitter jetEmitter, java.lang.Object[] arguments, Monitor monitor)
import management
and, when running under Eclipse, merging
and
code formatting
capabilities.
When running under Eclipse, the encoding for the file is determined from the workspace. Failing that, or in stand-alone, the platform default is used.
targetPath
- the workspace path of the directory in or under which the file will be created, depending on the
specified package name. When running stand-alone, this path will be converted to a platform resource URI
that should be mapped to a physical file URI by the URIConverter
.packageName
- the package name for the generated compilation unit.className
- the name of the public class in the generated compilation unit.jetEmitter
- the JETEmitter
to use for generating the code.arguments
- the argument array to pass to the JETEmitter
's
generate(Monitor, Object[])
method. If null, an array will
be constructed containing only the object
for which code is being generated.monitor
- the Monitor
through which to report progress.
This method also consults the following generator options
:
protected URI toURI(java.lang.String pathName)
URI
. No encoding is performed, so the URI may contain invalid
characters. Such a URI is only used to easily access and manipulate parts of the workspace path. It can then be
converted back to a string and an IPath
for use in the workspace, or to an
encoded platform resource URI
for direct use with the EMF persistence
framework.
protected URI toPlatformResourceURI(URI uri)
protected Monitor createMonitor(Monitor monitor, int ticks)
monitor
- the parent monitorticks
- the number of work ticks allocated from the parent monitorprotected void createImportManager(java.lang.String packageName, java.lang.String className)
ImportManager
for use in generating Java
code.
protected void clearImportManager()
ImportManager
.
protected ImportManager getImportManager()
ImportManager
that is currently in use for
generating Java code, or null if there is none.
protected void setLineDelimiter(java.lang.String lineDelimiter)
lineDelimiter
- protected java.lang.String getLineDelimiter()
protected void ensureProjectExists(java.lang.String workspacePath, java.lang.Object object, java.lang.Object projectType, boolean force, Monitor monitor)
force
is true, it will be
reconfigured to match the default configuration. The remainder of the path suggests the folder under which source
will be generated.
When running stand-alone, this method does nothing, since simply opening a stream via a URIConverter
will automatically create the necessary directories.
protected void ensureContainerExists(URI workspacePath, Monitor monitor)
When running stand-alone, this method does nothing, since simply opening a stream via a URIConverter
will automatically create the necessary directories.
protected URIConverter getURIConverter()
URIConverter
for use during code generation.
public java.lang.String getLineDelimiter(URI workspacePath, java.lang.String encoding)
protected boolean exists(URI workspacePath)
protected boolean isReadOnly(URI workspacePath)
protected void setWriteable(URI workspacePath) throws java.lang.Exception
java.lang.Exception
protected boolean validateEdit(URI workspacePath, Monitor monitor)
IWorkspace.validateEdit(IFile[], Object)
for the file identified by the given workspace path URI. This notifies the workspace that the file will be edited,
providing it the opportunity to prepare the files if required. When running stand-alone, does nothing.
protected java.io.InputStream createInputStream(URI workspacePath) throws java.lang.Exception
InputStream
for the file identified by the given workspace path URI.
java.lang.Exception
protected java.io.OutputStream createOutputStream(URI workspacePath) throws java.lang.Exception
OutputStream
for the file identified by the given workspace path URI.
java.lang.Exception
protected java.lang.String getContents(URI workspacePath, java.lang.String encoding) throws java.lang.Exception
java.lang.Exception
protected java.lang.String getEncoding(URI workspacePath)
protected java.lang.Object createCodeFormatter(java.util.Map<?,?> options, URI workspacePath)
options
is
non-null, the code formatting options it specifies are used to create the formatter. Otherwise, the project is
obtained from the given workspace path URI, and its default formatting options are used.
CodeFormatter
; however, it is not statically typed
as such to avoid failure when running stand-alone.protected java.lang.String formatCode(java.lang.String contents, java.lang.Object codeFormatter)
|
Copyright 2001-2006 IBM Corporation and others. All Rights Reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |