public static interface XMLObfuscator.Builder
XMLObfuscators
.Modifier and Type | Method and Description |
---|---|
default XMLObfuscator.Builder |
allByDefault()
Indicates that by default nested elements will be obfuscated (default).
|
XMLObfuscator |
build()
Creates a new
XMLObfuscator with the elements and obfuscators added to this builder. |
XMLObfuscator.Builder |
caseInsensitiveByDefault()
Sets the default case sensitivity for new elements and attributes to
CaseSensitivity.CASE_INSENSITIVE . |
XMLObfuscator.Builder |
caseSensitiveByDefault()
Sets the default case sensitivity for new elements and attributes to
CaseSensitivity.CASE_SENSITIVE . |
default XMLObfuscator.Builder |
excludeNestedElementsByDefault()
Indicates that by default nested elements will not be obfuscated.
|
XMLObfuscator.Builder |
forNestedElementsByDefault(XMLObfuscator.ElementConfigurer.ObfuscationMode obfuscationMode)
Indicates how to handle nested elements.
|
XMLObfuscator.Builder |
generateXML()
Indicates that XML obfuscators will always generate new, obfuscated documents.
|
default XMLObfuscator.Builder |
includeNestedElementsByDefault()
Indicates that by default nested elements will be obfuscated (default).
|
XMLObfuscator.LimitConfigurer |
limitTo(long limit)
Sets the limit for the obfuscated result.
|
default XMLObfuscator.Builder |
textOnlyByDefault()
Indicates that by default nested elements will not be obfuscated.
|
default <R> R |
transform(Function<? super XMLObfuscator.Builder,? extends R> f)
This method allows the application of a function to this builder.
|
XMLObfuscator.AttributeConfigurer |
withAttribute(QName attribute,
Obfuscator obfuscator)
Adds an attribute to obfuscate.
|
XMLObfuscator.AttributeConfigurer |
withAttribute(String attribute,
Obfuscator obfuscator)
Adds an attribute to obfuscate.
|
XMLObfuscator.AttributeConfigurer |
withAttribute(String attribute,
Obfuscator obfuscator,
CaseSensitivity caseSensitivity)
Adds an attribute to obfuscate.
|
XMLObfuscator.ElementConfigurer |
withElement(QName element,
Obfuscator obfuscator)
Adds an element to obfuscate.
|
XMLObfuscator.ElementConfigurer |
withElement(String element,
Obfuscator obfuscator)
Adds an element to obfuscate.
|
XMLObfuscator.ElementConfigurer |
withElement(String element,
Obfuscator obfuscator,
CaseSensitivity caseSensitivity)
Adds an element to obfuscate.
|
XMLObfuscator.Builder |
withMalformedXMLWarning(String warning)
Sets the warning to include if an
XMLStreamException is thrown. |
XMLObfuscator.ElementConfigurer withElement(String element, Obfuscator obfuscator)
This method is an alias for withElement(String, Obfuscator, CaseSensitivity)
with the last specified default case sensitivity
using caseSensitiveByDefault()
or caseInsensitiveByDefault()
. The default is CaseSensitivity.CASE_SENSITIVE
.
element
- The local name of the element.obfuscator
- The obfuscator to use for obfuscating the element.XMLObfuscators
.NullPointerException
- If the given element name or obfuscator is null
.IllegalArgumentException
- If an element with the same local name and the same case sensitivity was already added.XMLObfuscator.ElementConfigurer withElement(String element, Obfuscator obfuscator, CaseSensitivity caseSensitivity)
element
- The local name of the element.obfuscator
- The obfuscator to use for obfuscating the element.caseSensitivity
- The case sensitivity for the element.XMLObfuscators
.NullPointerException
- If the given element name, obfuscator or case sensitivity is null
.IllegalArgumentException
- If an element with the same local name and the same case sensitivity was already added.XMLObfuscator.ElementConfigurer withElement(QName element, Obfuscator obfuscator)
withElement(String, Obfuscator)
or
withElement(String, Obfuscator, CaseSensitivity)
.element
- The qualified name of the element.obfuscator
- The obfuscator to use for obfuscating the element.XMLObfuscators
.NullPointerException
- If the given element name or obfuscator is null
.IllegalArgumentException
- If an element with the same qualified name was already added.XMLObfuscator.AttributeConfigurer withAttribute(String attribute, Obfuscator obfuscator)
This method is an alias for withAttribute(String, Obfuscator, CaseSensitivity)
with the last specified default case sensitivity
using caseSensitiveByDefault()
or caseInsensitiveByDefault()
. The default is CaseSensitivity.CASE_SENSITIVE
.
Note: because locations of attributes are not easily available, XML obfuscators will generate new, obfuscated documents when attributes need to be obfuscated.
attribute
- The local name of the attribute.obfuscator
- The obfuscator to use for obfuscating the attribute.XMLObfuscators
.NullPointerException
- If the given attribute name or obfuscator is null
.IllegalArgumentException
- If an attribute with the same local name and the same case sensitivity was already added.XMLObfuscator.AttributeConfigurer withAttribute(String attribute, Obfuscator obfuscator, CaseSensitivity caseSensitivity)
Note: because locations of attributes are not easily available, XML obfuscators will generate new, obfuscated documents when attributes need to be obfuscated.
attribute
- The local name of the attribute.obfuscator
- The obfuscator to use for obfuscating the attribute.caseSensitivity
- The case sensitivity for the attribute.XMLObfuscators
.NullPointerException
- If the given attribute name, obfuscator or case sensitivity is null
.IllegalArgumentException
- If an attribute with the same local name and the same case sensitivity was already added.XMLObfuscator.AttributeConfigurer withAttribute(QName attribute, Obfuscator obfuscator)
withAttribute(String, Obfuscator)
or
withAttribute(String, Obfuscator, CaseSensitivity)
.
Note: because locations of attributes are not easily available, XML obfuscators will generate new, obfuscated documents when attributes need to be obfuscated.
attribute
- The qualified name of the attribute.obfuscator
- The obfuscator to use for obfuscating the attribute.XMLObfuscators
.NullPointerException
- If the given attribute name or obfuscator is null
.IllegalArgumentException
- If an attribute with the same qualified name was already added.XMLObfuscator.Builder caseSensitiveByDefault()
CaseSensitivity.CASE_SENSITIVE
. This is the default setting.
Note that this will not change the case sensitivity of any element or attribute that was already added.
XMLObfuscator.Builder caseInsensitiveByDefault()
CaseSensitivity.CASE_INSENSITIVE
.
Note that this will not change the case sensitivity of any element or attribute that was already added.
default XMLObfuscator.Builder textOnlyByDefault()
excludeNestedElementsByDefault()
.
Note that this will not change what will be obfuscated for any element that was already added.
default XMLObfuscator.Builder excludeNestedElementsByDefault()
#forNestedElementsByDefault(ObfuscationMode)
in combination with XMLObfuscator.ElementConfigurer.ObfuscationMode.EXCLUDE
.
Note that this will not change what will be obfuscated for any element that was already added.
default XMLObfuscator.Builder allByDefault()
includeNestedElementsByDefault()
.
Note that this will not change what will be obfuscated for any element that was already added.
default XMLObfuscator.Builder includeNestedElementsByDefault()
#forNestedElementsByDefault(ObfuscationMode)
in combination with XMLObfuscator.ElementConfigurer.ObfuscationMode.INHERIT
.
Note that this will not change what will be obfuscated for any element that was already added.
XMLObfuscator.Builder forNestedElementsByDefault(XMLObfuscator.ElementConfigurer.ObfuscationMode obfuscationMode)
XMLObfuscator.ElementConfigurer.ObfuscationMode.INHERIT
.
This can be overridden per element using XMLObfuscator.ElementConfigurer.forNestedElements(ObfuscationMode)
Note that this will not change what will be obfuscated for any property that was already added.
obfuscationMode
- The obfuscation mode that determines how to handle nested elements.NullPointerException
- If the given obfuscation mode is null
.XMLObfuscator.Builder withMalformedXMLWarning(String warning)
XMLStreamException
is thrown.
This can be used to override the default message. Use null
to omit the warning.warning
- The warning to include.XMLObfuscator.LimitConfigurer limitTo(long limit)
limit
- The limit to use.XMLObfuscators
.IllegalArgumentException
- If the given limit is negative.XMLObfuscator.Builder generateXML()
default <R> R transform(Function<? super XMLObfuscator.Builder,? extends R> f)
Any exception thrown by the function will be propagated to the caller.
R
- The type of the result of the function.f
- The function to apply.XMLObfuscator build()
XMLObfuscator
with the elements and obfuscators added to this builder.XMLObfuscator
.Copyright © 2020–2023. All rights reserved.