com.sun.tools.ws.wscompile.plugin.at_generated
Class PluginImpl

java.lang.Object
  extended by com.sun.tools.ws.wscompile.Plugin
      extended by com.sun.tools.ws.wscompile.plugin.at_generated.PluginImpl

public final class PluginImpl
extends Plugin

Plugin that marks the generated code by using JSR-250's '@Generated'. It is based on a similar plugin in JAXB RI.

Since:
2.2.6

Constructor Summary
PluginImpl()
           
 
Method Summary
 String getOptionName()
          Gets the option name to turn on this add-on.
 String getUsage()
          Gets the description of this add-on.
 boolean run(Model model, WsimportOptions wo, ErrorReceiver er)
          Run the add-on.
 
Methods inherited from class com.sun.tools.ws.wscompile.Plugin
onActivated, parseArgument
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PluginImpl

public PluginImpl()
Method Detail

getOptionName

public String getOptionName()
Description copied from class: Plugin
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 Plugin will be invoked.

When an option matches the name returned from this method, WsImport will then invoke Plugin.parseArgument(Options, String[], int), allowing plugins to handle arguments to this option.

Specified by:
getOptionName in class Plugin

getUsage

public String getUsage()
Description copied from class: Plugin
Gets the description of this add-on. Used to generate a usage screen.

Specified by:
getUsage in class Plugin
Returns:
localized description message. should be terminated by \n.

run

public boolean run(Model model,
                   WsimportOptions wo,
                   ErrorReceiver er)
            throws SAXException
Description copied from class: Plugin
Run the add-on.

This method is invoked after WsImport has internally finished the code generation. Plugins can tweak some of the generated code (or add more code) by altering JCodeModel obtained from WsimportOptions.getCodeModel() according to the current WSDL model and WsimportOptions.

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

Specified by:
run in class Plugin
Parameters:
model - This object allows access to the WSDL model used for code generation.
wo - This object allows access to various options used for code generation as well as access to the generated code.
Returns:
If the add-on executes successfully, return true. If it detects some errors but those are reported and recovered gracefully, return false.
Throws:
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.


Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved.