Class DefaultValuePlugin
java.lang.Object
com.sun.tools.xjc.Plugin
org.jvnet.jaxb.plugin.defaultvalueplugin.DefaultValuePlugin
public class DefaultValuePlugin
extends com.sun.tools.xjc.Plugin
Modifies the JAXB code model to set default values to the schema "default" attribute.
Currently, the following field types can be initialized:
Created: Mon Apr 24 22:04:25 2006
- Version:
- 1.1
- Author:
- Hari Selvarajan, J�rgen Lukasczyk
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionDefaultValuePlugin uses "-Xdefault-value" as the command-line argumentgetUsage()Return usage information for pluginintparseArgument(com.sun.tools.xjc.Options opt, String[] args, int i) booleanrun(com.sun.tools.xjc.outline.Outline outline, com.sun.tools.xjc.Options opt, ErrorHandler errorHandler) Run the plugin.Methods inherited from class com.sun.tools.xjc.Plugin
getCustomizationURIs, isCustomizationTagName, onActivated, postProcessModel
-
Constructor Details
-
DefaultValuePlugin
public DefaultValuePlugin()Creates a newDefaultValuePlugininstance.
-
-
Method Details
-
getOptionName
DefaultValuePlugin uses "-Xdefault-value" as the command-line argument- Specified by:
getOptionNamein classcom.sun.tools.xjc.Plugin
-
getUsage
Return usage information for plugin- Specified by:
getUsagein classcom.sun.tools.xjc.Plugin
-
run
public boolean run(com.sun.tools.xjc.outline.Outline outline, com.sun.tools.xjc.Options opt, ErrorHandler errorHandler) Run the plugin. We perform the following steps:- Look for fields that:
- Were generated from XSD description
- The XSD description is of type xsd:element (or xsd:attribute if all is set)
- A default value is specified
- Map to one of the supported types
- Add a new initializsation expression to every field found
- Specified by:
runin classcom.sun.tools.xjc.Plugin
- Look for fields that:
-
parseArgument
- Overrides:
parseArgumentin classcom.sun.tools.xjc.Plugin
-