mirror of
https://github.com/apache/struts.git
synced 2026-08-07 07:37:20 +00:00
WW-5113 Drops deprecated struts.xworkTextProvider
This commit is contained in:
@@ -213,13 +213,6 @@ public final class StrutsConstants {
|
||||
|
||||
public static final String STRUTS_ALWAYS_SELECT_FULL_NAMESPACE = "struts.mapper.alwaysSelectFullNamespace";
|
||||
|
||||
/**
|
||||
* XWork default text provider
|
||||
* @deprecated use {@link #STRUTS_TEXT_PROVIDER} instead
|
||||
*/
|
||||
@Deprecated
|
||||
public static final String STRUTS_XWORKTEXTPROVIDER = "struts.xworkTextProvider";
|
||||
|
||||
/** The {@link com.opensymphony.xwork2.LocaleProviderFactory} implementation class */
|
||||
public static final String STRUTS_LOCALE_PROVIDER_FACTORY = "struts.localeProviderFactory";
|
||||
|
||||
|
||||
@@ -390,7 +390,6 @@ public class StrutsBeanSelectionProvider extends AbstractBeanSelectionProvider {
|
||||
alias(TypeConverterCreator.class, StrutsConstants.STRUTS_CONVERTER_CREATOR, builder, props);
|
||||
alias(TypeConverterHolder.class, StrutsConstants.STRUTS_CONVERTER_HOLDER, builder, props);
|
||||
|
||||
alias(TextProvider.class, StrutsConstants.STRUTS_XWORKTEXTPROVIDER, builder, props, Scope.PROTOTYPE);
|
||||
alias(TextProvider.class, StrutsConstants.STRUTS_TEXT_PROVIDER, builder, props, Scope.PROTOTYPE);
|
||||
alias(TextProviderFactory.class, StrutsConstants.STRUTS_TEXT_PROVIDER_FACTORY, builder, props, Scope.PROTOTYPE);
|
||||
alias(LocaleProviderFactory.class, StrutsConstants.STRUTS_LOCALE_PROVIDER_FACTORY, builder, props);
|
||||
|
||||
@@ -87,7 +87,6 @@ public class ConstantConfig {
|
||||
private Boolean freemarkerWrapperAltMap;
|
||||
private BeanConfig xworkConverter;
|
||||
private Boolean mapperAlwaysSelectFullNamespace;
|
||||
private BeanConfig xworkTextProvider;
|
||||
private BeanConfig localeProviderFactory;
|
||||
private String mapperIdParameterName;
|
||||
private Boolean ognlAllowStaticFieldAccess;
|
||||
@@ -217,7 +216,6 @@ public class ConstantConfig {
|
||||
map.put(StrutsConstants.STRUTS_FREEMARKER_WRAPPER_ALT_MAP, Objects.toString(freemarkerWrapperAltMap, null));
|
||||
map.put(StrutsConstants.STRUTS_XWORKCONVERTER, beanConfToString(xworkConverter));
|
||||
map.put(StrutsConstants.STRUTS_ALWAYS_SELECT_FULL_NAMESPACE, Objects.toString(mapperAlwaysSelectFullNamespace, null));
|
||||
map.put(StrutsConstants.STRUTS_XWORKTEXTPROVIDER, beanConfToString(xworkTextProvider));
|
||||
map.put(StrutsConstants.STRUTS_LOCALE_PROVIDER_FACTORY, beanConfToString(localeProviderFactory));
|
||||
map.put(StrutsConstants.STRUTS_ID_PARAMETER_NAME, mapperIdParameterName);
|
||||
map.put(StrutsConstants.STRUTS_ALLOW_STATIC_FIELD_ACCESS, Objects.toString(ognlAllowStaticFieldAccess, null));
|
||||
@@ -778,18 +776,6 @@ public class ConstantConfig {
|
||||
this.mapperAlwaysSelectFullNamespace = mapperAlwaysSelectFullNamespace;
|
||||
}
|
||||
|
||||
public BeanConfig getXworkTextProvider() {
|
||||
return xworkTextProvider;
|
||||
}
|
||||
|
||||
public void setXworkTextProvider(BeanConfig xworkTextProvider) {
|
||||
this.xworkTextProvider = xworkTextProvider;
|
||||
}
|
||||
|
||||
public void setXworkTextProvider(Class<?> clazz) {
|
||||
this.xworkTextProvider = new BeanConfig(clazz, clazz.getName());
|
||||
}
|
||||
|
||||
public BeanConfig getLocaleProviderFactory() {
|
||||
return localeProviderFactory;
|
||||
}
|
||||
|
||||
+11
-12
@@ -20,7 +20,6 @@ package org.apache.struts2.config_browser;
|
||||
|
||||
import com.opensymphony.xwork2.ActionProxyFactory;
|
||||
import com.opensymphony.xwork2.ObjectFactory;
|
||||
import com.opensymphony.xwork2.TextProvider;
|
||||
import com.opensymphony.xwork2.conversion.ObjectTypeDeterminer;
|
||||
import com.opensymphony.xwork2.conversion.impl.XWorkConverter;
|
||||
import com.opensymphony.xwork2.inject.Container;
|
||||
@@ -49,10 +48,9 @@ public class ShowBeansAction extends ActionNamesAction {
|
||||
@Inject
|
||||
public void setContainer(Container container) {
|
||||
super.setContainer(container);
|
||||
bindings = new TreeMap<String, Set<Binding>>();
|
||||
bindings = new TreeMap<>();
|
||||
bindings.put(ObjectFactory.class.getName(), addBindings(container, ObjectFactory.class, StrutsConstants.STRUTS_OBJECTFACTORY));
|
||||
bindings.put(XWorkConverter.class.getName(), addBindings(container, XWorkConverter.class, StrutsConstants.STRUTS_XWORKCONVERTER));
|
||||
bindings.put(TextProvider.class.getName(), addBindings(container, TextProvider.class, StrutsConstants.STRUTS_XWORKTEXTPROVIDER));
|
||||
bindings.put(ActionProxyFactory.class.getName(), addBindings(container, ActionProxyFactory.class, StrutsConstants.STRUTS_ACTIONPROXYFACTORY));
|
||||
bindings.put(ObjectTypeDeterminer.class.getName(), addBindings(container, ObjectTypeDeterminer.class, StrutsConstants.STRUTS_OBJECTTYPEDETERMINER));
|
||||
bindings.put(ActionMapper.class.getName(), addBindings(container, ActionMapper.class, StrutsConstants.STRUTS_MAPPER_CLASS));
|
||||
@@ -66,8 +64,8 @@ public class ShowBeansAction extends ActionNamesAction {
|
||||
return bindings;
|
||||
}
|
||||
|
||||
protected Set<Binding> addBindings(Container container, Class type, String constName) {
|
||||
Set<Binding> bindings = new TreeSet<Binding>();
|
||||
protected Set<Binding> addBindings(Container container, Class<?> type, String constName) {
|
||||
Set<Binding> bindings = new TreeSet<>();
|
||||
String chosenName = container.getInstance(String.class, constName);
|
||||
if (chosenName == null) {
|
||||
chosenName = "struts";
|
||||
@@ -84,7 +82,7 @@ public class ShowBeansAction extends ActionNamesAction {
|
||||
return bindings;
|
||||
}
|
||||
|
||||
String getInstanceClassName(Container container, Class type, String name) {
|
||||
String getInstanceClassName(Container container, Class<?> type, String name) {
|
||||
String instName = "Class unable to be loaded";
|
||||
try {
|
||||
Object inst = container.getInstance(type, name);
|
||||
@@ -95,11 +93,12 @@ public class ShowBeansAction extends ActionNamesAction {
|
||||
return instName;
|
||||
}
|
||||
|
||||
public class Binding implements Comparable<Binding> {
|
||||
private String impl;
|
||||
private String alias;
|
||||
private String constant;
|
||||
private boolean isDefault;
|
||||
public static class Binding implements Comparable<Binding> {
|
||||
|
||||
private final String impl;
|
||||
private final String alias;
|
||||
private final String constant;
|
||||
private final boolean isDefault;
|
||||
|
||||
public Binding(String impl, String alias, String constant, boolean def) {
|
||||
this.impl = impl;
|
||||
@@ -125,7 +124,7 @@ public class ShowBeansAction extends ActionNamesAction {
|
||||
}
|
||||
|
||||
public int compareTo(Binding b2) {
|
||||
int ret = 0;
|
||||
int ret;
|
||||
if (isDefault) {
|
||||
ret = -1;
|
||||
} else if (b2.isDefault()) {
|
||||
|
||||
Reference in New Issue
Block a user