|
Mobile Tools for Java Release 1.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.mtj.core.model.preverifier.StandardPreverifierFactory
public class StandardPreverifierFactory
A factory implementation for generating instances of StandardPreverifier with the appropriate parameters. Those parameters are retrieved by running the preverifier and using the output to make an educated guess concerning the required parameter structure.
There are three main categories of preverifiers that are supported by this class, all of which are presumably derived from (or are copies of) Sun preverifiers:
Usage: preverify [options] classnames|dirnames ... where options include: -classpath <directories separated by ';'> Directories in which to look for classes -d <directory> Directory in which output is written (default is ./output/) @<filename> Read command line arguments from a text file
With this category, we do not differentiate between CLDC 1.0 and CLDC 1.1 preverification.
Usage: preverify [options] classnames|dirnames ...
where options include:
-classpath <directories separated by ';'>
Directories in which to look for classes
-d <directory> Directory in which output is written (default is ./output/)
-cldc Checks for existence of language features prohibited
by CLDC (native methods, floating point and finalizers)
-nofinalize No finalizers allowed
-nonative No native methods allowed
-nofp No floating point operations allowed
@<filename> Read command line arguments from a text file
Command line arguments must all be on a single line
Directory names must be enclosed in double quotes (")
Some preverifiers in this category support a -cldc1.0 argument
instead of, or in addition to the -cldc argument.
CLDC 1.0 preverification should prevent the use of floating point (
-nofp) native methods (-nonative) and finalizers (
-nofinalize), all of which is accomplished by the use of the
-cldc (or -cldc1.0) parameter. For CLDC 1.1,
however, floating point is allowed, although finalizers and native methods
are still prohibited.
For this category of preverifiers, we use the options
-nofp -nonative -nofinalize for CLDC 1.0
preverification and -nonative -nofinalize for CLDC 1.1
preverification. We don't attempt to use the -cldc or
-cldc1.0 argument for CLDC 1.0 because it's simpler and more
bullet-proof just to use the individual arguments.
-target option that effectively selects between two
different preverifiers. Usage typically looks like this:
Usage: preverify [options] classnames|dirnames ...
where options include:
-classpath <directories separated by ';'>
Directories in which to look for classes
-d <directory> Directory in which output is written (default is ./output/)
[ -cldc1.0 | -cldc ]
Checks for existence of language features prohibited
by CLDC 1.0 (native methods, floating point and finalizers)
-target <CLDC1.1 | CLDC1.0>
Which preverifier to run
-nofinalize No finalizers allowed
-nonative No native methods allowed
-nofp No floating point operations allowed
@<filename> Read command line arguments from a text file
Command line arguments must all be on a single line
Directory names must be enclosed in double quotes (")
Thus, this category of preverifier is essentially identical to the second
set, but with the addition of the -target option. Oddly enough,
experience shows that specifying CLDC 1.1 or CLDC 1.0 using the
-target option does not result in automatic selection of
the appropriate -nofp, -nonative, and/or
-nofinalize options. Thus, we include these in addition to the
-target option.
As a result, for this category of preverifiers, we use the options
-target CLDC1.0 -nofp -nonative -nofinalize
for CLDC 1.0 preverification and
-target CLDC1.0 -nonative -nofinalize for CLDC
1.1
The basic strategy of this class is to run the preverifier without any command line arguments and capture the result. We then inspect the output for the presence of the various options and, when we find them, add them to the arguments we will use for the various preverifications. Note that we have to check both the stdout results and the stderr results, because some preverifiers send their usage to stdout (Sun) and other send it to stderr (Motorola).
| Method Summary | |
|---|---|
static StandardPreverifier |
createPreverifier(File preverifierExecutable)
Create a new StandardPreverifier instance for the specified executable. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static StandardPreverifier createPreverifier(File preverifierExecutable)
throws CoreException
null if the preverifier cannot be created for some
reason.
preverifierExecutable -
CoreException - if failed to get the preverifier parameters.
|
Mobile Tools for Java Release 1.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||