
com.github.robtimus.obfuscation.xml.Messages Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of obfuscation-xml Show documentation
Show all versions of obfuscation-xml Show documentation
Provides functionality for obfuscating XML
The newest version!
/*
* Messages.java
* Copyright 2020 Rob Spoor
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// This file has been generated by i18n-maven-plugin
// (https://robtimus.github.io/i18n-maven-plugin/)
package com.github.robtimus.obfuscation.xml;
import java.util.Locale;
import java.util.Map;
import java.util.ResourceBundle;
import java.util.concurrent.ConcurrentHashMap;
@SuppressWarnings("nls")
final class Messages {
private static final Map BUNDLES = new ConcurrentHashMap<>();
private Messages() {
throw new IllegalStateException("cannot create instances of " + getClass().getName());
}
private static ResourceBundle getResourceBundle(Locale locale) {
Locale l = nonNull(locale);
return BUNDLES.computeIfAbsent(l, k -> ResourceBundle.getBundle("com.github.robtimus.obfuscation.xml.obfuscation-xml", l));
}
private static String getString(Locale locale, String key) {
ResourceBundle bundle = getResourceBundle(locale);
return bundle.getString(key);
}
private static Locale nonNull(Locale locale) {
return locale != null ? locale : Locale.getDefault(Locale.Category.FORMAT);
}
static final XMLObfuscator_ XMLObfuscator = new XMLObfuscator_();
static final class XMLObfuscator_ {
private XMLObfuscator_() {
super();
}
String duplicateElement(Object arg) {
return duplicateElement(null, arg);
}
String duplicateElement(Locale locale, Object arg) {
Locale l = nonNull(locale);
String s = getString(l, "XMLObfuscator.duplicateElement");
return String.format(l, s, arg);
}
String duplicateAttribute(Object arg) {
return duplicateAttribute(null, arg);
}
String duplicateAttribute(Locale locale, Object arg) {
Locale l = nonNull(locale);
String s = getString(l, "XMLObfuscator.duplicateAttribute");
return String.format(l, s, arg);
}
String externalDTDsNotSupported(Object arg) {
return externalDTDsNotSupported(null, arg);
}
String externalDTDsNotSupported(Locale locale, Object arg) {
Locale l = nonNull(locale);
String s = getString(l, "XMLObfuscator.externalDTDsNotSupported");
return String.format(l, s, arg);
}
final MalformedXML_ malformedXML = new MalformedXML_();
static final class MalformedXML_ {
private MalformedXML_() {
super();
}
String warning() {
return warning(null);
}
String warning(Locale locale) {
Locale l = nonNull(locale);
return getString(l, "XMLObfuscator.malformedXML.warning");
}
String text() {
return text(null);
}
String text(Locale locale) {
Locale l = nonNull(locale);
return getString(l, "XMLObfuscator.malformedXML.text");
}
}
String unsupportedProperty(Object arg) {
return unsupportedProperty(null, arg);
}
String unsupportedProperty(Locale locale, Object arg) {
Locale l = nonNull(locale);
String s = getString(l, "XMLObfuscator.unsupportedProperty");
return String.format(l, s, arg);
}
}
static final Source_ Source = new Source_();
static final class Source_ {
private Source_() {
super();
}
String overflow(Object arg) {
return overflow(null, arg);
}
String overflow(Locale locale, Object arg) {
Locale l = nonNull(locale);
String s = getString(l, "Source.overflow");
return String.format(l, s, arg);
}
String truncating(Object arg) {
return truncating(null, arg);
}
String truncating(Locale locale, Object arg) {
Locale l = nonNull(locale);
String s = getString(l, "Source.truncating");
return String.format(l, s, arg);
}
String truncated(Object arg) {
return truncated(null, arg);
}
String truncated(Locale locale, Object arg) {
Locale l = nonNull(locale);
String s = getString(l, "Source.truncated");
return String.format(l, s, arg);
}
final PreferredMaxBufferSize_ preferredMaxBufferSize = new PreferredMaxBufferSize_();
static final class PreferredMaxBufferSize_ {
private PreferredMaxBufferSize_() {
super();
}
String notPositive(
Object arg1,
Object arg2) {
return notPositive(null,
arg1,
arg2
);
}
String notPositive(Locale locale,
Object arg1,
Object arg2) {
Locale l = nonNull(locale);
String s = getString(l, "Source.preferredMaxBufferSize.notPositive");
return String.format(l, s,
arg1,
arg2
);
}
String notNumeric(
Object arg1,
Object arg2) {
return notNumeric(null,
arg1,
arg2
);
}
String notNumeric(Locale locale,
Object arg1,
Object arg2) {
Locale l = nonNull(locale);
String s = getString(l, "Source.preferredMaxBufferSize.notNumeric");
return String.format(l, s,
arg1,
arg2
);
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy