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.ObjectDefinition 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 voidconsumeAllFields(com.fasterxml.jackson.databind.JsonNode node, java.util.function.Consumer<java.lang.String> fieldReport)abstract java.lang.StringdebugInfo()Return a short partial description of the type, useful of DSL usersjava.lang.StringgetHint()intgetMax()intgetMin()java.lang.StringgetName()FormatgetReportingType()booleanisOptional()protected abstract voidresolve(Schema schema)Second phase of initialization, when the Format is associated to the SchemavoidsetHint(java.lang.String hint)voidsetMax(int max)voidsetMin(java.lang.Integer min)voidsetName(java.lang.String name)voidsetOptional(boolean optional)protected voidsetReportingType(Format format)java.lang.StringtoString()abstract voidvalidate(com.fasterxml.jackson.databind.JsonNode node, java.util.function.Consumer<java.lang.String> fieldReport, ValidatorEngine validator)abstract voidwalk(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:
toStringin classjava.lang.Object
-
setReportingType
protected void setReportingType(Format format)
-
getReportingType
public Format getReportingType()
-
-