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 Details

  • Method Details

    • hasMessages

      public boolean hasMessages()
      Returns an indicator whether validation messages are present.
      Returns:
      Message indicator.
    • 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)
    • createMessage

      public ParseMessage createMessage(String propertyName, String errorMessageKey)
      Creates a ParseMessage based on the value of the parameter errormessageKey. If this message is not defined, this method uses the key-value as the actual errormessage.
      Parameters:
      propertyName - the property name to create the message for
      errorMessageKey - The key of the error message
      Returns:
      ParseMessage A ParseMessage
    • createMessage

      public ParseMessage createMessage(String propertyName, String errorMessageKey, String... parameters)
      Creates a ParseMessage based on the value of the parameter errormessageKey. If this message is not defined, this method uses the key-value as the actual errormessage.
      Parameters:
      propertyName - the property name to create the message for
      errorMessageKey - The key of the error message
      parameters - The parameters to add to the error message's placeholders
      Returns:
      ParseMessage A ParseMessage
    • setBodyTree

      protected void setBodyTree(SchemaEntity root)
    • throwRestRequestException

      protected void throwRestRequestException()
      REST: Throws an validation exception based on the validation messages generated while parsing a REST request. 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 used
      StructuredFieldValidationException - when there are validation messages and structured validation is used
    • throwRestResponseException

      protected void throwRestResponseException()
      REST: Throws an validation exception based on the validation messages generated while parsing a REST response. 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 otherwise
    • throwSoapException

      protected void throwSoapException()
      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