Are you over 18 and want to see adult content?
More Annotations
![A complete backup of catanuniverse.de](https://www.archivebay.com/archive2/583595a3-cb63-4ae5-998f-2c89855d8f58.png)
A complete backup of catanuniverse.de
Are you over 18 and want to see adult content?
![A complete backup of laketexomaonline.com](https://www.archivebay.com/archive2/09af40c9-38f2-4688-ae3d-384980374f09.png)
A complete backup of laketexomaonline.com
Are you over 18 and want to see adult content?
![A complete backup of canaloncelive.tv](https://www.archivebay.com/archive2/bd94169e-1d57-4a35-9189-0684dfa69da5.png)
A complete backup of canaloncelive.tv
Are you over 18 and want to see adult content?
![A complete backup of the-burnout-pad.myshopify.com](https://www.archivebay.com/archive2/5081d2a5-bc16-4a39-a7fb-6edce3eb058e.png)
A complete backup of the-burnout-pad.myshopify.com
Are you over 18 and want to see adult content?
![A complete backup of gourabdesign.com](https://www.archivebay.com/archive2/d32fc531-f8b9-4584-b125-96fdbf4e254c.png)
A complete backup of gourabdesign.com
Are you over 18 and want to see adult content?
![A complete backup of mavericktraveler.com](https://www.archivebay.com/archive2/a5f95ebc-3896-4151-b175-588df7c8fcc6.png)
A complete backup of mavericktraveler.com
Are you over 18 and want to see adult content?
![A complete backup of ugelcanchis.gob.pe](https://www.archivebay.com/archive2/757c3e4a-f8cc-4faf-9c9a-9cee2e5cc0c0.png)
A complete backup of ugelcanchis.gob.pe
Are you over 18 and want to see adult content?
Favourite Annotations
![A complete backup of soogreyhounds.com](https://www.archivebay.com/archive/fd7e9064-bd92-4228-a062-39754ba25aef.png)
A complete backup of soogreyhounds.com
Are you over 18 and want to see adult content?
![A complete backup of ethosproject.blogspot.com](https://www.archivebay.com/archive/ea13e08a-25ac-4459-985c-a76ff283fde5.png)
A complete backup of ethosproject.blogspot.com
Are you over 18 and want to see adult content?
![A complete backup of mycandykitchen.blogspot.com](https://www.archivebay.com/archive/9f34e08b-eef3-405a-88dd-2f5b1df21a5f.png)
A complete backup of mycandykitchen.blogspot.com
Are you over 18 and want to see adult content?
Text
JSONSCHEMA2POJO
produces a property called myArrayProperty of type List in the generated Java type. If items itself declares a complex type ("type" : "object") then the generic type of the List or Set will itself be a generated type e.g. List.required. The 'required' schema rule doesn't produce a structural change in generated Java types, it simply causes the text (Required) to be added WWW.JSONSCHEMA2POJO.ORG www.jsonschema2pojo.orgJSONSCHEMA2POJO
produces a property called myArrayProperty of type List in the generated Java type. If items itself declares a complex type ("type" : "object") then the generic type of the List or Set will itself be a generated type e.g. List.required. The 'required' schema rule doesn't produce a structural change in generated Java types, it simply causes the text (Required) to be added WWW.JSONSCHEMA2POJO.ORG www.jsonschema2pojo.orgJSONSCHEMA2POJO
produces a property called myArrayProperty of type List in the generated Java type. If items itself declares a complex type ("type" : "object") then the generic type of the List or Set will itself be a generated type e.g. List.required. The 'required' schema rule doesn't produce a structural change in generated Java types, it simply causes the text (Required) to be added WWW.JSONSCHEMA2POJO.ORG www.jsonschema2pojo.orgJSONSCHEMA2POJO
produces a property called myArrayProperty of type List in the generated Java type. If items itself declares a complex type ("type" : "object") then the generic type of the List or Set will itself be a generated type e.g. List.required. The 'required' schema rule doesn't produce a structural change in generated Java types, it simply causes the text (Required) to be added WWW.JSONSCHEMA2POJO.ORG www.jsonschema2pojo.orgJSONSCHEMA2POJO
produces a property called myArrayProperty of type List in the generated Java type. If items itself declares a complex type ("type" : "object") then the generic type of the List or Set will itself be a generated type e.g. List.required. The 'required' schema rule doesn't produce a structural change in generated Java types, it simply causes the text (Required) to be added WWW.JSONSCHEMA2POJO.ORG www.jsonschema2pojo.orgJSONSCHEMA2POJO
produces a property called myArrayProperty of type List in the generated Java type. If items itself declares a complex type ("type" : "object") then the generic type of the List or Set will itself be a generated type e.g. List.required. The 'required' schema rule doesn't produce a structural change in generated Java types, it simply causes the text (Required) to be added WWW.JSONSCHEMA2POJO.ORG www.jsonschema2pojo.orgJSONSCHEMA2POJO
produces a property called myArrayProperty of type List in the generated Java type. If items itself declares a complex type ("type" : "object") then the generic type of the List or Set will itself be a generated type e.g. List.required. The 'required' schema rule doesn't produce a structural change in generated Java types, it simply causes the text (Required) to be addedJSONSCHEMA2POJO
produces a property called myArrayProperty of type List in the generated Java type. If items itself declares a complex type ("type" : "object") then the generic type of the List or Set will itself be a generated type e.g. List.required. The 'required' schema rule doesn't produce a structural change in generated Java types, it simply causes the text (Required) to be addedJSONSCHEMA2POJO
produces a property called myArrayProperty of type List in the generated Java type. If items itself declares a complex type ("type" : "object") then the generic type of the List or Set will itself be a generated type e.g. List.required. The 'required' schema rule doesn't produce a structural change in generated Java types, it simply causes the text (Required) to be addedJSONSCHEMA2POJO
produces a property called myArrayProperty of type List in the generated Java type. If items itself declares a complex type ("type" : "object") then the generic type of the List or Set will itself be a generated type e.g. List.required. The 'required' schema rule doesn't produce a structural change in generated Java types, it simply causes the text (Required) to be addedJSONSCHEMA2POJO
produces a property called myArrayProperty of type List in the generated Java type. If items itself declares a complex type ("type" : "object") then the generic type of the List or Set will itself be a generated type e.g. List.required. The 'required' schema rule doesn't produce a structural change in generated Java types, it simply causes the text (Required) to be addedJSONSCHEMA2POJO
produces a property called myArrayProperty of type List in the generated Java type. If items itself declares a complex type ("type" : "object") then the generic type of the List or Set will itself be a generated type e.g. List.required. The 'required' schema rule doesn't produce a structural change in generated Java types, it simply causes the text (Required) to be addedJSONSCHEMA2POJO
produces a property called myArrayProperty of type List in the generated Java type. If items itself declares a complex type ("type" : "object") then the generic type of the List or Set will itself be a generated type e.g. List.required. The 'required' schema rule doesn't produce a structural change in generated Java types, it simply causes the text (Required) to be addedJSONSCHEMA2POJO
produces a property called myArrayProperty of type List in the generated Java type. If items itself declares a complex type ("type" : "object") then the generic type of the List or Set will itself be a generated type e.g. List.required. The 'required' schema rule doesn't produce a structural change in generated Java types, it simply causes the text (Required) to be addedJSONSCHEMA2POJO
produces a property called myArrayProperty of type List in the generated Java type. If items itself declares a complex type ("type" : "object") then the generic type of the List or Set will itself be a generated type e.g. List.required. The 'required' schema rule doesn't produce a structural change in generated Java types, it simply causes the text (Required) to be addedJSONSCHEMA2POJO
produces a property called myArrayProperty of type List in the generated Java type. If items itself declares a complex type ("type" : "object") then the generic type of the List or Set will itself be a generated type e.g. List.required. The 'required' schema rule doesn't produce a structural change in generated Java types, it simply causes the text (Required) to be addedJSONSCHEMA2POJO
produces a property called myArrayProperty of type List in the generated Java type. If items itself declares a complex type ("type" : "object") then the generic type of the List or Set will itself be a generated type e.g. List.required. The 'required' schema rule doesn't produce a structural change in generated Java types, it simply causes the text (Required) to be addedJSONSCHEMA2POJO
produces a property called myArrayProperty of type List in the generated Java type. If items itself declares a complex type ("type" : "object") then the generic type of the List or Set will itself be a generated type e.g. List.required. The 'required' schema rule doesn't produce a structural change in generated Java types, it simply causes the text (Required) to be addedJSONSCHEMA2POJO
produces a property called myArrayProperty of type List in the generated Java type. If items itself declares a complex type ("type" : "object") then the generic type of the List or Set will itself be a generated type e.g. List.required. The 'required' schema rule doesn't produce a structural change in generated Java types, it simply causes the text (Required) to be addedJSONSCHEMA2POJO
produces a property called myArrayProperty of type List in the generated Java type. If items itself declares a complex type ("type" : "object") then the generic type of the List or Set will itself be a generated type e.g. List.required. The 'required' schema rule doesn't produce a structural change in generated Java types, it simply causes the text (Required) to be addedJSONSCHEMA2POJO
produces a property called myArrayProperty of type List in the generated Java type. If items itself declares a complex type ("type" : "object") then the generic type of the List or Set will itself be a generated type e.g. List.required. The 'required' schema rule doesn't produce a structural change in generated Java types, it simply causes the text (Required) to be addedFork me on GitHub
jsonschema2pojo
Generate Plain Old Java Objects from JSON or JSON-Schema. { "type":"object", "properties": { "foo": { "type": "string" }, "bar": { "type": "integer" }, "baz": { "type": "boolean" } } }1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
"type":"object",
"properties":Â {
"foo":Â {
"type":Â "string"
},
"bar":Â {
"type":Â "integer"
},
"baz":Â {
"type":Â "boolean"
}
}
}
Preview __ Zip __
Package
Class name
Target language:
Java Scala
Source type:
JSON Schema JSON
YAML Schema YAML
Annotation style:
Jackson 2.x Jackson 1.x Gson Moshi None Generate builder methods Use primitive types Use long integers Use double numbers Use Joda dates Use Commons-Lang3 Include getters and setters Include constructors Include hashCode and equals Include toString Include JSR-303 annotations Allow additional properties Make classes serializable Make classes parcelable Initialize collections Property word delimiters: × Copy to Clipboard __PREVIEW
Use this tool offline:Maven plugin
Gradle plugin
Ant task
CLI
Java API
REFERENCE
PROPERTIES
For each property present in the 'properties' definition, we add a property to a given Java class according to the JavaBeans spec.
A private field is added to the parent class, along with accompanying accessor methods (getter and setter).E.g. json schema
{
"type"Â :Â "object","properties"Â :Â {
"foo"Â :Â {
"type"Â :Â "string"
}
}
}
resulting Java type: public class MyObject { private String foo; public String getFoo() {return foo;
}
public void setFoo(String foo) {this.foo = foo;
}
}
If the generate-builders property is set to true, then a builder method is also added: public MyObject withFoo(String foo) {this.foo = foo;
return this;
}
These builder methods allow easy, one-liner construction and initialization of objects, like: MyObject o = new MyObject().withFoo("foo").withBar("bar").withBaz("baz");TYPE
When encountering the type attribute (e.g. for properties), jsonschema2pojo maps schema types as follows:SCHEMA TYPE
JAVA TYPE
string
java.lang.String
number
java.lang.Double
integer
java.lang.Integer
boolean
java.lang.Boolean
object
_generated Java type_array
java.util.List
array (with "uniqueItems":true)java.util.Set
null
java.lang.Object
any
java.lang.Object
When applying the usePrimitives option, the primitives double, integer and boolean will replace the wrapper types listed above. ADDITIONALPROPERTIES If additionalProperties is specified and set to the boolean value false, then the generated Java type does not support additionalproperties.
If the additionalProperties node is undefined (not present), null or empty, then a new bean property named "additionalProperties", of type Map{
"type"Â :Â "object"
}
or
{
"type"Â :Â "object", "additionalProperties"Â :Â {}}
produces:
public class MyObject { private java.util.Map}
@org.codehaus.jackson.annotate.JsonAnySetter public void setAdditionalProperties(String name, Object value) { this.additionalProperties.put(name, value);}
}
If the additionalProperties node is present and specifies a schema, then an "additionalProperties" map is added to the generated type and map values will be restricted according to the additionalPropertiesschema.
So, schema file myObject.json like:{
"type"Â :Â "object", "additionalProperties"Â :Â {"type"Â :Â "number"
}
}
produces:
public class MyObject { private java.util.Map}
@org.codehaus.jackson.annotate.JsonAnySetter public void setAdditionalProperties(String name, Double value) { this.additionalProperties.put(name, value);}
}
Where the additionalProperties schema species a type object, map values will be restricted to instances of a newly generated Java type. If the given schema does not specify the =javaType= property, the name of the newly generated type will be derived from the parent type name and the suffix 'Property'. So, schema file myObject.json like:{
"type"Â :Â "object", "additionalProperties"Â :Â {"type"Â :Â "object"
}
}
produces:
public class MyObject { private java.util.Map}
@org.codehaus.jackson.annotate.JsonAnySetter public void setAdditionalProperties(String name, MyObjectProperty value) { this.additionalProperties.put(name, value);}
}
ITEMS
The 'items' rule defines a schema for the contents of an array. In generated Java types, the value of 'items' dictates the generic typeof Lists and Sets.
So, this example JSON Schema:{
"type"Â :Â "object","properties"Â :Â {
"myArrayProperty"Â :Â {"type"Â :Â "array",
"items"Â :Â {
"type"Â :Â "string"
}
}
}
}
produces a property called myArrayProperty of type ListREQUIRED
The 'required' schema rule doesn't produce a structural change in generated Java types, it simply causes the text (Required) to be added to the JavaDoc for fields, getters and setters.OPTIONAL
The 'optional' schema rule doesn't produce a structural change in generated Java types, it simply causes the text (Optional) to be added to the JavaDoc for fields, getters and setters. This schema rule is deprecated since Draft 03 of the JSON Schema specification. Rather than marking _optional_ properties as _optional_, one should mark _required_ properties as _required_.UNIQUEITEMS
For properties of type 'array', setting uniqueItems to false (or omitting it entirely) causes the generated Java property to be of typejava.util.List.
When uniqueItems is set to true, the generated Java property value is of type java.util.Set.ENUM
When _jsonschema2pojo_ encounters JSON Schema declarations of type "enum" it generates a Java enum type.
When a generated type includes a property of type "enum", the generated enum type becomes a static inner type declared within the enclosing (parent) generated type. If an enum is declared at the root of a schema, the generated enum is a public Java type with noenclosing type.
The actual enum value is held in a 'value' property inside the enum constants. The generated enum type also includes annotations that allow Jackson to correctly marshal/unmarshal JSON values, even when the actual values contain spaces, start with digits, or contain other characters that cannot legally form part of the Java enum constantname.
So, if we declare a schema myObject.json with an enum property:{
"type"Â :Â "object","properties"Â :Â {
"myEnum"Â :Â {
"type"Â :Â "string","enum"Â :
}
}
}
we see a generated MyObject Java type with an inner enum type like: @Generated("com.googlecode.jsonschema2pojo") public static enum MyEnum {ONE("one"),
SECOND_ONE("secondOne"), _3_RD_ONE("3rd one"); private final String value; private MyEnum(String value) { this.value = value;}
@JsonValue
@Override
public String toString() {return this.value;
}
@JsonCreator
public static MyObject.MyEnum fromValue(String value) { for (MyObject.MyEnum c: MyObject.MyEnum.values()) { if (c.value.equals(value)) {return c;
}
}
throw new IllegalArgumentException(value);}
}
DEFAULT
Using the default rule in your JSON Schema causes the corresponding property in your generated Java type to be initialised with a default value. You'll see the default value is assigned during fielddeclaration.
Default values are supported for the JSON Schema properties of type string, integer, number and boolean; for enum properties; for properties with format of utc-millisec or date-time; for arrays of anyof these types.
Some example JSON Schema property definitions and their corresponding Java field declaration are shown:_JSON SCHEMA_
_JAVA_
myString : { "type":"string", "default":"abc"} private String myString = "abc"; myInteger : { "type":"integer", "default":"100"} private Integer myInteger = 100; myNumber : { "type":"number", "default":"10.3"} private Double myNumber = 10.3D; myMillis : { "type":"string", "format":"utc-millisec","default":"500"}
private Long myMillis = 500L; myDate : { "type":"string", "format":"date-time", "default":"500"} private Date myDate = new Date(500L); myDate : { "type":"string", "format":"date-time", "default":"2011-02-24T09:25:23.112+0000"} private Date myDate = new Date(1298539523112L); myList : { "type":"array", "default":} private ListTITLE
The 'title' rule appearing in a JSON Schema causes the given title text to be added to the JavaDoc for a property. The title text will appear in JavaDoc comments of the field, getter and setter. title text always appears before description text.DESCRIPTION
The description rule appearing in a JSON Schema causes the given description text to be added to the JavaDoc for a property. The description text will appear in JavaDoc comments of the field, getterand setter.
description text always appears after title text.FORMAT
Using the format rule for a property can influence the Java type chosen to represent your property values. When you use a format value that _jsonschema2pojo_ recognises, it will use a better (more appropriate) type for your Java bean property. For example, when I define a JSON property in my schema of type string, if I also attach the rule "format" : "uri" to that property (because my string is actually a URI) then my corresponding Java property will now have the type java.net.URI instead ofjava.lang.String.
How _jsonschema2pojo_ maps format values to Java types:FORMAT VALUE
JAVA TYPE
"date-time"
java.util.Date
"date"
String
"time"
String
"utc-millisec"
long
"regex"
java.util.regex.Pattern"color"
String
"style"
String
"phone"
String
"uri"
java.net.URI
"email"
String
"ip-address"
String
"ipv6"
String
"host-name"
String
"uuid"
java.util.UUID
anything else (unrecognised format)type is unchanged
EXTENDS
When the extends rule is encountered in your JSON schema (to indicate that one type extends another), this will produce an extends relationship in your generated Java types. That extends value can be a schema given in-line, or referenced using $ref. As an example, lets imagine a file flower.json with the followingcontent:
{
"type"Â :Â "object"
}
and a second file rose.json which contains:{
"type"Â :Â "object","extends"Â :Â {
"$ref"Â :Â "flower.json"}
}
The two resulting Java types generated from these schemas would be: public class Flower {....
}
and
public class Rose extends Flower {....
}
Note: the extends rule in JSON schema accepts a schema or an array of schemas - _jsonschema2pojo_ only supports the single schema variant.$REF
A '$ref' rule can be used wherever a schema is expected i.e at the root of a schema document, as part of a property definition, as part of the items definition for an array type, as part of an additionalProperties definition. Supported protocols:* http://, https://
* file://
* classpath:, resource:, java: (all synonyms used to resolve schemas from the classpath). NOTE: If you want to refer to classpath resources from the CURRENT Maven module, you will need to bind jsonschema2pojo to a later phase. By default jsonschema2pojo is bound to generate-sources but if you want resources present in the current module to be on the classpath when the plugin executes, then you should bind jsonschema2pojo to the process-resources phase. For example, to refer to another document in the same directory which will provide the definition of a 'user' object, you might create aschema like:
{
"type"Â :Â "object","properties"Â :Â {
"loggedInUser"Â :Â { "$ref"Â :Â "user.json"}
}
}
jsonschema2pojo expects $ref values (URIs) to be URLs. Both absolute and relative URLs are valid. You may also refer to part of a schema document using the '#' character followed by a slash or dot delimitedpath.
Example using an absolute reference:{
"type"Â :Â "object","properties"Â :Â {
"address"Â :Â {
"$ref"Â :Â "http://json-schema.org/address"}
}
}
Example using a fragment path to reuse a schema definition:{
"type"Â :Â "object","properties"Â :Â {
"child1"Â :Â {
"type"Â :Â "string"
},
"child2"Â :Â {
"$ref"Â :Â "#/properties/child1"}
}
}
Example treeNode.json using a self reference to build a tree:{
"description" : "Tree node", "type" : "object","properties" : {
"children"Â :Â {
"type"Â :Â "array",
"items"Â :Â {
"$ref"Â :Â "#"
}
}
}
}
which produces Java code similar to: public class TreeNode { public List}
MINIMUM/MAXIMUM, MINITEMS/MAXITEMS, MINLENGTH/MAXLENGTH, REQUIRED,PATTERN
The Maven plugin, CLI and Ant task allow JSR-303 annotations to be activated via a config argument. When activated, the following JSR-303 annotations will be generated:SCHEMA RULE
ANNOTATION
maximum
@DecimalMax
minimum
@DecimalMin
minItems,maxItems
@Size
minLength,maxLength
@Size
pattern
@Pattern
required
@NotNull
EXTENSIONS
JAVATYPE
jsonschema2pojo supports an extension property 'javaType' that applies to schemas and allows you to specify a fully qualified name for your generated Java type. For example, imagine a schema fooBar.json like:{
"type"Â :Â "object"
}
When invoking jsonschema2pojo with package argument com.example the generated Java type will have a fully qualified name ofcom.example.FooBar.
If the javaType property is added to fooBar.json like:{
"javaType"Â :Â "com.other.package.CustomTypeName","type"Â :Â "object"
}
Then invoking jsonschema2pojo with package argument com.example will result in a generated Java type with a fully qualified name of com.other.package.CustomTypeName. The javaType property may appear in any schema definition, not just the root schema in a schema document. For example, this file 'parent.json' invoked using package name com.example:{
"type"Â :Â "object","properties"Â :Â {
"myProperty"Â :Â {
"javaType"Â :Â "com.other.package.CustomChildName","type"Â :Â "object"
}
}
}
will result in two generated Java types: * com.example.Parent * com.other.package.CustomChildName The javaType property also allows EXISTING Java types to be used in your POJOs. If the value of javaType refers to an existing class or interface on the classpath, then that class/interface will be used (a new Java type will not be generated). When referencing existing classes, it's also possible to supply generic type arguments, for instance:{
"type"Â :Â "object","properties"Â :Â {
"myProperty"Â :Â {
"javaType"Â :Â "java.util.Map"type"Â :Â "object"
}
}
}
JAVAENUMNAMES
Any schema that makes use of enum may include javaEnumNames. This property allows you to take control of naming your Java enum constants and avoid relying on auto-generated names. If your schema includes javaEnumNames like:{
"type"Â :Â "object","properties"Â :Â {
"foo"Â :Â {
"type"Â :Â "string","enum"Â :Â ,
"javaEnumNames"Â :
}
}
}
Then you'll see a generated type like: public enum Foo {HIGH("H"),
LOW("L")
...
}
JAVAINTERFACES
Any schema may include a javaInterfaces property, the value of this property is an array of strings. Each string is expected to contain the fully-qualified name of a Java interface. The Java type generated by the schema will implement all the given interfaces. If the javaInterfaces property is added to fooBar.json like:{
"javaInterfaces"Â :Â ,"type"Â :Â "object"
}
then the result will be a class defined like: public class FooBar implements Serializable, Cloneable{
...
JAVAJSONVIEW
Any schema may include a javaJsonView property, the value of the property is a fully qualified class name. The property causes a @JsonView annotation to be added to the member with the given class for a value. This only works for Jackson-based annotators. It is supported for v1 and v2 Jackson. See Jackson Annotations.
If javaJsonView is added to fooBar.json schema as follows:{
"type":Â "object",
"properties":Â {
"internalStatus":Â { "javaJsonView":Â "com.example.views.Internal","type":Â "string"
}
}
}
Then the resulting FooBar.java will have: import com.example.views.Internal; public class FooBar { @JsonView(Internal.class) private String internalStatus;}
JAVANAME
Using javaName rule allows you to define custom names for java bean properties instead of those inferred from the corresponding json property names. This also affects setters and getters. For example, the following schema:{
"type":Â "object",
"properties":Â {
"a":Â {
"javaName":Â "b",
"type":Â "string"
}
}
}
will produce Java code similar to the following: public class MyClass {@JsonProperty("a")
private String b;
@JsonProperty("a")
public String getB() {return b;
}
@JsonProperty("a")
public void setB(String b) {this.b = b;
}
}
CUSTOMPATTERN/CUSTOMTIMEZONE Set a custom format pattern for date or date-time fields that will be used during serialization (if your binding library supports it). If you're using Jackson 2 this will cause an @JsonFormat annotation to be added. For 'date-time' fields you may also set a custom timezone (if you want to use a timezone other than UTC when writing out the date-time as a string).{
"type"Â :Â "object","properties"Â :Â {
"dob"Â :Â {
"type"Â :Â "string", "format"Â :Â "date", "customPattern"Â :Â "yy-MM-dd"},
"updatedDate"Â :Â {
"type"Â :Â "string", "format"Â :Â "date-time", "customDateTimePattern"Â :Â "yyyy-MM-dd'T'HH:mm:ssZ", "customTimezone":Â "PDT"}
}
}
There are two important things to note before using this extensionproperty:
* If you set the FORMATDATES/FORMATDATETIMES global config options to true, you'll get default ISO-8601/RFC 3339 formatting without having to set these custom properties. * You should be aware that setting a custom date or date-time pattern may mean that the JSON content you produce is not valid according to the rules of JSON Schema. EXCLUDEDFROMEQUALSANDHASHCODE You can specify which fields should be omitted in the generated equals() and hashCode() methods using the excludedFromEqualsAndHashCode rule. These fields can be either listed in an object-level array or flagged individually. This option is only meaningful if equals() and hashCode() generationis enabled.
{
"type":Â "object",
"excludedFromEqualsAndHashCode"Â :Â ,"properties":Â {
"notExcluded"Â :Â {
"type"Â :Â "string"
},
"excludedByProperty"Â :Â { "type"Â :Â "string", "excludedFromEqualsAndHashCode"Â :Â true}
}
In the above example, only notExcluded will be inlcuded in equals()and hashCode().
© 2012-2018 Joe LittlejohnDetails
Copyright © 2024 ArchiveBay.com. All rights reserved. Terms of Use | Privacy Policy | DMCA | 2021 | Feedback | Advertising | RSS 2.0