@J2SDebug
@J2SKeep
@J2SIgnore
@J2SIgnoreSuperConstructor
@J2SOverride
The last @J2SNativeSrc is same as @J2SNative. It is available for JavaScript obfuscate mode, which is not enabled be default. And we do not recommend to open obfuscate compiling mode for normal projects.
The following three annotations are about JavaScript class loader.
For a class A, class loader will try to load those classes that class A is dependent on before the class loader initialize class A. These classes are considered as "required imports". e.g. all super classes or interfaces, and all classes used in static initializer statements (not its static method invocations). And then class loader will try to initialize those classes that class A will run into. These classes are considered as "optional imports". e.g. all new instances inside non-static methods, like "{ if (a) return new ClassC(); }", ClassC will only be loaded after all other classes are loaded and initialized.
Loading orders would simply be "required imports" -> main class -> "optional imports".
But in some cases, they won't be a linear order to load all classes. Classes may get cycle loading, which should be avoided and should be broken. So we introduce these annotations to reduce/break/fix imports.
@J2SIgnoreImport
ignoring all required imports and optional imports
@J2SRequireImport
add required import classes
add optional import classes
The following two annotations are available for adding scripts before or after the generated *.js file.
@J2SSuffix
@J2SPrefix
All these annotations have their @j2s* Javadoc tags.
There is a j2stagsrc.zip file under plugins/net.sf.j2s.ajax_2.0.0/, contains all the above annotations.
You can <Ctrl/Command>+Click to navigator into those class, source should be attached with those classes.
Regards,
Zhou Renjian