Class JsonSchemaToPojoMojo

  • All Implemented Interfaces:
    org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo

    @Mojo(name="jsonschema2pojo",
          defaultPhase=GENERATE_SOURCES)
    public class JsonSchemaToPojoMojo
    extends org.apache.maven.plugin.AbstractMojo
    Generates mojo bindings from json schema specification(s).
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private org.apache.johnzon.jsonschema.generator.PojoGenerator.PojoConfiguration generator
      Generation configuration.
      private java.util.List<java.lang.String> jsonSchemaExtensions
      Extensions to consider if source is a directory.
      private java.io.File source
      Source jsonschema or directory containing json schemas.
      private java.io.File target
      Where to dump generated classes.
      • Fields inherited from interface org.apache.maven.plugin.Mojo

        ROLE
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void dump​(java.util.Map<java.lang.String,​java.lang.String> generate)  
      void execute()  
      private jakarta.json.JsonObject read​(jakarta.json.JsonReaderFactory readerFactory, java.nio.file.Path path)  
      • Methods inherited from class org.apache.maven.plugin.AbstractMojo

        getLog, getPluginContext, setLog, setPluginContext
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • generator

        @Parameter
        private org.apache.johnzon.jsonschema.generator.PojoGenerator.PojoConfiguration generator
        Generation configuration. Note that if source is a directory, class name is ignored and auto set from schema name.
      • jsonSchemaExtensions

        @Parameter(property="johnzon.jsonschema.extensions",
                   defaultValue=".jsonschema.json")
        private java.util.List<java.lang.String> jsonSchemaExtensions
        Extensions to consider if source is a directory.
      • source

        @Parameter(property="johnzon.source",
                   defaultValue="${project.basedir}/src/main/johnzon/jsonschema")
        private java.io.File source
        Source jsonschema or directory containing json schemas.
      • target

        @Parameter(property="johnzon.target",
                   defaultValue="${project.build.directory}/generated-sources/johnzon-pojo")
        private java.io.File target
        Where to dump generated classes.
    • Constructor Detail

      • JsonSchemaToPojoMojo

        public JsonSchemaToPojoMojo()
    • Method Detail

      • execute

        public void execute()
      • read

        private jakarta.json.JsonObject read​(jakarta.json.JsonReaderFactory readerFactory,
                                             java.nio.file.Path path)
      • dump

        private void dump​(java.util.Map<java.lang.String,​java.lang.String> generate)