Modifier | Constructor and Description |
---|---|
protected |
SchemaRule(RuleFactory ruleFactory) |
Modifier and Type | Method and Description |
---|---|
com.sun.codemodel.JType |
apply(String nodeName,
com.fasterxml.jackson.databind.JsonNode schemaNode,
com.fasterxml.jackson.databind.JsonNode parent,
com.sun.codemodel.JClassContainer generatableType,
Schema schema)
Applies this schema rule to take the required code generation steps.
|
protected SchemaRule(RuleFactory ruleFactory)
public com.sun.codemodel.JType apply(String nodeName, com.fasterxml.jackson.databind.JsonNode schemaNode, com.fasterxml.jackson.databind.JsonNode parent, com.sun.codemodel.JClassContainer generatableType, Schema schema)
At the root of a schema document this rule should be applied (schema documents contain a schema), but also in many places within the document. Each property of type "object" is itself defined by a schema, the items attribute of an array is a schema, the additionalProperties attribute of a schema is also a schema.
Where the schema value is a $ref, the ref URI is assumed to be applicable as a URL (from which content will be read). Where the ref URI has been encountered before, the root Java type created by that schema will be re-used (generation steps won't be repeated).
apply
in interface Rule<com.sun.codemodel.JClassContainer,com.sun.codemodel.JType>
schema
- the schema within which this schema rule is being appliednodeName
- the name of the JSON schema nodeschemaNode
- the JSON schema node that has caused this rule to be appliedparent
- the JSON parent of node
generatableType
- A code generation construct to which this rule should be
appliedCopyright © 2022. All rights reserved.