Class Format

java.lang.Object
fr.gouv.vitam.common.dsl.schema.meta.Format
Direct Known Subclasses:
AnyKeyFormat, ArrayFormat, EnumFormat, KeyChoiceFormat, ObjectFormat, ReferenceFormat, TypeChoiceArrayFormat, TypeChoiceFormat, UnionFormat

public abstract class Format extends Object
Definition of a type of the schema.
  • Constructor Details

    • Format

      public Format()
  • Method Details

    • resolve

      protected abstract void resolve(Schema schema)
      Second phase of initialization, when the Format is associated to the Schema
      Parameters:
      schema - the schema it belongs to.
    • consumeAllFields

      protected void consumeAllFields(com.fasterxml.jackson.databind.JsonNode node, Consumer<String> fieldReport)
    • validate

      public abstract void validate(com.fasterxml.jackson.databind.JsonNode node, Consumer<String> fieldReport, ValidatorEngine validator)
    • walk

      public abstract void walk(Consumer<Format> consumer)
      Execute an action on each node of the TypeDef tree. E.g. to resolve type name of KindReference
      Parameters:
      consumer - the action to do on the node
    • getName

      public String getName()
    • setName

      public void setName(String name)
    • isOptional

      public boolean isOptional()
    • setOptional

      public void setOptional(boolean optional)
    • getHint

      public String getHint()
    • setHint

      public void setHint(String hint)
    • getMin

      public int getMin()
    • setMin

      public void setMin(Integer min)
    • getMax

      public int getMax()
    • setMax

      public void setMax(int max)
    • debugInfo

      public abstract String debugInfo()
      Return a short partial description of the type, useful of DSL users
      Returns:
      a description of the type (e.g. {"$foo":..., "$bar":... })
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • setReportingType

      protected void setReportingType(Format format)
    • getReportingType

      public Format getReportingType()