public enum EXMLIncorrectCharacterHandling extends Enum<EXMLIncorrectCharacterHandling>
| Enum Constant and Description |
|---|
DO_NOT_WRITE_LOG_WARNING
Do not write the invalid character to XML but at least log a warning.
|
DO_NOT_WRITE_NO_LOG
Do not write the invalid character to XML and do not log anything.
|
THROW_EXCEPTION
Throw an
IllegalArgumentException in case of incorrect XML
characters. |
WRITE_TO_FILE_LOG_WARNING
Write the invalid character to the file.
|
WRITE_TO_FILE_NO_LOG
Write the invalid character to the file.
|
| Modifier and Type | Field and Description |
|---|---|
static EXMLIncorrectCharacterHandling |
DEFAULT
The default setting as it was in previous versions of ph-commons
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
isNotifyRequired() |
boolean |
isReplaceWithNothing() |
boolean |
isTestRequired() |
abstract void |
notifyOnInvalidXMLCharacter(String sText,
Set<Character> aInvalidChars)
Called in case XML data contains an invalid character
|
static EXMLIncorrectCharacterHandling |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static EXMLIncorrectCharacterHandling[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final EXMLIncorrectCharacterHandling THROW_EXCEPTION
IllegalArgumentException in case of incorrect XML
characters.public static final EXMLIncorrectCharacterHandling WRITE_TO_FILE_NO_LOG
public static final EXMLIncorrectCharacterHandling WRITE_TO_FILE_LOG_WARNING
public static final EXMLIncorrectCharacterHandling DO_NOT_WRITE_NO_LOG
public static final EXMLIncorrectCharacterHandling DO_NOT_WRITE_LOG_WARNING
public static final EXMLIncorrectCharacterHandling DEFAULT
public static EXMLIncorrectCharacterHandling[] values()
for (EXMLIncorrectCharacterHandling c : EXMLIncorrectCharacterHandling.values()) System.out.println(c);
public static EXMLIncorrectCharacterHandling valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic boolean isTestRequired()
true if this handling type requires a check for
invalid characters.public boolean isNotifyRequired()
true notifyOnInvalidXMLCharacter(String, Set)
should be invoked for this type?public boolean isReplaceWithNothing()
true if all invalid characters should be replaced with
nothing, meaning that they are simply ignored on writing.public abstract void notifyOnInvalidXMLCharacter(@Nonnull @Nonempty String sText, @Nonnull Set<Character> aInvalidChars)
sText - The XML string where the error occurs.aInvalidChars - The invalid characters detected within the textCopyright © 2014–2017 Philip Helger. All rights reserved.