Class ElementValidator

    • Constructor Detail

      • ElementValidator

        public ElementValidator​(Schema schema)
        Constructs a ElementValidator with a Schema to use to validate Elements.
        Parameters:
        schema - the Schema to use to validate Elements.
      • ElementValidator

        public ElementValidator​(Schema schema,
                                boolean includeIsA)
        Constructs a ElementValidator with a Schema to use to validate Elements. Uses the includeIsA flag to determine whether the IsA validate functions should be used. Disabling them can be useful when you already know the data is of the correct type and therefore you are able to improve the performance.
        Parameters:
        schema - the Schema to use to validate Elements.
        includeIsA - if true then the ISA validate functions are used, otherwise they are skipped.
      • ElementValidator

        public ElementValidator​(View view)
        Constructs a ElementValidator with a View to use to validate Elements.
        Parameters:
        view - the View to use to validate Elements.
    • Method Detail

      • validate

        public boolean validate​(Element element)
        Description copied from interface: Validator
        Validates the given object.
        Specified by:
        validate in interface Validator<Element>
        Parameters:
        element - the Element to validate
        Returns:
        true if the provided Element is valid, otherwise false and the reason will be logged.
      • validateWithValidationResult

        public uk.gov.gchq.koryphe.ValidationResult validateWithValidationResult​(Element element)
        Description copied from interface: Validator

        Validates the given object and results a ValidationResult that can contain information as to why validation fails.

        It is less efficient than just calling validate as complex validation strings may be built to detail why objects are invalid.

        Specified by:
        validateWithValidationResult in interface Validator<Element>
        Parameters:
        element - an object of type T to validate.
        Returns:
        the ValidationResult.
      • validateInput

        public boolean validateInput​(Element element)
      • validateAggregation

        public boolean validateAggregation​(Element element)
      • validateTransform

        public boolean validateTransform​(Element element)
      • validateWithSchema

        public boolean validateWithSchema​(Element element)
      • getSchema

        public Schema getSchema()
      • getView

        public View getView()