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 java.lang.Object
Definition of a type of the schema.
-
-
Constructor Summary
Constructors Constructor Description Format()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
consumeAllFields(com.fasterxml.jackson.databind.JsonNode node, java.util.function.Consumer<java.lang.String> fieldReport)
abstract java.lang.String
debugInfo()
Return a short partial description of the type, useful of DSL usersjava.lang.String
getHint()
int
getMax()
int
getMin()
java.lang.String
getName()
Format
getReportingType()
boolean
isOptional()
protected abstract void
resolve(Schema schema)
Second phase of initialization, when the Format is associated to the Schemavoid
setHint(java.lang.String hint)
void
setMax(int max)
void
setMin(java.lang.Integer min)
void
setName(java.lang.String name)
void
setOptional(boolean optional)
protected void
setReportingType(Format format)
java.lang.String
toString()
abstract void
validate(com.fasterxml.jackson.databind.JsonNode node, java.util.function.Consumer<java.lang.String> fieldReport, ValidatorEngine validator)
abstract void
walk(java.util.function.Consumer<Format> consumer)
Execute an action on each node of the TypeDef tree.
-
-
-
Method Detail
-
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, java.util.function.Consumer<java.lang.String> fieldReport)
-
validate
public abstract void validate(com.fasterxml.jackson.databind.JsonNode node, java.util.function.Consumer<java.lang.String> fieldReport, ValidatorEngine validator)
-
walk
public abstract void walk(java.util.function.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 java.lang.String getName()
-
setName
public void setName(java.lang.String name)
-
isOptional
public boolean isOptional()
-
setOptional
public void setOptional(boolean optional)
-
getHint
public java.lang.String getHint()
-
setHint
public void setHint(java.lang.String hint)
-
getMin
public int getMin()
-
setMin
public void setMin(java.lang.Integer min)
-
getMax
public int getMax()
-
setMax
public void setMax(int max)
-
debugInfo
public abstract java.lang.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 java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
setReportingType
protected void setReportingType(Format format)
-
getReportingType
public Format getReportingType()
-
-