Class DefaultValuePlugin
- java.lang.Object
-
- com.sun.tools.xjc.Plugin
-
- org.jvnet.jaxb.plugin.defaultvalueplugin.DefaultValuePlugin
-
public class DefaultValuePlugin extends com.sun.tools.xjc.PluginModifies 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 Constructor Description DefaultValuePlugin()Creates a newDefaultValuePlugininstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetOptionName()DefaultValuePlugin uses "-Xdefault-value" as the command-line argumentStringgetUsage()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.
-
-
-
Method Detail
-
getOptionName
public String getOptionName()
DefaultValuePlugin uses "-Xdefault-value" as the command-line argument- Specified by:
getOptionNamein classcom.sun.tools.xjc.Plugin
-
getUsage
public String 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
public int parseArgument(com.sun.tools.xjc.Options opt, String[] args, int i)- Overrides:
parseArgumentin classcom.sun.tools.xjc.Plugin
-
-