public class Jsonschema2PojoMojo extends AbstractMojo implements GenerationConfig
| Constructor and Description |
|---|
Jsonschema2PojoMojo() |
| Modifier and Type | Method and Description |
|---|---|
void |
execute()
Executes the plugin, to read the given source and behavioural properties
and generate POJOs.
|
AnnotationStyle |
getAnnotationStyle()
Gets the 'annotationStyle' configuration option.
|
String |
getClassNamePrefix()
Gets the 'getClassNamePrefix' configuration option.
|
String |
getClassNameSuffix()
Gets the 'getClassNameSuffix' configuration option.
|
Class<? extends Annotator> |
getCustomAnnotator()
Gets the 'customAnnotator' configuration option.
|
String |
getCustomDatePattern()
Gets the 'customDatePattern' configuration option
|
String |
getCustomDateTimePattern()
Gets the 'customDateTimePattern' configuration option
|
Class<? extends RuleFactory> |
getCustomRuleFactory()
Gets the 'customRuleFactory' configuration option.
|
String |
getDateTimeType()
Gets the `dateTimeType` configuration option.
|
String |
getDateType()
Gets the `dateType` configuration option.
|
String[] |
getFileExtensions()
Gets the 'fileExtensions' configuration option.
|
FileFilter |
getFileFilter()
Gets the file filter used to isolate the schema mapping files in the
source directories.
|
InclusionLevel |
getInclusionLevel()
Gets the 'inclusionLevel' option for Jackson1 and Jackson2 serializers.
|
String |
getOutputEncoding()
Gets the 'outputEncoding' configuration option.
|
char[] |
getPropertyWordDelimiters()
Gets the 'propertyWordDelimiters' configuration option.
|
String |
getRefFragmentPathDelimiters()
Gets the `refFragmentPathDelimiters` configuration option.
|
Iterator<URL> |
getSource()
Gets the 'source' configuration option.
|
SourceType |
getSourceType()
Gets the 'sourceType' configuration option.
|
File |
getTargetDirectory()
Gets the 'targetDirectory' configuration option.
|
String |
getTargetPackage()
Gets the 'targetPackage' configuration option.
|
String |
getTargetVersion()
Gets the 'targetVersion' configuration option.
|
String |
getTimeType()
Gets the `timeType` configuration option.
|
boolean |
isConstructorsRequiredPropertiesOnly()
Gets the 'constructorsRequiredPropertiesOnly' configuration option
|
boolean |
isFormatDates()
Gets the `formatDates` configuration option
|
boolean |
isFormatDateTimes()
Gets the `formatDateTime` configuration option
|
boolean |
isGenerateBuilders()
Gets the 'generateBuilders' configuration option.
|
boolean |
isIncludeAccessors()
Gets the 'includeAccessors' configuration option.
|
boolean |
isIncludeAdditionalProperties()
Gets the 'includeAdditionalProperties' configuration option.
|
boolean |
isIncludeConstructors()
Gets the 'includeConstructors' configuration option.
|
boolean |
isIncludeDynamicAccessors()
Gets the `includeDynamicAccessors` configuraiton option.
|
boolean |
isIncludeHashcodeAndEquals()
Gets the 'includeHashcodeAndEquals' configuration option.
|
boolean |
isIncludeJsr303Annotations()
Gets the 'includeJsr303Annotations' configuration option.
|
boolean |
isIncludeJsr305Annotations()
Gets the 'includeJsr305Annotations' configuration option.
|
boolean |
isIncludeToString()
Gets the 'includeToString' configuration option.
|
boolean |
isInitializeCollections()
Gets the 'initializeCollections' configuration option.
|
boolean |
isParcelable()
Gets the 'parcelable' configuration option.
|
boolean |
isRemoveOldOutput()
Gets the 'removeOldOutput' configuration option.
|
boolean |
isSerializable()
Gets the 'serializable' configuration option.
|
boolean |
isUseBigDecimals()
Gets the 'useBigDecimals' configuration option.
|
boolean |
isUseBigIntegers()
Gets the 'useBigIntegers' configuration option.
|
boolean |
isUseCommonsLang3()
Gets the 'useCommonsLang3' configuration option.
|
boolean |
isUseDoubleNumbers()
Gets the 'useDoubleNumbers' configuration option.
|
boolean |
isUseJodaDates()
Gets the 'useJodaDates' configuration option.
|
boolean |
isUseJodaLocalDates()
Gets the 'useJodaLocalDates' configuration option.
|
boolean |
isUseJodaLocalTimes()
Gets the 'useJodaLocalTimes' configuration option.
|
boolean |
isUseLongIntegers()
Gets the 'useLongIntegers' configuration option.
|
boolean |
isUsePrimitives()
Gets the 'usePrimitives' configuration option.
|
public void execute()
throws MojoExecutionException
MojoExecutionExceptionpublic boolean isGenerateBuilders()
GenerationConfigisGenerateBuilders in interface GenerationConfigwithXxx(value) (that return this),
alongside the standard, void-return setters.public File getTargetDirectory()
GenerationConfiggetTargetDirectory in interface GenerationConfigpublic Iterator<URL> getSource()
GenerationConfiggetSource in interface GenerationConfigpublic boolean isUsePrimitives()
GenerationConfigisUsePrimitives in interface GenerationConfiglong, double
, boolean) instead of wrapper types where possible
when generating bean properties (has the side-effect of making
those properties non-null).public String getTargetPackage()
GenerationConfiggetTargetPackage in interface GenerationConfigpublic char[] getPropertyWordDelimiters()
GenerationConfiggetPropertyWordDelimiters in interface GenerationConfigpublic boolean isUseLongIntegers()
GenerationConfigisUseLongIntegers in interface GenerationConfiglong (or
Long) instead of int (or
Integer) when representing the JSON Schema type
'integer'.public boolean isUseDoubleNumbers()
GenerationConfigisUseDoubleNumbers in interface GenerationConfigdouble (or
Double) instead of float (or
Float) when representing the JSON Schema type
'number'.public boolean isIncludeHashcodeAndEquals()
GenerationConfigisIncludeHashcodeAndEquals in interface GenerationConfighashCode and
equals methods in generated Java types.public boolean isIncludeToString()
GenerationConfigisIncludeToString in interface GenerationConfigtoString method in
generated Java types.public AnnotationStyle getAnnotationStyle()
GenerationConfiggetAnnotationStyle in interface GenerationConfigSupported values:
jackson1 (apply annotations from the
Jackson 1.x library)
jackson2 (apply annotations from the
Jackson 2.x library)gson (apply annotations from the
gson
library)moshi1 (apply annotations from the
moshi library)none (apply no annotations at all)AnnotatorFactorypublic InclusionLevel getInclusionLevel()
GenerationConfiggetInclusionLevel in interface GenerationConfigSupported values
ALWAYSNON_ABSENTNON_DEFAULTNON_EMPTYNON_NULLUSE_DEFAULTSInclusionLevelpublic Class<? extends Annotator> getCustomAnnotator()
GenerationConfiggetCustomAnnotator in interface GenerationConfigGenerationConfig.getAnnotationStyle()public Class<? extends RuleFactory> getCustomRuleFactory()
GenerationConfiggetCustomRuleFactory in interface GenerationConfigpublic boolean isIncludeJsr303Annotations()
GenerationConfigisIncludeJsr303Annotations in interface GenerationConfigpublic boolean isIncludeJsr305Annotations()
GenerationConfigisIncludeJsr305Annotations in interface GenerationConfigpublic SourceType getSourceType()
GenerationConfiggetSourceType in interface GenerationConfigSupported values:
jsonschemajsonpublic boolean isRemoveOldOutput()
GenerationConfigisRemoveOldOutput in interface GenerationConfigpublic String getOutputEncoding()
GenerationConfiggetOutputEncoding in interface GenerationConfigpublic boolean isUseJodaDates()
GenerationConfigisUseJodaDates in interface GenerationConfigDateTime instead of
Date when adding date type fields to generated
Java types.public boolean isUseJodaLocalDates()
GenerationConfigisUseJodaLocalDates in interface GenerationConfigLocalDate instead of string
when adding string type fields with a format of date (not
date-time) to generated Java types.public boolean isUseJodaLocalTimes()
GenerationConfigisUseJodaLocalTimes in interface GenerationConfigLocalTime instead of string
when adding string type fields with a format of time (not
date-time) to generated Java types.public boolean isUseCommonsLang3()
GenerationConfigisUseCommonsLang3 in interface GenerationConfigpublic boolean isParcelable()
GenerationConfigisParcelable in interface GenerationConfigpublic boolean isSerializable()
GenerationConfigisSerializable in interface GenerationConfigpublic FileFilter getFileFilter()
GenerationConfiggetFileFilter in interface GenerationConfigpublic boolean isInitializeCollections()
GenerationConfigisInitializeCollections in interface GenerationConfigpublic String getClassNamePrefix()
GenerationConfiggetClassNamePrefix in interface GenerationConfigpublic String getClassNameSuffix()
GenerationConfiggetClassNameSuffix in interface GenerationConfigpublic String[] getFileExtensions()
GenerationConfiggetFileExtensions in interface GenerationConfigpublic boolean isIncludeConstructors()
GenerationConfigisIncludeConstructors in interface GenerationConfigpublic boolean isConstructorsRequiredPropertiesOnly()
GenerationConfigisConstructorsRequiredPropertiesOnly in interface GenerationConfigpublic boolean isIncludeAdditionalProperties()
GenerationConfigisIncludeAdditionalProperties in interface GenerationConfigpublic boolean isIncludeAccessors()
GenerationConfigisIncludeAccessors in interface GenerationConfigpublic String getTargetVersion()
GenerationConfiggetTargetVersion in interface GenerationConfigpublic boolean isIncludeDynamicAccessors()
GenerationConfigisIncludeDynamicAccessors in interface GenerationConfigpublic String getDateTimeType()
GenerationConfigExample values:
org.joda.time.LocalDateTime (Joda)java.time.LocalDateTime (JSR310)null (default behavior)getDateTimeType in interface GenerationConfigDate when
adding date type fields to generate Java types.public String getDateType()
GenerationConfigExample values:
org.joda.time.LocalDate (Joda)java.time.LocalDate (JSR310)null (default behavior)getDateType in interface GenerationConfigpublic String getTimeType()
GenerationConfigExample values:
org.joda.time.LocalTime (Joda)java.time.LocalTime (JSR310)null (default behavior)getTimeType in interface GenerationConfigpublic boolean isUseBigIntegers()
GenerationConfigisUseBigIntegers in interface GenerationConfigBigInteger instead
of int (or Integer) when
representing the JSON Schema type 'integer'. Note that this
configuration overrides GenerationConfig.isUseLongIntegers().public boolean isUseBigDecimals()
GenerationConfigisUseBigDecimals in interface GenerationConfigBigDecimal instead
of float (or Float) when
representing the JSON Schema type 'number'. Note that this
configuration overrides GenerationConfig.isUseDoubleNumbers().public boolean isFormatDateTimes()
GenerationConfigisFormatDateTimes in interface GenerationConfigdate-type have the
@JsonFormat annotation with pattern set to the
default value of yyyy-MM-dd'T'HH:mm:ss.SSSZpublic boolean isFormatDates()
GenerationConfigisFormatDates in interface GenerationConfigdate have the
@JsonFormat annotation with pattern set to the
default value of yyyy-MM-ddpublic String getCustomDatePattern()
GenerationConfiggetCustomDatePattern in interface GenerationConfigpublic String getCustomDateTimePattern()
GenerationConfiggetCustomDateTimePattern in interface GenerationConfigpublic String getRefFragmentPathDelimiters()
GenerationConfiggetRefFragmentPathDelimiters in interface GenerationConfigCopyright © 2017. All rights reserved.