public interface IGenerator
Modifier and Type | Method and Description |
---|---|
default Iterator<org.json.JSONObject> |
createIterator(JSONSchema schema)
Creates an iterator over the documents this generator can produce.
|
default Iterator<org.json.JSONObject> |
createIterator(JSONSchema schema,
boolean canGenerateInvalid)
Creates an iterator over the documents this generator can produce.
|
default Iterator<org.json.JSONObject> |
createIterator(JSONSchema schema,
int maxDocumentDepth)
Creates an iterator over the documents this generator can produce up to the
given document depth.
|
Iterator<org.json.JSONObject> |
createIterator(JSONSchema schema,
int documentDepth,
boolean canGenerateInvalid)
Creates an iterator over the documents this generator can produce up to the
given document depth.
|
default Iterator<org.json.JSONObject> createIterator(JSONSchema schema)
next()
.
The depth of the documents is not bounded, i.e., they can be an infinite
number of documents if the schema is recursive.
Only valid documents are generated.schema
- The schemadefault Iterator<org.json.JSONObject> createIterator(JSONSchema schema, int maxDocumentDepth)
next()
.
The depth of the documents is bounded, i.e., in any document, there can only
be at most maxDocumentDepth
nested objects and arrays.
Note that if the bound is set too low, only invalid documents may be
generated as the deepest objects or arrays may not be correct.
In particular, no documents will be generated with a depth of zero.
Only valid documents are generated.schema
- The schemamaxDocumentDepth
- The maximal depth of the documentsdefault Iterator<org.json.JSONObject> createIterator(JSONSchema schema, boolean canGenerateInvalid)
next()
.
The depth of the documents is not bounded, i.e., they can be an infinite
number of documents if the schema is recursive.
Invalid documents can be generated if canGenerateInvalid
is
true
.
Note that valid documents can still be generated, no matter the value of
canGenerateInvalid
.schema
- The schemacanGenerateInvalid
- Whether invalid documents can be generatedIterator<org.json.JSONObject> createIterator(JSONSchema schema, int documentDepth, boolean canGenerateInvalid)
next()
.
The depth of the documents is bounded, i.e., in any document, there can only
be at most maxDocumentDepth
nested objects and arrays.
Note that if the bound is set too low, only invalid documents may be
generated as the deepest objects or arrays may not be correct.
In particular, no documents will be generated with a depth of zero.
Invalid documents can be generated if canGenerateInvalid
is
true
.
Note that valid documents can still be generated, no matter the value of
canGenerateInvalid
.schema
- The schemadocumentDepth
- The maximal depth of the documentscanGenerateInvalid
- Whether invalid documents can be generatedCopyright © 2022. All rights reserved.