public final class XMLObfuscator extends Obfuscator
CharSequences or the contents of Readers.
An XMLObfuscator will only obfuscate text, and ignore leading and trailing whitespace.
It will never obfuscate element tag names, comments, etc.
By default, if an obfuscator is configured for an element, it will be used to obfuscate the text of all nested elements as well. This can be turned
off using XMLObfuscator.Builder.excludeNestedElementsByDefault() and/or XMLObfuscator.ElementConfigurer.excludeNestedElements(). This will allow the nested
elements to use their own obfuscators.
Note: preferably, obfuscation is done in such a way that the original structure and formatting is maintained. However, some functionality does not
allow for this to happen. If this functionality is needed, obfuscation will instead generate new, obfuscated XML documents. The resulting
obfuscated XML documents may slightly differ from the original. Methods in class XMLObfuscator.Builder will mention it if they result in generating new
XML documents.
| Modifier and Type | Class and Description |
|---|---|
static interface |
XMLObfuscator.AttributeConfigurer
An object that can be used to configure an attribute that should be obfuscated.
|
static interface |
XMLObfuscator.Builder
A builder for
XMLObfuscators. |
static interface |
XMLObfuscator.ElementConfigurer
An object that can be used to configure an element that should be obfuscated.
|
static interface |
XMLObfuscator.LimitConfigurer
An object that can be used to configure handling when the obfuscated result exceeds a pre-defined limit.
|
Obfuscator.ObfuscatorFunction, Obfuscator.PortionBuilder, Obfuscator.Prefix, Obfuscator.SplitPoint| Modifier and Type | Method and Description |
|---|---|
static XMLObfuscator.Builder |
builder()
Returns a builder that will create
XMLObfuscators. |
boolean |
equals(Object o) |
int |
hashCode() |
CharSequence |
obfuscateText(CharSequence s,
int start,
int end) |
void |
obfuscateText(CharSequence s,
int start,
int end,
Appendable destination) |
void |
obfuscateText(Reader input,
Appendable destination) |
Writer |
streamTo(Appendable destination) |
String |
toString() |
all, all, fixedLength, fixedLength, fixedValue, fromFunction, fromFunction, none, obfuscateCollection, obfuscateCollection, obfuscateList, obfuscateList, obfuscateMap, obfuscateMap, obfuscateObject, obfuscateObject, obfuscateSet, obfuscateSet, obfuscateText, obfuscateText, obfuscateText, obfuscateText, obfuscateText, obfuscateText, obfuscateText, portion, untilLengthpublic CharSequence obfuscateText(CharSequence s, int start, int end)
obfuscateText in class Obfuscatorpublic void obfuscateText(CharSequence s, int start, int end, Appendable destination) throws IOException
obfuscateText in class ObfuscatorIOExceptionpublic void obfuscateText(Reader input, Appendable destination) throws IOException
obfuscateText in class ObfuscatorIOExceptionpublic Writer streamTo(Appendable destination)
streamTo in class Obfuscatorpublic static XMLObfuscator.Builder builder()
XMLObfuscators.XMLObfuscators.Copyright © 2020–2023. All rights reserved.