Interface IDomainSchemaValidator
public interface IDomainSchemaValidator
Prepares attributes for validation and provides the validate method that has to be called after all the registrations
are done. The chosen data structure depends on the implementation.
- Since:
- 11.3
- Author:
- Voicu Moldovan, Petru Galanton
-
Method Summary
Modifier and TypeMethodDescriptionReturns the name of the root element of the validated message.void
registerArgument
(SchemaArgument argument) void
registerAttribute
(SchemaAttribute attribute) Registers an attribute that was parsed in a REST message based on a domain schema.void
registerEntity
(SchemaEntity entity) Registers an entity instance that was parsed in a REST message based on a domain schema.void
registerFragment
(SchemaFragment fragment) void
registerHeader
(SchemaHeader header) void
registerRelation
(SchemaRelation relation) Registers a relation that was parsed in a REST message based on a domain schema.void
registerRoot
(EntityValue reference) Registers the reference to the root entity instance in a REST message based on a domain schema.void
validate
(ParserContext parserContext) Iterate each registered attribute and relation in the data structure and call the validate method on it.
-
Method Details
-
registerEntity
Registers an entity instance that was parsed in a REST message based on a domain schema.- Parameters:
entity
- the entity instance that was parsed
-
registerRelation
Registers a relation that was parsed in a REST message based on a domain schema.- Parameters:
relation
- the relation that should be registered
-
registerAttribute
Registers an attribute that was parsed in a REST message based on a domain schema.- Parameters:
attribute
- the attribute that should be registered
-
registerRoot
Registers the reference to the root entity instance in a REST message based on a domain schema. The root entity instance should already be registered withregisterEntity(SchemaEntity)
when this method is called. The purpose of this method is to indicate to the validator which of the registered entity instances is the root instance.- Parameters:
reference
- the reference to the root entity instance
-
registerArgument
- Parameters:
argument
- Schema agrument with name, values and validations
-
registerFragment
- Parameters:
fragment
- Schema fragment with name, value and validations
-
registerHeader
- Parameters:
header
- Schema header with name, values and validations
-
validate
Iterate each registered attribute and relation in the data structure and call the validate method on it.- Parameters:
parserContext
- Context that is used for validation
-
getRootName
String getRootName()Returns the name of the root element of the validated message. When the message is XML, this name should be equal to the tag name of the root XML element. The name may also be null, for example in JSON format, the root object doesn't have a name.- Returns:
- the root name, may be null.
-