@Override
    public JDefinedClass apply(String nodeName, JsonNode node, JsonNode parent, JDefinedClass jclass, Schema schema) {

        if (node != null && node.isBoolean() && node.asBoolean() == false) {
            // no additional properties allowed
            return jclass;
        }

        if (!this.ruleFactory.getGenerationConfig().isIncludeAdditionalProperties()) {
            // no additional properties allowed
            return jclass;
        }

        if (!ruleFactory.getAnnotator().isAdditionalPropertiesSupported()) {
            // schema allows additional properties, but serializer library can't support them
            return jclass;
        }

        JType propertyType;
        if (node != null && node.size() != 0) {
            propertyType = ruleFactory.getSchemaRule().apply(nodeName + "Property", node, parent, jclass, schema);
        } else {
            propertyType = jclass.owner().ref(Object.class);
        }

        JFieldVar field = addAdditionalPropertiesField(jclass, propertyType);

        addGetter(jclass, field);

        addSetter(jclass, propertyType, field);

        if (ruleFactory.getGenerationConfig().isIncludeJsr303Annotations()) {
            ruleFactory.getValidRule().apply(nodeName, node, parent, field, schema);
        }

        if (ruleFactory.getGenerationConfig().isGenerateBuilders()) {
            addBuilder(jclass, propertyType, field);
        }

        return jclass;
    }
@ Override public JDefinedClass apply ( String nodeName , JsonNode node , JsonNode parent , JDefinedClass jclass , Schema schema ) { if ( node != null && node . isBoolean ( ) && node . asBoolean ( ) == false ) { return jclass ; } if ( ! this . ruleFactory . getGenerationConfig ( ) . isIncludeAdditionalProperties ( ) ) { return jclass ; } if ( ! ruleFactory . getAnnotator ( ) . isAdditionalPropertiesSupported ( ) ) { return jclass ; } JType propertyType ; if ( node != null && node . size ( ) != 0 ) { propertyType = ruleFactory . getSchemaRule ( ) . apply ( nodeName + "Property" , node , parent , jclass , schema ) ; } else { propertyType = jclass . owner ( ) . ref ( Object . class ) ; } JFieldVar field = addAdditionalPropertiesField ( jclass , propertyType ) ; addGetter ( jclass , field ) ; addSetter ( jclass , propertyType , field ) ; if ( ruleFactory . getGenerationConfig ( ) . isIncludeJsr303Annotations ( ) ) { ruleFactory . getValidRule ( ) . apply ( nodeName , node , parent , field , schema ) ; } if ( ruleFactory . getGenerationConfig ( ) . isGenerateBuilders ( ) ) { addBuilder ( jclass , propertyType , field ) ; } return jclass ; }
Applies this schema rule to take the required code generation steps.
<p>
If additionalProperties is specified and set to the boolean value
<code>false</code>, this rule does not make any change to the generated
Java type (the type does not allow additional properties).
<p>
If the additionalProperties node is <code>null</code> (not specified in
the schema) or empty, then a new bean property named
"additionalProperties", of type {@link Map}{@literal <String,Object>} is
added to the generated type (with appropriate accessors). The accessors
are annotated to allow unrecognised (additional) properties found in JSON
data to be marshalled/unmarshalled from/to this map.
<p>
If the additionalProperties node is present and specifies a schema, then
an "additionalProperties" map is added to the generated type. This time
the map values will be restricted and must be instances of a newly
generated Java type that will be created based on the
additionalProperties schema provided. If the schema does not specify the
javaType property, the name of the newly generated type will be derived
from the nodeName and the suffix 'Property'.

@param nodeName
the name of the schema node for which the additionalProperties
node applies
@param node
the additionalProperties node itself, found in the schema (may
be null if not specified in the schema)
@param jclass
the Java type that is being generated to represent this schema
@return the given Java type jclass