Package com.helger.xml.serialize.write
Class XMLMaskHelper
java.lang.Object
com.helger.xml.serialize.write.XMLMaskHelper
This class contains all the methods for masking XML content.
- Author:
- Philip Helger
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetHTMLEntityReferenceString(char c) Get the entity reference for the specified character.static char[]getMaskedXMLText(EXMLSerializeVersion eXMLVersion, EXMLCharMode eXMLCharMode, EXMLIncorrectCharacterHandling eIncorrectCharHandling, String s) static intgetMaskedXMLTextLength(EXMLVersion eXMLVersion, EXMLCharMode eXMLCharMode, EXMLIncorrectCharacterHandling eIncorrectCharHandling, String s) static intgetMaskedXMLTextLength(EXMLSerializeVersion eXMLVersion, EXMLCharMode eXMLCharMode, EXMLIncorrectCharacterHandling eIncorrectCharHandling, String s) static StringgetXML10EntityReferenceString(char c) Get the entity reference for the specified character.static StringgetXML11EntityReferenceString(char c) Get the entity reference for the specified character.static StringgetXMLNumericReference(char n) static voidmaskXMLTextTo(EXMLSerializeVersion eXMLVersion, EXMLCharMode eXMLCharMode, EXMLIncorrectCharacterHandling eIncorrectCharHandling, char[] aSrcText, int nOfs, int nLen, Writer aWriter) static voidmaskXMLTextTo(EXMLSerializeVersion eXMLVersion, EXMLCharMode eXMLCharMode, EXMLIncorrectCharacterHandling eIncorrectCharHandling, String s, Writer aWriter)
-
Method Details
-
getXMLNumericReference
-
getXML10EntityReferenceString
Get the entity reference for the specified character. This returns e.g. < for '<' etc. This method has special handling for <, >, &, " and '. All other chars are encoded by their numeric value (e.g. È)- Parameters:
c- Character to use.- Returns:
- The entity reference string. Never
nullnor empty.
-
getXML11EntityReferenceString
Get the entity reference for the specified character. This returns e.g. < for '<' etc. This method has special handling for <, >, &, " and '. All other chars are encoded by their numeric value (e.g. È)- Parameters:
c- Character to use.- Returns:
- The entity reference string. Never
nullnor empty.
-
getHTMLEntityReferenceString
Get the entity reference for the specified character. This returns e.g.<for '<' etc. This method has special handling for <, >, & and ". All other chars are encoded by their numeric value (e.g.È). In contrast togetXML10EntityReferenceString(char)this method does not handle'- Parameters:
c- Character to use.- Returns:
- The entity reference string. Never
nullnor empty.
-
getMaskedXMLText
@Nonnull public static char[] getMaskedXMLText(@Nonnull EXMLSerializeVersion eXMLVersion, @Nonnull EXMLCharMode eXMLCharMode, @Nonnull EXMLIncorrectCharacterHandling eIncorrectCharHandling, @Nullable String s) -
getMaskedXMLTextLength
@Nonnegative public static int getMaskedXMLTextLength(@Nonnull EXMLVersion eXMLVersion, @Nonnull EXMLCharMode eXMLCharMode, @Nonnull EXMLIncorrectCharacterHandling eIncorrectCharHandling, @Nullable String s) -
getMaskedXMLTextLength
@Nonnegative public static int getMaskedXMLTextLength(@Nonnull EXMLSerializeVersion eXMLVersion, @Nonnull EXMLCharMode eXMLCharMode, @Nonnull EXMLIncorrectCharacterHandling eIncorrectCharHandling, @Nullable String s) -
maskXMLTextTo
public static void maskXMLTextTo(@Nonnull EXMLSerializeVersion eXMLVersion, @Nonnull EXMLCharMode eXMLCharMode, @Nonnull EXMLIncorrectCharacterHandling eIncorrectCharHandling, @Nullable String s, @Nonnull Writer aWriter) throws IOException - Throws:
IOException
-
maskXMLTextTo
public static void maskXMLTextTo(@Nonnull EXMLSerializeVersion eXMLVersion, @Nonnull EXMLCharMode eXMLCharMode, @Nonnull EXMLIncorrectCharacterHandling eIncorrectCharHandling, @Nonnull char[] aSrcText, @Nonnegative int nOfs, @Nonnegative int nLen, @Nonnull Writer aWriter) throws IOException - Throws:
IOException
-