Modifier | Constructor and Description |
---|---|
protected |
TypeRule(RuleFactory ruleFactory) |
Modifier and Type | Method and Description |
---|---|
com.sun.codemodel.JType |
apply(String nodeName,
com.fasterxml.jackson.databind.JsonNode node,
com.fasterxml.jackson.databind.JsonNode parent,
com.sun.codemodel.JClassContainer jClassContainer,
Schema schema)
Applies this schema rule to take the required code generation steps.
|
protected TypeRule(RuleFactory ruleFactory)
public com.sun.codemodel.JType apply(String nodeName, com.fasterxml.jackson.databind.JsonNode node, com.fasterxml.jackson.databind.JsonNode parent, com.sun.codemodel.JClassContainer jClassContainer, Schema schema)
When applied, this rule reads the details of the given node to determine the appropriate Java type to return. This may be a newly generated type,
it may be a primitive type or other type such as String
or Object
.
JSON schema types and their Java type equivalent:
Object
Set
or
List
, see ArrayRule
boolean
int
Object
double
ObjectRule
)
String
(or alternative based
on presence of "format", see FormatRule
)
apply
in interface Rule<com.sun.codemodel.JClassContainer,com.sun.codemodel.JType>
nodeName
- the name of the node for which this "type" rule appliesnode
- the node for which this "type" rule appliesparent
- the parent nodejClassContainer
- the package into which any newly generated type may be placedschema
- the schema to which this schema rule (and the given node)
belongs.Copyright © 2022. All rights reserved.