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

public Class PluginImpl

extends Plugin
Class Inheritance
Imports
java.util.Collection, .Collections, .List, com.sun.istack.NotNull, com.sun.tools.xjc.Options, .Plugin, com.sun.tools.xjc.model.CPluginCustomization, com.sun.tools.xjc.outline.CustomizableOutline, .Outline, com.sun.tools.xjc.util.DOMUtils, org.xml.sax.ErrorHandler

Entry point of a plugin. See the javadoc of Plugin for what those methods mean.
Author
Kohsuke Kawaguchi

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static void
public List<String>
getCustomizationURIs()

Overrides com.sun.tools.xjc.Plugin.getCustomizationURIs.

Returns the list of namespace URIs that are supported by this plug-in as schema annotations.

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 boolean
isCustomizationTagName(String nsUri, String localName)

Overrides com.sun.tools.xjc.Plugin.isCustomizationTagName.

Checks if the given tag name is a valid tag name for the customization element in this plug-in.

This method is invoked by XJC to determine if the user-specified customization element is really a customization or not.

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:
onActivatedparseArgumentpostProcessModel

Constructor Detail

PluginImplback to summary
public PluginImpl()

Method Detail

checkAndInjectback to summary
private static void checkAndInject(Collection<? extends CustomizableOutline> outlines)
getCustomizationURIsback to summary
public List<String> getCustomizationURIs()

Overrides com.sun.tools.xjc.Plugin.getCustomizationURIs.

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

Returns the list of namespace URIs that are supported by this plug-in as schema annotations.

If a plug-in returns a non-empty list, the JAXB RI will recognize these namespace URIs as vendor extensions (much like "http://java.sun.com/xml/ns/jaxb/xjc"). This allows users to write those annotations inside a schema, or in external binding files, and later plug-ins can access those annotations as DOM nodes.

See http://java.sun.com/webservices/docs/1.5/jaxb/vendorCustomizations.html for the syntax that users need to use to enable extension URIs.

Annotations
@Override
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
isCustomizationTagNameback to summary
public boolean isCustomizationTagName(String nsUri, String localName)

Overrides com.sun.tools.xjc.Plugin.isCustomizationTagName.

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

Checks if the given tag name is a valid tag name for the customization element in this plug-in.

This method is invoked by XJC to determine if the user-specified customization element is really a customization or not. This information is used to pick the proper error message.

A plug-in is still encouraged to do the validation of the customization element in the run method before using any CPluginCustomization, to make sure that it has proper child elements and attributes.

Annotations
@Override
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