Package com.networknt.schema
Class ExecutionContext
- java.lang.Object
-
- com.networknt.schema.ExecutionContext
-
public class ExecutionContext extends Object
Stores the execution context for the validation run.
-
-
Constructor Summary
Constructors Constructor Description ExecutionContext()Creates an execution context.ExecutionContext(CollectorContext collectorContext)Creates an execution context.ExecutionContext(ExecutionConfig executionConfig)Creates an execution context.ExecutionContext(ExecutionConfig executionConfig, CollectorContext collectorContext)Creates an execution context.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddError(Error error)voidevaluationPathAddLast(int token)voidevaluationPathAddLast(String token)voidevaluationPathRemoveLast()voidexecutionConfig(Consumer<ExecutionConfig.Builder> customizer)Customize the execution configuration.AnnotationsgetAnnotations()CollectorContextgetCollectorContext()Gets the collector context.Map<NodePath,DiscriminatorState>getDiscriminatorMapping()List<Error>getErrors()NodePathgetEvaluationPath()ArrayDeque<Schema>getEvaluationSchema()ArrayDeque<Object>getEvaluationSchemaPath()ExecutionConfiggetExecutionConfig()Gets the execution configuration.WalkConfiggetWalkConfig()Gets the walk configuration.booleanisFailFast()Determines if the validator should immediately throw a fail fast exception if an error has occurred.booleanisUnevaluatedItemsPresent()booleanisUnevaluatedPropertiesPresent()voidsetCollectorContext(CollectorContext collectorContext)Sets the collector context.voidsetErrors(List<Error> errors)voidsetExecutionConfig(ExecutionConfig executionConfig)Sets the execution configuration.voidsetFailFast(boolean failFast)Sets if the validator should immediately throw a fail fast exception if an error has occurred.voidsetUnevaluatedItemsPresent(boolean set)voidsetUnevaluatedPropertiesPresent(boolean set)voidsetWalkConfig(WalkConfig walkConfig)Sets the walk configuration.voidwalkConfig(Consumer<WalkConfig.Builder> customizer)Customize the walk configuration.
-
-
-
Constructor Detail
-
ExecutionContext
public ExecutionContext()
Creates an execution context.
-
ExecutionContext
public ExecutionContext(CollectorContext collectorContext)
Creates an execution context.- Parameters:
collectorContext- the collector context
-
ExecutionContext
public ExecutionContext(ExecutionConfig executionConfig)
Creates an execution context.- Parameters:
executionConfig- the execution configuration
-
ExecutionContext
public ExecutionContext(ExecutionConfig executionConfig, CollectorContext collectorContext)
Creates an execution context.- Parameters:
executionConfig- the execution configurationcollectorContext- the collector context
-
-
Method Detail
-
getEvaluationPath
public NodePath getEvaluationPath()
-
evaluationPathAddLast
public void evaluationPathAddLast(String token)
-
evaluationPathAddLast
public void evaluationPathAddLast(int token)
-
evaluationPathRemoveLast
public void evaluationPathRemoveLast()
-
getEvaluationSchema
public ArrayDeque<Schema> getEvaluationSchema()
-
getEvaluationSchemaPath
public ArrayDeque<Object> getEvaluationSchemaPath()
-
getDiscriminatorMapping
public Map<NodePath,DiscriminatorState> getDiscriminatorMapping()
-
setWalkConfig
public void setWalkConfig(WalkConfig walkConfig)
Sets the walk configuration.- Parameters:
walkConfig- the walk configuration
-
getWalkConfig
public WalkConfig getWalkConfig()
Gets the walk configuration.- Returns:
- the walk configuration
-
getCollectorContext
public CollectorContext getCollectorContext()
Gets the collector context.- Returns:
- the collector context
-
setCollectorContext
public void setCollectorContext(CollectorContext collectorContext)
Sets the collector context.- Parameters:
collectorContext- the collector context
-
getExecutionConfig
public ExecutionConfig getExecutionConfig()
Gets the execution configuration.- Returns:
- the execution configuration
-
setExecutionConfig
public void setExecutionConfig(ExecutionConfig executionConfig)
Sets the execution configuration.- Parameters:
executionConfig- the execution configuration
-
getAnnotations
public Annotations getAnnotations()
-
isFailFast
public boolean isFailFast()
Determines if the validator should immediately throw a fail fast exception if an error has occurred.This defaults to the execution config fail fast at the start of the execution.
- Returns:
- true if fail fast
-
setFailFast
public void setFailFast(boolean failFast)
Sets if the validator should immediately throw a fail fast exception if an error has occurred.- Parameters:
failFast- true to fail fast
-
addError
public void addError(Error error)
-
executionConfig
public void executionConfig(Consumer<ExecutionConfig.Builder> customizer)
Customize the execution configuration.- Parameters:
customizer- the customizer
-
walkConfig
public void walkConfig(Consumer<WalkConfig.Builder> customizer)
Customize the walk configuration.- Parameters:
customizer- the customizer
-
isUnevaluatedPropertiesPresent
public boolean isUnevaluatedPropertiesPresent()
-
isUnevaluatedItemsPresent
public boolean isUnevaluatedItemsPresent()
-
setUnevaluatedPropertiesPresent
public void setUnevaluatedPropertiesPresent(boolean set)
-
setUnevaluatedItemsPresent
public void setUnevaluatedItemsPresent(boolean set)
-
-