![JAR search and dependency download from the Maven repository](/logo.png)
com.opensymphony.xwork2.TextProviderFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of xwork Show documentation
Show all versions of xwork Show documentation
XWork is an command-pattern framework that is used to power WebWork
as well as other applications. XWork provides an Inversion of Control
container, a powerful expression language, data type conversion,
validation, and pluggable configuration.
/*
* Copyright (c) 2002-2007 by OpenSymphony
* All rights reserved.
*/
package com.opensymphony.xwork2;
import java.util.ResourceBundle;
/**
* TextProviderFactory
*
* @author Oleg Gorobets
*/
public class TextProviderFactory {
private static TextProvider instance = new TextProviderSupport();
/**
* @param instance Text provider
*/
public static void setInstance(TextProvider instance) {
TextProviderFactory.instance = instance;
}
public static TextProvider getInstance() {
return instance;
}
public static TextProvider getInstance(Class clazz, LocaleProvider provider) {
if (instance instanceof TextProviderSupport) {
((TextProviderSupport) instance).setClazz(clazz);
((TextProviderSupport) instance).setLocaleProvider(provider);
}
return instance;
}
public static TextProvider getInstance(ResourceBundle bundle, LocaleProvider provider) {
if (instance instanceof TextProviderSupport) {
((TextProviderSupport) instance).setBundle(bundle);
((TextProviderSupport) instance).setLocaleProvider(provider);
}
return instance;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy