Skip to content
This repository was archived by the owner on May 26, 2020. It is now read-only.

Definition

Shaun Francis edited this page Sep 7, 2017 · 1 revision

Overview

The Generator works by transforming JSON Schemas into an intermediate model that represents only the information required for generating Java Classes.

Definition Model

All Definition types implement the Definition interface:

public interface Definition {

    String getFieldName();
    DefinitionType type();
    boolean isRequired();
    void setRequired(final boolean required);
}
  • DefinitionType - This is an enumeration of types
    • ARRAY, BOOLEAN, CLASS, COMBINED, ENUM, INTEGER, NUMBER, REFERENCE, ROOT, STRING

Definition Hierarchy

  • Definition
    • FieldDefinition - Base level implementation of Definition interface. Can be of type BOOLEAN, INTEGER, NUMBER, STRING
      • ClassDefinition - Access to child definitions. Can be of type ARRAY, CLASS or ROOT.
        • CombinedDefinition - Special case for handling child definitions in Combined Schemas. Type COMBINED
        • ReferenceDefinition - Access the $ref value. Type REFERENCE
      • EnumDefinition - Access enum values. Type ENUM
Clone this wiki locally