Enum EXMLIncorrectCharacterHandling

    • Enum Constant Detail

      • WRITE_TO_FILE_NO_LOG

        public static final EXMLIncorrectCharacterHandling WRITE_TO_FILE_NO_LOG
        Write the invalid character to the file. This will result in a file that cannot be read with the Java XML parser.
        This is the fastest option. This is how it was handled in ph-commons ≤ 3.3.6. This option will most probably result in unreadable XML files as no replacement takes place!
      • WRITE_TO_FILE_LOG_WARNING

        public static final EXMLIncorrectCharacterHandling WRITE_TO_FILE_LOG_WARNING
        Write the invalid character to the file. This will result in a file that cannot be read with the Java XML parser.
        This is the second fastest option but will most probably result in unreadable XML files as no replacement takes place!
      • DO_NOT_WRITE_NO_LOG

        public static final EXMLIncorrectCharacterHandling DO_NOT_WRITE_NO_LOG
        Do not write the invalid character to XML and do not log anything. This means silently fixing the problem as the replacement is written.
      • DO_NOT_WRITE_LOG_WARNING

        public static final EXMLIncorrectCharacterHandling DO_NOT_WRITE_LOG_WARNING
        Do not write the invalid character to XML but at least log a warning. Will trigger character replacement.
    • Method Detail

      • values

        public static EXMLIncorrectCharacterHandling[] 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 (EXMLIncorrectCharacterHandling c : EXMLIncorrectCharacterHandling.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static EXMLIncorrectCharacterHandling valueOf​(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:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • isTestRequired

        public boolean isTestRequired()
        Returns:
        true if this handling type requires a check for invalid characters.
      • isReplaceWithNothing

        public boolean isReplaceWithNothing()
        Returns:
        true if all invalid characters should be replaced with nothing, meaning that they are simply ignored on writing.
      • notifyOnInvalidXMLCharacter

        public abstract void notifyOnInvalidXMLCharacter​(@Nonnull @Nonempty
                                                         String sText,
                                                         @Nonnull
                                                         Set<Character> aInvalidChars)
        Called in case XML data contains an invalid character
        Parameters:
        sText - The XML string where the error occurs.
        aInvalidChars - The invalid characters detected within the text