Class DefaultValuePlugin

    • Constructor Detail

      • DefaultValuePlugin

        public DefaultValuePlugin()
        Creates a new DefaultValuePlugin instance.
    • Method Detail

      • getOptionName

        public String getOptionName()
        DefaultValuePlugin uses "-Xdefault-value" as the command-line argument
        Specified by:
        getOptionName in class com.sun.tools.xjc.Plugin
      • getUsage

        public String getUsage()
        Return usage information for plugin
        Specified by:
        getUsage in class com.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:
        run in class com.sun.tools.xjc.Plugin
      • parseArgument

        public int parseArgument​(com.sun.tools.xjc.Options opt,
                                 String[] args,
                                 int i)
        Overrides:
        parseArgument in class com.sun.tools.xjc.Plugin