Class Ruleset

    • Constructor Detail

      • Ruleset

        public Ruleset()
    • Method Detail

      • getName

        public String getName()
      • findRule

        public Rule findRule​(MimeType providedType,
                             String targetType)
        Return the first rule in the Ruleset matching the given MimeType or null if there are no matching rules. Matching is performed according to the following algorithm:
        • If there is a <target> subsection matching the given targetType, rules from this section are examined first. If a matching rule is found, it is returned.
        • If there is no matching target section or no rule from a matching target section is applicable, global rules are examined. If a matching global rule is found, it is returned.
        • Otherwise null is returned.
        Parameters:
        providedType - the MIME type of source stream
        targetType - MIME type of the desired taret format
        Returns:
        the first rule in the Ruleset matching the given MIME type
      • load

        public static Ruleset load​(URI location)
                            throws JAXBException,
                                   IOException
        Load the ruleset from the given location.
        Parameters:
        location - location of the ruleset
        Returns:
        a ruleset from the given location
        Throws:
        JAXBException - in case of XML errors
        IOException - if an I/O error occurs