Class PEFValidator

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<Factory>, Factory, Validator

    public class PEFValidator
    extends AbstractFactory
    implements Validator
    Validates PEF-documents against the official Relax NG schema. Optionally performes additional checks, see the different modes.
    Author:
    Joel HÃ¥kansson
    See Also:
    Serialized Form
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  PEFValidator.Mode
      Defines the modes available to the validator.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String FEATURE_MODE
      Key for getFeature/setFeature, corresponding value should be a PEFValidator.Mode value
    • Constructor Summary

      Constructors 
      Constructor Description
      PEFValidator()
      Creates a new PEFValidator
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object getFeature​(java.lang.String key)
      Gets the value of a feature used by this Factory
      java.lang.Object getProperty​(java.lang.String key)
      Gets the value of a read-only property that applies to all objects returned by this Factory.
      java.io.InputStream getReportStream()
      Gets the report for the latest call to validate
      void setFeature​(java.lang.String key, java.lang.Object value)
      Sets a feature for new Objects returned by this Factory
      boolean validate​(java.net.URL input)
      Validates the resource at the given URL
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.lang.Comparable

        compareTo
    • Constructor Detail

      • PEFValidator

        public PEFValidator()
        Creates a new PEFValidator
    • Method Detail

      • validate

        public boolean validate​(java.net.URL input)
        Description copied from interface: Validator
        Validates the resource at the given URL
        Specified by:
        validate in interface Validator
        Parameters:
        input - the resource URL
        Returns:
        returns true if validation was successful and resource is valid, false otherwise
      • getReportStream

        public java.io.InputStream getReportStream()
        Description copied from interface: Validator
        Gets the report for the latest call to validate
        Specified by:
        getReportStream in interface Validator
        Returns:
        returns an InputStream for the report
      • getFeature

        public java.lang.Object getFeature​(java.lang.String key)
        Description copied from interface: Factory
        Gets the value of a feature used by this Factory
        Specified by:
        getFeature in interface Factory
        Parameters:
        key - the key for the feature
        Returns:
        returns the current value of the feature
      • getProperty

        public java.lang.Object getProperty​(java.lang.String key)
        Description copied from interface: Factory
        Gets the value of a read-only property that applies to all objects returned by this Factory.
        Specified by:
        getProperty in interface Factory
        Parameters:
        key - the name of the property to get
        Returns:
        returns the value associated with this property or null if none is found
      • setFeature

        public void setFeature​(java.lang.String key,
                               java.lang.Object value)
        Description copied from interface: Factory
        Sets a feature for new Objects returned by this Factory
        Specified by:
        setFeature in interface Factory
        Parameters:
        key - the key for the feature
        value - the value of the feature