Class DMNValidatorImpl

  • All Implemented Interfaces:
    DMNValidator

    public class DMNValidatorImpl
    extends java.lang.Object
    implements DMNValidator
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static org.slf4j.Logger LOG  
    • Constructor Summary

      Constructors 
      Constructor Description
      DMNValidatorImpl​(java.lang.ClassLoader cl, java.util.List<org.kie.dmn.core.compiler.DMNProfile> dmnProfiles, java.util.Properties p)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void dispose()
      Release all resources associated with this DMNValidator.
      javax.xml.validation.Schema getOverrideSchema()  
      void setOverrideSchema​(javax.xml.validation.Schema overrideSchema)  
      java.util.List<org.kie.dmn.api.core.DMNMessage> validate​(java.io.File xmlFile)
      Validate the model and return the results.
      java.util.List<org.kie.dmn.api.core.DMNMessage> validate​(java.io.File xmlFile, DMNValidator.Validation... options)
      Validate the model and return the results.
      java.util.List<org.kie.dmn.api.core.DMNMessage> validate​(java.io.Reader reader)
      Validate the model and return the results.
      java.util.List<org.kie.dmn.api.core.DMNMessage> validate​(java.io.Reader reader, DMNValidator.Validation... options)
      Validate the model and return the results.
      java.util.List<org.kie.dmn.api.core.DMNMessage> validate​(org.kie.api.io.Resource resource)
      Validate the model and return the results.
      java.util.List<org.kie.dmn.api.core.DMNMessage> validate​(org.kie.api.io.Resource resource, DMNValidator.Validation... options)
      Validate the model and return the results.
      java.util.List<org.kie.dmn.api.core.DMNMessage> validate​(org.kie.dmn.model.api.Definitions dmnModel)
      Validate the model and return the results.
      java.util.List<org.kie.dmn.api.core.DMNMessage> validate​(org.kie.dmn.model.api.Definitions dmnModel, DMNValidator.Validation... options)
      Validate the model and return the results.
      DMNValidator.ValidatorBuilder validateUsing​(DMNValidator.Validation... options)
      Fluent interface to validate several models using the specified options.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • LOG

        public static final org.slf4j.Logger LOG
    • Constructor Detail

      • DMNValidatorImpl

        public DMNValidatorImpl​(java.lang.ClassLoader cl,
                                java.util.List<org.kie.dmn.core.compiler.DMNProfile> dmnProfiles,
                                java.util.Properties p)
    • Method Detail

      • dispose

        public void dispose()
        Description copied from interface: DMNValidator
        Release all resources associated with this DMNValidator.
        Specified by:
        dispose in interface DMNValidator
      • getOverrideSchema

        public javax.xml.validation.Schema getOverrideSchema()
      • setOverrideSchema

        public void setOverrideSchema​(javax.xml.validation.Schema overrideSchema)
      • validateUsing

        public DMNValidator.ValidatorBuilder validateUsing​(DMNValidator.Validation... options)
        Description copied from interface: DMNValidator
        Fluent interface to validate several models using the specified options. This API is specifically designed to validate Models which DMN-Import other DMN Models. The options field defines which validations to apply. E.g.: validateUsing( VALIDATE_MODEL, VALIDATE_COMPILATION ).theseModels(reader0, reader1)
        Specified by:
        validateUsing in interface DMNValidator
        Parameters:
        options - selects which validations to apply
        Returns:
        a fluent interface builder to validate several models with.
      • validate

        public java.util.List<org.kie.dmn.api.core.DMNMessage> validate​(org.kie.dmn.model.api.Definitions dmnModel)
        Description copied from interface: DMNValidator
        Validate the model and return the results. This is the same as invoking method
        Specified by:
        validate in interface DMNValidator
        Parameters:
        dmnModel - the model to validate
        Returns:
        returns a list of messages from the validation, or an empty list otherwise.
      • validate

        public java.util.List<org.kie.dmn.api.core.DMNMessage> validate​(org.kie.dmn.model.api.Definitions dmnModel,
                                                                        DMNValidator.Validation... options)
        Description copied from interface: DMNValidator
        Validate the model and return the results. The options field defines which validations to apply. E.g.: validate( dmnModel, VALIDATE_MODEL, VALIDATE_COMPILATION ) IMPORTANT: this method does not support VALIDATE_SCHEMA. In order to validate the schema, please use one of the other signatures of this method, like @{link #validate(Reader reader, Validation... options)}.
        Specified by:
        validate in interface DMNValidator
        Parameters:
        dmnModel - the model to validate
        options - selects which validations to apply
        Returns:
        returns a list of messages from the validation, or an empty list otherwise.
      • validate

        public java.util.List<org.kie.dmn.api.core.DMNMessage> validate​(java.io.File xmlFile)
        Description copied from interface: DMNValidator
        Validate the model and return the results. This is the same as invoking method
        Specified by:
        validate in interface DMNValidator
        Parameters:
        xmlFile - the file to validate
        Returns:
        returns a list of messages from the validation, or an empty list otherwise.
        See Also:
        DMNValidator.validate(Resource)
      • validate

        public java.util.List<org.kie.dmn.api.core.DMNMessage> validate​(java.io.File xmlFile,
                                                                        DMNValidator.Validation... options)
        Description copied from interface: DMNValidator
        Validate the model and return the results. The options field defines which validations to apply. E.g.: validate( xmlFile, VALIDATE_MODEL, VALIDATE_COMPILATION )
        Specified by:
        validate in interface DMNValidator
        Parameters:
        xmlFile - the model to validate
        options - selects which validations to apply
        Returns:
        returns a list of messages from the validation, or an empty list otherwise.
        See Also:
        DMNValidator.validate(Resource, Validation...)
      • validate

        public java.util.List<org.kie.dmn.api.core.DMNMessage> validate​(java.io.Reader reader)
        Description copied from interface: DMNValidator
        Validate the model and return the results. This is the same as invoking method
        Specified by:
        validate in interface DMNValidator
        Parameters:
        reader - a reader for the model to validate
        Returns:
        returns a list of messages from the validation, or an empty list otherwise.
        See Also:
        DMNValidator.validate(Resource)
      • validate

        public java.util.List<org.kie.dmn.api.core.DMNMessage> validate​(java.io.Reader reader,
                                                                        DMNValidator.Validation... options)
        Description copied from interface: DMNValidator
        Validate the model and return the results. The options field defines which validations to apply. E.g.: validate( reader, VALIDATE_MODEL, VALIDATE_COMPILATION )
        Specified by:
        validate in interface DMNValidator
        Parameters:
        reader - the model to validate
        options - selects which validations to apply
        Returns:
        returns a list of messages from the validation, or an empty list otherwise.
        See Also:
        DMNValidator.validate(Resource, Validation...)
      • validate

        public java.util.List<org.kie.dmn.api.core.DMNMessage> validate​(org.kie.api.io.Resource resource)
        Description copied from interface: DMNValidator
        Validate the model and return the results. This is the same as invoking method DMNValidator.validate(Resource, Validation...) with option Validation.VALIDATE_MODEL
        Specified by:
        validate in interface DMNValidator
        Returns:
        returns a list of messages from the validation, or an empty list otherwise.
      • validate

        public java.util.List<org.kie.dmn.api.core.DMNMessage> validate​(org.kie.api.io.Resource resource,
                                                                        DMNValidator.Validation... options)
        Description copied from interface: DMNValidator
        Validate the model and return the results. The options field defines which validations to apply. E.g.: validate( resource, VALIDATE_MODEL, VALIDATE_COMPILATION )
        Specified by:
        validate in interface DMNValidator
        Parameters:
        resource - the Resource containing the DMN model to validate
        options - selects which validations to apply
        Returns:
        returns a list of messages from the validation, or an empty list otherwise.