Class XmlEncodingUtils
java.lang.Object
org.frankframework.util.XmlEncodingUtils
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic StringdecodeChars(String string) Translates the five reserved XML characters (< > & " ') to their normal selvesstatic StringencodeChars(char[] chars, int offset, int length, boolean escapeNewLines) Translates special characters to xml equivalents like > and &.static @Nullable StringencodeChars(@Nullable String string) static @Nullable StringencodeChars(@Nullable String string, boolean escapeNewLines) Translates special characters to XML equivalents like > and &.static @Nullable StringencodeCharsAndReplaceNonValidXmlCharacters(@Nullable String string) static booleanisPrintableUnicodeChar(int c) static booleanisPrintableUnicodeChar(int c, boolean allowUnicodeSupplementaryCharacters) static @Nullable Stringstatic @Nullable StringreadXml(InputStream inputStream, String defaultCharset) Reads binary XML data and uses the XML declaration encoding to turn it into character data.static intreplaceNonPrintableCharacters(char[] buf, int offset, int len) Replaces non-unicode-characters by '0x00BF' (inverted question mark).static @Nullable StringreplaceNonValidXmlCharacters(@Nullable String string) Replaces non-unicode-characters by '0x00BF' (inverted question mark) appended with #, the character number and ;.static @Nullable StringreplaceNonValidXmlCharacters(@Nullable String string, char to, boolean appendCharNum, boolean allowUnicodeSupplementaryCharacters) static StringstripNonValidXmlCharacters(String string, boolean allowUnicodeSupplementaryCharacters)
-
Field Details
-
REPLACE_NON_XML_CHAR
public static final char REPLACE_NON_XML_CHAR- See Also:
-
-
Method Details
-
encodeChars
-
encodeChars
Translates special characters to XML equivalents like > and &. Please note that non-valid XML chars are not changed, hence you might want to usereplaceNonValidXmlCharacters(String)orstripNonValidXmlCharacters(String, boolean)too. -
encodeCharsAndReplaceNonValidXmlCharacters
-
encodeChars
Translates special characters to xml equivalents like > and &. Please note that non-valid xml chars are not changed, hence you might want to usereplaceNonValidXmlCharacters(String)orstripNonValidXmlCharacters(String, boolean)too. -
decodeChars
-
replaceNonPrintableCharacters
public static int replaceNonPrintableCharacters(char[] buf, int offset, int len) Replaces non-unicode-characters by '0x00BF' (inverted question mark). -
replaceNonValidXmlCharacters
-
replaceNonValidXmlCharacters
-
stripNonValidXmlCharacters
-
isPrintableUnicodeChar
public static boolean isPrintableUnicodeChar(int c) -
isPrintableUnicodeChar
public static boolean isPrintableUnicodeChar(int c, boolean allowUnicodeSupplementaryCharacters) -
readXml
public static @Nullable String readXml(InputStream inputStream, String defaultCharset) throws IOException Reads binary XML data and uses the XML declaration encoding to turn it into character data.- Throws:
IOException
-
readXml
public static @Nullable String readXml(byte[] source, String defaultEncoding) throws UnsupportedEncodingException - Throws:
UnsupportedEncodingException
-