|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.tools.xjc.Plugin
public abstract class Plugin
Add-on that works on the generated source code.
This add-on will be called after the default bean generation has finished.
Constructor Summary | |
---|---|
Plugin()
|
Method Summary | |
---|---|
java.util.List<java.lang.String> |
getCustomizationURIs()
Returns the list of namespace URIs that are supported by this plug-in as schema annotations. |
abstract java.lang.String |
getOptionName()
Gets the option name to turn on this add-on. |
abstract java.lang.String |
getUsage()
Gets the description of this add-on. |
boolean |
isCustomizationTagName(java.lang.String nsUri,
java.lang.String localName)
Checks if the given tag name is a valid tag name for the customization element in this plug-in. |
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. |
abstract boolean |
run(Outline outline,
Options opt,
org.xml.sax.ErrorHandler errorHandler)
Run the add-on. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Plugin()
Method Detail |
---|
public abstract java.lang.String getOptionName()
public abstract java.lang.String getUsage()
public int parseArgument(Options opt, java.lang.String[] args, int i) throws BadCommandLineException, java.io.IOException
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.
BadCommandLineException
- If the option was recognized but there's an error.
java.io.IOException
public java.util.List<java.lang.String> getCustomizationURIs()
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.
public boolean isCustomizationTagName(java.lang.String nsUri, java.lang.String localName)
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(com.sun.tools.xjc.outline.Outline, com.sun.tools.xjc.Options, org.xml.sax.ErrorHandler)
method before using any CPluginCustomization
, to make sure that it
has proper child elements and attributes.
nsUri
- the namespace URI of the element. Never null.localName
- the local name of the element. Never null.public abstract boolean run(Outline outline, Options opt, org.xml.sax.ErrorHandler errorHandler)
outline
- This object allows access to various generated code.errorHandler
- Errors should be reported to this handler.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |