Top Description Constructors Methods
com.sun.tools.xjc.addon.accessors

public Class PluginImpl

extends Plugin
Class Inheritance
Imports
com.sun.codemodel.JAnnotationUse, .JClass, java.io.IOException, com.sun.tools.xjc.BadCommandLineException, .Options, .Plugin, com.sun.tools.xjc.outline.ClassOutline, .Outline, java.lang.reflect.Field, java.util.Iterator, java.util.logging.Level, .Logger, jakarta.xml.bind.annotation.XmlAccessType, .XmlAccessorType, org.xml.sax.ErrorHandler

Generates synchronized methods.
Author
Martin Grebac ([email protected])

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public String
getOptionName()

Implements abstract com.sun.tools.xjc.Plugin.getOptionName.

Gets the option name to turn on this add-on.

public String
getUsage()

Implements abstract com.sun.tools.xjc.Plugin.getUsage.

Gets the description of this add-on.

public int
parseArgument(Options opt, String[] args, int i)

Overrides com.sun.tools.xjc.Plugin.parseArgument.

Parses an option args[i] and augment the opt object appropriately, then return the number of tokens consumed.

public boolean
run(Outline model, Options opt, ErrorHandler errorHandler)

Implements abstract com.sun.tools.xjc.Plugin.run.

Run the add-on.

Inherited from com.sun.tools.xjc.Plugin:
getCustomizationURIsisCustomizationTagNameonActivatedpostProcessModel

Constructor Detail

PluginImplback to summary
public PluginImpl()

Method Detail

getOptionNameback to summary
public String getOptionName()

Implements abstract com.sun.tools.xjc.Plugin.getOptionName.

Doc from com.sun.tools.xjc.Plugin.getOptionName.

Gets the option name to turn on this add-on.

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 will be invoked.

Starting 2.1, when an option matches the name returned from this method, XJC will then invoke parseArgument(Options, String[], int), allowing plugins to handle arguments to this option.

Annotations
@Override
getUsageback to summary
public String getUsage()

Implements abstract com.sun.tools.xjc.Plugin.getUsage.

Doc from com.sun.tools.xjc.Plugin.getUsage.

Gets the description of this add-on. Used to generate a usage screen.

Annotations
@Override
parseArgumentback to summary
public int parseArgument(Options opt, String[] args, int i) throws BadCommandLineException, IOException

Overrides com.sun.tools.xjc.Plugin.parseArgument.

Doc from com.sun.tools.xjc.Plugin.parseArgument.

Parses an option 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 needs to be activated to participate in further processing.

Annotations
@Override
Exceptions
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.
runback to summary
public boolean run(Outline model, Options opt, ErrorHandler errorHandler)

Implements abstract com.sun.tools.xjc.Plugin.run.

Doc from com.sun.tools.xjc.Plugin.run.

Run the add-on.

This method is invoked after XJC has internally finished the code generation. Plugins can tweak some of the generated code (or add more code) by using Outline and Options.

Note that this method is invoked only when a is activated.

Annotations
@Override