com.ingenico.connect.gateway.sdk.java.logging.PropertyObfuscator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of connect-sdk-java Show documentation
Show all versions of connect-sdk-java Show documentation
SDK to communicate with the Ingenico ePayments platform using the Ingenico Connect Server API
package com.ingenico.connect.gateway.sdk.java.logging;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
final class PropertyObfuscator extends Obfuscator {
private final Pattern propertyPattern;
PropertyObfuscator(Map obfuscators) {
// case sensitive
super(obfuscators, false);
this.propertyPattern = buildPropertyPattern(obfuscators.keySet());
}
private Pattern buildPropertyPattern(Set propertyNames) {
if (propertyNames.isEmpty()) {
// no matches possible
return Pattern.compile("$^");
}
Iterator iterator = propertyNames.iterator();
/*
* Regex to create: (["'])(X|Y|Z)\1\s*:\s*(?:(["'])(.*?)(?