Class ParserContext
- java.lang.Object
-
- com.aquima.interactions.communication.impl.evaluator.parser.ParserContext
-
public class ParserContext extends Object
Parser context for parsing web services. The current implementation provides attribute validation functionality only. Note that instances of this class are not intended to be re-used.- Since:
- 9.3
- Author:
- A.Pragt
-
-
Constructor Summary
Constructors Constructor Description ParserContext()
ParserContext(boolean validated)
ParserContext(boolean validated, boolean isRestDomainSchema)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasMessages()
Returns an indicator whether validation messages are present.protected void
setBodyTree(SchemaEntity root)
protected void
throwRestException()
REST: Throws an validation exception based on the validation messages.protected void
throwSoapException()
SOAP: Throws an validation exception based on the validation messages.void
validate(SchemaArgument argument)
void
validate(SchemaAttribute attribute)
void
validate(SchemaFragment fragment)
void
validate(SchemaHeader header)
void
validate(SchemaRelation relation)
void
validate(String attribute, IFieldValidationDefinition[] validations, InstanceContext ctx)
Validates an attribute with use of the specified field validations.
-
-
-
Method Detail
-
validate
public void validate(String attribute, IFieldValidationDefinition[] validations, InstanceContext ctx)
Validates an attribute with use of the specified field validations.- Parameters:
attribute
- The attribute to validate, not null, not empty.validations
- The validations to use, not null.ctx
- The instance context to use, not null.
-
validate
public void validate(SchemaAttribute attribute)
-
validate
public void validate(SchemaRelation relation)
-
validate
public void validate(SchemaArgument argument)
-
validate
public void validate(SchemaFragment fragment)
-
validate
public void validate(SchemaHeader header)
-
hasMessages
public boolean hasMessages()
Returns an indicator whether validation messages are present.- Returns:
- Message indicator.
-
setBodyTree
protected void setBodyTree(SchemaEntity root)
-
throwRestException
protected void throwRestException() throws FieldValidationException, StructuredFieldValidationException
REST: Throws an validation exception based on the validation messages. This method does not throw an exception when no validation messages are present (when the validate method has not been executed, or when no validation messages were registered during the validation).- Throws:
FieldValidationException
- when there are validation messages and basic validation is usedStructuredFieldValidationException
- when there are validation messages and structured validation is used
-
throwSoapException
protected void throwSoapException() throws FieldValidationException
SOAP: Throws an validation exception based on the validation messages. This method does not throw an exception when no validation messages are present (when the validate method has not been executed, or when no validation messages were registered during the validation).- Throws:
FieldValidationException
- when there are validation messages
-
-