|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.tools.xjc.Plugin
com.sun.tools.xjc.addon.episode.PluginImpl
public class PluginImpl
Creates the episode file,
Constructor Summary | |
---|---|
PluginImpl()
|
Method Summary | |
---|---|
java.lang.String |
getOptionName()
Gets the option name to turn on this add-on. |
java.lang.String |
getUsage()
Gets the description of this add-on. |
int |
parseArgument(Options opt,
java.lang.String[] args,
int i)
Parses an option args[i] and augment
the opt object appropriately, then return
the number of tokens consumed. |
boolean |
run(Outline model,
Options opt,
org.xml.sax.ErrorHandler errorHandler)
Capture all the generated classes from global schema components and generate them in an episode file. |
Methods inherited from class com.sun.tools.xjc.Plugin |
---|
getCustomizationURIs, isCustomizationTagName, onActivated, postProcessModel |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PluginImpl()
Method Detail |
---|
public java.lang.String getOptionName()
Plugin
For example, if "abc" is returned, "-abc" will
turn on this plugin. A plugin needs to be turned
on explicitly, or else no other methods of Plugin
will be invoked.
Starting 2.1, when an option matches the name returned
from this method, XJC will then invoke Plugin.parseArgument(Options, String[], int)
,
allowing plugins to handle arguments to this option.
getOptionName
in class Plugin
public java.lang.String getUsage()
Plugin
getUsage
in class Plugin
public int parseArgument(Options opt, java.lang.String[] args, int i) throws BadCommandLineException, java.io.IOException
Plugin
args[i]
and augment
the opt
object appropriately, then return
the number of tokens consumed.
The callee doesn't need to recognize the option that the getOptionName method returns.
Once a plugin is activated, this method is called for options that XJC didn't recognize. This allows a plugin to define additional options to customize its behavior.
Since options can appear in no particular order, XJC allows sub-options of a plugin to show up before the option that activates a plugin (one that's returned by #getOptionName().) But nevertheless a {@link Plugin} needs to be activated to participate in further processing.
parseArgument
in class Plugin
BadCommandLineException
- If the option was recognized but there's an error.
This halts the argument parsing process and causes
XJC to abort, reporting an error.
java.io.IOException
public boolean run(Outline model, Options opt, org.xml.sax.ErrorHandler errorHandler) throws org.xml.sax.SAXException
run
in class Plugin
model
- This object allows access to various generated code.errorHandler
- Errors should be reported to this handler.
org.xml.sax.SAXException
- After an error is reported to ErrorHandler
, the
same exception can be thrown to indicate a fatal irrecoverable
error. ErrorHandler
itself may throw it, if it chooses
not to recover from the error.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |