2017-12-08 7 views
0

jsonschema2pojoでjsonからJavaクラスを自動生成する方法はありますか?ジェネリックスにはプリミティブバイト配列が含まれていますか?例えば、私はこのprivate Map<String, byte[]> mappy;を生成したいとこれまでのところ、私はこれを使用してprivate Map<String, Byte[]> mappy;を生成するために管理:jsonschema2pojoでプリミティブバイト配列ジェネリックを自動生成

"properties": { 
    "mappy": { 
    "id": "/response/images", 
    "title": "(images) The images property.", 
    "javaType" : "java.util.Map<String, Byte[]>", 
    "type" : "object" 
    } 
} 

が、私はむしろ代わりにバイト配列のプリミティブバイト配列を使用すると思います。 Byte[]の代わりに byte[]を使用しようとすると、jsonschema2pojoが例外をスローします。

答えて

0

OK。私は、このようなpom.xmlファイルにreplacerプラグインを使用する方法を考え出しました:

 <plugin> 
      <groupId>com.google.code.maven-replacer-plugin</groupId> 
      <artifactId>replacer</artifactId> 
      <version>1.5.3</version> 
      <executions> 
       <execution> 
        <id>Convert commons-lang to commons-lang3</id> 
        <phase>generate-sources</phase> 
        <goals> 
         <goal>replace</goal> 
        </goals> 
        <configuration> 
         <includes> 
          <include>${basedir}/target/java-gen/*.java</include> 
         </includes> 
         <replacements> 
          <replacement> 
           <token>Byte</token> 
           <value>byte</value> 
          </replacement> 
         </replacements> 
        </configuration> 
       </execution> 
      </executions> 
     </plugin> 
関連する問題