Top Description Inners Fields Constructors Methods
com.sun.tools.xjc.addon.episode

public Class PluginImpl

extends Plugin
Class Inheritance
Imports
com.sun.tools.xjc.BadCommandLineException, .Options, .Plugin, com.sun.tools.xjc.outline.ClassOutline, .EnumOutline, .Outline, com.sun.tools.xjc.reader.Const, org.glassfish.jaxb.core.v2.schemagen.episode.Bindings, .SchemaBindings, com.sun.xml.txw2.TXW, com.sun.xml.txw2.output.StreamSerializer, com.sun.xml.xsom.XSAnnotation, .XSAttGroupDecl, .XSAttributeDecl, .XSAttributeUse, .XSComplexType, .XSComponent, .XSContentType, .XSDeclaration, .XSElementDecl, .XSFacet, .XSIdentityConstraint, .XSModelGroup, .XSModelGroupDecl, .XSNotation, .XSParticle, .XSSchema, .XSSimpleType, .XSWildcard, .XSXPath, com.sun.xml.xsom.visitor.XSFunction, org.xml.sax.ErrorHandler, .SAXException, .SAXParseException, java.io.File, .FileOutputStream, .IOException, .OutputStream, java.util.ArrayList, .HashSet, .LinkedHashMap, .List, .Map, .Set

Creates the episode file,
Authors
Kohsuke Kawaguchi, Ben Tomasini ([email protected])

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class

Field Summary

Modifier and TypeField and Description
private File
private static final XSFunction<String>
SCD

Computes SCD.

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.

Capture all the generated classes from global schema components and generate them in an episode file.

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

Field Detail

episodeFileback to summary
private File episodeFile
SCDback to summary
private static final XSFunction<String> SCD

Computes SCD. This is fairly limited as JAXB can only map a certain kind of components to classes.

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) throws SAXException

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

Capture all the generated classes from global schema components and generate them in an episode file.

Annotations
@Override
Exceptions
SAXException:

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

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.

com.sun.tools.xjc.addon.episode back to summary

private final Class PluginImpl.OutlineAdaptor

extends Object
Class Inheritance

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static enum

Field Summary

Modifier and TypeField and Description
private final String
private final PluginImpl.OutlineAdaptor.OutlineType
private final String
private final XSComponent

Constructor Summary

AccessConstructor and Description
public
OutlineAdaptor(XSComponent schemaComponent, PluginImpl.OutlineAdaptor.OutlineType outlineType, String implName, String packageName)

Method Summary

Modifier and TypeMethod and Description
private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

implNameback to summary
private final String implName
outlineTypeback to summary
private final PluginImpl.OutlineAdaptor.OutlineType outlineType
packageNameback to summary
private final String packageName
schemaComponentback to summary
private final XSComponent schemaComponent

Constructor Detail

OutlineAdaptorback to summary
public OutlineAdaptor(XSComponent schemaComponent, PluginImpl.OutlineAdaptor.OutlineType outlineType, String implName, String packageName)

Method Detail

buildBindingsback to summary
private void buildBindings(Bindings bindings)
com.sun.tools.xjc.addon.episode back to summary

private final Enum PluginImpl.OutlineAdaptor.OutlineType

extends Enum<PluginImpl.OutlineAdaptor.OutlineType>
Class Inheritance

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static interface

Field Summary

Modifier and TypeField and Description
private final PluginImpl.OutlineAdaptor.OutlineType.BindingsBuilder
public static final PluginImpl.OutlineAdaptor.OutlineType
public static final PluginImpl.OutlineAdaptor.OutlineType

Constructor Summary

AccessConstructor and Description
private

Field Detail

bindingsBuilderback to summary
private final PluginImpl.OutlineAdaptor.OutlineType.BindingsBuilder bindingsBuilder
CLASSback to summary
public static final PluginImpl.OutlineAdaptor.OutlineType CLASS
ENUMback to summary
public static final PluginImpl.OutlineAdaptor.OutlineType ENUM

Constructor Detail

OutlineTypeback to summary
private OutlineType(PluginImpl.OutlineAdaptor.OutlineType.BindingsBuilder bindingsBuilder)

Method Detail

valueOfback to summary
public static PluginImpl.OutlineAdaptor.OutlineType valueOf(String name)
valuesback to summary
public static PluginImpl.OutlineAdaptor.OutlineType[] values()
com.sun.tools.xjc.addon.episode back to summary

private Interface PluginImpl.OutlineAdaptor.OutlineType.BindingsBuilder


Method Summary

Modifier and TypeMethod and Description
public void

Method Detail

buildback to summary
public void build(PluginImpl.OutlineAdaptor adaptor, Bindings bindings)
com.sun.tools.xjc.addon.episode back to summary

private final Class PluginImpl.PerSchemaOutlineAdaptors

extends Object
Class Inheritance
  • java.lang.Object
  • com.sun.tools.xjc.addon.episode.PluginImpl.PerSchemaOutlineAdaptors

Field Summary

Modifier and TypeField and Description
private final List<PluginImpl.OutlineAdaptor>
private final Set<String>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private void
add(PluginImpl.OutlineAdaptor outlineAdaptor)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

outlineAdaptorsback to summary
private final List<PluginImpl.OutlineAdaptor> outlineAdaptors
packageNamesback to summary
private final Set<String> packageNames

Constructor Detail

PerSchemaOutlineAdaptorsback to summary
private PerSchemaOutlineAdaptors()

Method Detail

addback to summary
private void add(PluginImpl.OutlineAdaptor outlineAdaptor)