uk.org.retep.util.xml.jaxb
Class JAXBPluginLibrary

java.lang.Object
  extended by com.sun.tools.xjc.Plugin
      extended by uk.org.retep.util.xml.jaxb.JAXBPluginLibrary
Direct Known Subclasses:
RetepPluginLibrary

public abstract class JAXBPluginLibrary
extends com.sun.tools.xjc.Plugin

A JAXB Plugin that actually manages a collection of individual plugins registered with it, forming a single library of plugins that can be enabled with a single command line argument.

To implement a JAXBPluginLibrary, simply create a subclass implementing the abstract methods and annotate the class with @uk.org.retep.annotations.Service( com.sun.tools.xjc.Plugin )

Then for each plugin, simply annotate them with @uk.org.retep.annotations.Service with your class name as the value.

Then when XJC is used, include your library within it's classpath and enable it with the optionName of your library.

Since:
9.2
Author:
peter
See Also:
RetepPluginLibrary

Constructor Summary
JAXBPluginLibrary()
           
 
Method Summary
 List<String> getCustomizationURIs()
           
 String getUsage()
           
protected abstract  void getUseage(StringBuilder sb)
          The useage for this plugin, simply append to the provided StringBuilder
 boolean isCustomizationTagName(String nsUri, String localName)
           
 void onActivated(com.sun.tools.xjc.Options opts)
           
 int parseArgument(com.sun.tools.xjc.Options opt, String[] args, int i)
           
 void postProcessModel(com.sun.tools.xjc.model.Model model, ErrorHandler errorHandler)
           
protected  void registerPlugin(com.sun.tools.xjc.Plugin plugin)
           
 boolean run(com.sun.tools.xjc.outline.Outline model, com.sun.tools.xjc.Options opt, ErrorHandler errorHandler)
           
 
Methods inherited from class com.sun.tools.xjc.Plugin
getOptionName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JAXBPluginLibrary

public JAXBPluginLibrary()
Method Detail

registerPlugin

protected final void registerPlugin(com.sun.tools.xjc.Plugin plugin)

getCustomizationURIs

public final List<String> getCustomizationURIs()
Overrides:
getCustomizationURIs in class com.sun.tools.xjc.Plugin

isCustomizationTagName

public final boolean isCustomizationTagName(String nsUri,
                                            String localName)
Overrides:
isCustomizationTagName in class com.sun.tools.xjc.Plugin

onActivated

public final void onActivated(com.sun.tools.xjc.Options opts)
                       throws com.sun.tools.xjc.BadCommandLineException
Overrides:
onActivated in class com.sun.tools.xjc.Plugin
Throws:
com.sun.tools.xjc.BadCommandLineException

parseArgument

public final int parseArgument(com.sun.tools.xjc.Options opt,
                               String[] args,
                               int i)
                        throws com.sun.tools.xjc.BadCommandLineException,
                               IOException
Overrides:
parseArgument in class com.sun.tools.xjc.Plugin
Throws:
com.sun.tools.xjc.BadCommandLineException
IOException

postProcessModel

public final void postProcessModel(com.sun.tools.xjc.model.Model model,
                                   ErrorHandler errorHandler)
Overrides:
postProcessModel in class com.sun.tools.xjc.Plugin

getUsage

public final String getUsage()
Specified by:
getUsage in class com.sun.tools.xjc.Plugin

getUseage

protected abstract void getUseage(StringBuilder sb)
The useage for this plugin, simply append to the provided StringBuilder

Parameters:
sb -

run

public final boolean run(com.sun.tools.xjc.outline.Outline model,
                         com.sun.tools.xjc.Options opt,
                         ErrorHandler errorHandler)
                  throws SAXException
Specified by:
run in class com.sun.tools.xjc.Plugin
Throws:
SAXException


Copyright © 1998-2009 Retep Development Group. All Rights Reserved.