Class 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 Detail

      • ParserContext

        public ParserContext()
      • ParserContext

        public ParserContext​(boolean validated)
      • ParserContext

        public ParserContext​(boolean validated,
                             boolean isRestDomainSchema)
    • 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.
      • 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 used
        StructuredFieldValidationException - 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