Enum ParseConfiguration.UniqueRootElementPresence

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<ParseConfiguration.UniqueRootElementPresence>
    Enclosing class:
    ParseConfiguration

    public static enum ParseConfiguration.UniqueRootElementPresence
    extends java.lang.Enum<ParseConfiguration.UniqueRootElementPresence>

    Enumeration used for determining the behaviour the parser should have with respect to the presence and number of root elements in the parsed document.

    Root elements are the elements that appear at the root of the document (e.g. <html> in complete HTML documents). This enumeration allows requiring that the root element is unique always, requiring it only if a document prolog (XML Declaration or DOCTYPE) is present, or not validating this at all.

    This enumeration is used at the ParseConfiguration class.

    • Field Detail

      • requiredAlways

        private final boolean requiredAlways
      • dependsOnPrologDoctype

        private final boolean dependsOnPrologDoctype
    • Constructor Detail

      • UniqueRootElementPresence

        private UniqueRootElementPresence​(boolean requiredAlways,
                                          boolean dependsOnPrologDoctype)
    • Method Detail

      • values

        public static ParseConfiguration.UniqueRootElementPresence[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (ParseConfiguration.UniqueRootElementPresence c : ParseConfiguration.UniqueRootElementPresence.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static ParseConfiguration.UniqueRootElementPresence valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • isRequiredAlways

        public boolean isRequiredAlways()
      • isDependsOnPrologDoctype

        public boolean isDependsOnPrologDoctype()