com.anrisoftware.resources.texts.api.TextResource Maven / Gradle / Ivy
/*
* Copyright 2012-2015 Erwin Müller
*
* This file is part of resources-texts.
*
* resources-texts is free software: you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by the
* Free Software Foundation, either version 3 of the License, or (at your
* option) any later version.
*
* resources-texts is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with resources-texts. If not, see .
*/
package com.anrisoftware.resources.texts.api;
import java.nio.charset.Charset;
import java.util.Locale;
import com.anrisoftware.resources.api.Resource;
import com.anrisoftware.resources.api.ResourcesException;
/**
* Text resource.
*
* @author Erwin Mueller, [email protected]
* @since 1.0
* @see TextResourceFactory
*/
public interface TextResource extends Resource {
/**
* Returns the character set of this resource.
*
* @return the {@link Charset}.
*
* @since 1.1
*/
Charset getCharset();
/**
* Returns the text {@link String} of the resource.
*
* @throws ResourcesException
* if there was an error loading the text.
*/
String getText() throws ResourcesException;
/**
* Returns a formatted text of the resource.
*
* The string is formatted as in
* {@link String#format(Locale, String, Object...)} with the current text as
* the format string and the current locale as the locale.
*
* @param args
* the arguments.
*
* @throws ResourcesException
* if there was an error loading the text.
*
* @since 1.2
*/
String getFormattedText(Object... args) throws ResourcesException;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy