WW-3714 Moves all classes from com.opensymphony.xwork2 into org.apache.struts2

This commit is contained in:
Kusal Kithul-Godage
2024-10-16 14:00:34 +11:00
parent 08d54d2b66
commit 32bc4045ba
1454 changed files with 6073 additions and 10262 deletions
@@ -18,8 +18,8 @@
*/
package org.apache.struts2.json;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.ProxyUtil;
import org.apache.struts2.inject.Inject;
import org.apache.struts2.util.ProxyUtil;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.struts2.json.annotations.JSON;
@@ -339,7 +339,7 @@ public class DefaultJSONWriter implements JSONWriter {
} catch (Exception ex) {
LOG.debug(ex.getMessage(), ex);
}
//in hibernate4.3.7,because javassist3.18.1's class name generate rule is '_$$_jvst'+...
} else if(clazz.getName().contains("$$_jvst")){
try {
@@ -667,7 +667,7 @@ public class DefaultJSONWriter implements JSONWriter {
this.formatter = new SimpleDateFormat(defaultDateFormat);
}
}
@Override
public void setCacheBeanInfo(boolean cacheBeanInfo) {
this.cacheBeanInfo = cacheBeanInfo;
@@ -18,8 +18,8 @@
*/
package org.apache.struts2.json;
import com.opensymphony.xwork2.util.TextParseUtil;
import com.opensymphony.xwork2.util.WildcardUtil;
import org.apache.struts2.util.TextParseUtil;
import org.apache.struts2.util.WildcardUtil;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -29,7 +29,7 @@ import java.util.regex.Pattern;
/**
* <p>Isolate the process of cleaning JSON data from the Interceptor class
* itself.</p>
*
*
* <p>The allowed and blocked wildcard patterns, combined with
* defaultBlock, let you filter out values that should not be injected, in
* the same way that ParameterFilterInterceptor does. Note that you can
@@ -18,12 +18,12 @@
*/
package org.apache.struts2.json;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;
import com.opensymphony.xwork2.util.ValueStack;
import com.opensymphony.xwork2.util.WildcardUtil;
import org.apache.struts2.Action;
import org.apache.struts2.ActionInvocation;
import org.apache.struts2.inject.Inject;
import org.apache.struts2.interceptor.AbstractInterceptor;
import org.apache.struts2.util.ValueStack;
import org.apache.struts2.util.WildcardUtil;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@@ -304,7 +304,7 @@ public class JSONInterceptor extends AbstractInterceptor {
/**
* Look for a method in clazz carrying the SMDMethod annotation with
* matching name and parametersCount
*
*
* @return true if matches name and parameterCount
*/
private boolean checkSMDMethodSignature(Method method, String name, int parameterCount) {
@@ -351,7 +351,7 @@ public class JSONInterceptor extends AbstractInterceptor {
/**
* Wrap generated JSON with comments. Only used if SMD is enabled.
*
*
* @param wrapWithComments Wrap generated JSON with comments.
*/
public void setWrapWithComments(boolean wrapWithComments) {
@@ -372,7 +372,7 @@ public class JSONInterceptor extends AbstractInterceptor {
/**
* Sets the root object to be deserialized, defaults to the Action
*
*
* @param root
* OGNL expression of root object to be serialized
*/
@@ -382,7 +382,7 @@ public class JSONInterceptor extends AbstractInterceptor {
/**
* Sets the JSONPopulator to be used
*
*
* @param populator
* JSONPopulator
*/
@@ -392,7 +392,7 @@ public class JSONInterceptor extends AbstractInterceptor {
/**
* Sets the JSONCleaner to be used
*
*
* @param dataCleaner
* JSONCleaner
*/
@@ -410,7 +410,7 @@ public class JSONInterceptor extends AbstractInterceptor {
/**
* Turns debugging on or off
*
*
* @param debug
* true or false
*/
@@ -426,7 +426,7 @@ public class JSONInterceptor extends AbstractInterceptor {
/**
* Sets a comma-delimited list of regular expressions to match properties
* that should be excluded from the JSON output.
*
*
* @param commaDelim
* A comma-delimited list of regular expressions
*/
@@ -443,7 +443,7 @@ public class JSONInterceptor extends AbstractInterceptor {
/**
* Sets a comma-delimited list of wildcard expressions to match
* properties that should be excluded from the JSON output.
*
*
* @param commaDelim
* A comma-delimited list of wildcard expressions
*/
@@ -460,7 +460,7 @@ public class JSONInterceptor extends AbstractInterceptor {
/**
* Sets a comma-delimited list of regular expressions to match properties
* that should be included from the JSON output.
*
*
* @param commaDelim
* A comma-delimited list of regular expressions
*/
@@ -474,7 +474,7 @@ public class JSONInterceptor extends AbstractInterceptor {
* standard boilerplate (id, error, debug) are automatically included,
* as appropriate, so you only need to provide patterns for the
* contents of "result".
*
*
* @param commaDelim
* A comma-delimited list of wildcard expressions
*/
@@ -510,7 +510,7 @@ public class JSONInterceptor extends AbstractInterceptor {
/**
* Setting this property to "true" will compress the output.
*
*
* @param enableGZIP
* Enable compressed output
*/
@@ -524,7 +524,7 @@ public class JSONInterceptor extends AbstractInterceptor {
/**
* Add headers to response to prevent the browser from caching the response
*
*
* @param noCache no cache
*/
public void setNoCache(boolean noCache) {
@@ -18,17 +18,17 @@
*/
package org.apache.struts2.json;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.Result;
import com.opensymphony.xwork2.inject.Inject;
import com.opensymphony.xwork2.util.ValueStack;
import com.opensymphony.xwork2.util.WildcardUtil;
import org.apache.struts2.ActionContext;
import org.apache.struts2.ActionInvocation;
import org.apache.struts2.ModelDriven;
import org.apache.struts2.Result;
import org.apache.struts2.inject.Inject;
import org.apache.struts2.util.ValueStack;
import org.apache.struts2.util.WildcardUtil;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.struts2.ModelDriven;
import org.apache.struts2.StrutsConstants;
import org.apache.struts2.json.smd.SMDGenerator;
@@ -40,15 +40,15 @@ import java.util.Arrays;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import com.opensymphony.xwork2.inject.Container;
import com.opensymphony.xwork2.inject.Inject;
import org.apache.struts2.inject.Container;
import org.apache.struts2.inject.Inject;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.struts2.json.annotations.SMDMethod;
import com.opensymphony.xwork2.util.TextParseUtil;
import com.opensymphony.xwork2.util.WildcardUtil;
import org.apache.struts2.util.TextParseUtil;
import org.apache.struts2.util.WildcardUtil;
/**
* Wrapper for JSONWriter with some utility methods.
@@ -57,7 +57,7 @@ public class JSONUtil {
public final static String RFC3339_FORMAT = "yyyy-MM-dd'T'HH:mm:ss";
public static final boolean CACHE_BEAN_INFO_DEFAULT = true;
private static final Logger LOG = LogManager.getLogger(JSONUtil.class);
private JSONWriter writer;
@@ -108,10 +108,10 @@ public class JSONUtil {
public String serialize(Object object, Collection<Pattern> excludeProperties,
Collection<Pattern> includeProperties, boolean ignoreHierarchy, boolean excludeNullProperties)
throws JSONException {
return serialize(object, excludeProperties, includeProperties,
ignoreHierarchy, excludeNullProperties, CACHE_BEAN_INFO_DEFAULT);
return serialize(object, excludeProperties, includeProperties,
ignoreHierarchy, excludeNullProperties, CACHE_BEAN_INFO_DEFAULT);
}
/**
* Serializes an object into JSON, excluding any properties matching any of
* the regular expressions in the given collection.
@@ -166,10 +166,10 @@ public class JSONUtil {
public String serialize(Object object, Collection<Pattern> excludeProperties,
Collection<Pattern> includeProperties, boolean ignoreHierarchy, boolean enumAsBean,
boolean excludeNullProperties, String defaultDateFormat) throws JSONException {
return serialize(object, excludeProperties, includeProperties, ignoreHierarchy, enumAsBean,
excludeNullProperties, defaultDateFormat, CACHE_BEAN_INFO_DEFAULT);
return serialize(object, excludeProperties, includeProperties, ignoreHierarchy, enumAsBean,
excludeNullProperties, defaultDateFormat, CACHE_BEAN_INFO_DEFAULT);
}
/**
* Serializes an object into JSON, excluding any properties matching any of
* the regular expressions in the given collection.
@@ -217,7 +217,7 @@ public class JSONUtil {
public void serialize(Writer writer, Object object) throws IOException, JSONException {
serialize(writer, object, CACHE_BEAN_INFO_DEFAULT);
}
/**
* Serializes an object into JSON to the given writer.
*
@@ -257,7 +257,7 @@ public class JSONUtil {
JSONException {
serialize(writer, object, excludeProperties, includeProperties, excludeNullProperties, CACHE_BEAN_INFO_DEFAULT);
}
/**
* Serializes an object into JSON to the given writer, excluding any
* properties matching any of the regular expressions in the given
@@ -274,12 +274,12 @@ public class JSONUtil {
* @param excludeNullProperties
* enable/disable excluding of null properties
* @param cacheBeanInfo
* Specifies whether to cache bean info in the JSONWriter
* Specifies whether to cache bean info in the JSONWriter
* @throws IOException in case of IO errors
* @throws JSONException in case of error during serialize
*/
public void serialize(Writer writer, Object object, Collection<Pattern> excludeProperties,
Collection<Pattern> includeProperties, boolean excludeNullProperties, boolean cacheBeanInfo)
Collection<Pattern> includeProperties, boolean excludeNullProperties, boolean cacheBeanInfo)
throws IOException, JSONException {
writer.write(serialize(object, excludeProperties, includeProperties, true, excludeNullProperties, cacheBeanInfo));
}
@@ -18,15 +18,15 @@
*/
package org.apache.struts2.json;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.MethodFilterInterceptor;
import org.apache.commons.text.StringEscapeUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.struts2.Action;
import org.apache.struts2.ActionInvocation;
import org.apache.struts2.ModelDriven;
import org.apache.struts2.ServletActionContext;
import org.apache.struts2.interceptor.ValidationAware;
import org.apache.struts2.interceptor.MethodFilterInterceptor;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.LogManager;
import org.apache.commons.text.StringEscapeUtils;
import org.apache.struts2.ServletActionContext;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
@@ -18,8 +18,8 @@
*/
package org.apache.struts2.json.smd;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionInvocation;
import org.apache.struts2.ActionContext;
import org.apache.struts2.ActionInvocation;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.struts2.json.JSONUtil;
@@ -18,11 +18,11 @@
*/
package org.apache.struts2.json;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.config.entities.ActionConfig;
import com.opensymphony.xwork2.mock.MockActionInvocation;
import com.opensymphony.xwork2.mock.MockActionProxy;
import com.opensymphony.xwork2.util.ValueStack;
import org.apache.struts2.ActionContext;
import org.apache.struts2.config.entities.ActionConfig;
import org.apache.struts2.mock.MockActionInvocation;
import org.apache.struts2.mock.MockActionProxy;
import org.apache.struts2.util.ValueStack;
import org.apache.struts2.StrutsStatics;
import org.apache.struts2.dispatcher.mapper.DefaultActionMapper;
import org.apache.struts2.junit.StrutsTestCase;
@@ -18,9 +18,9 @@
*/
package org.apache.struts2.json;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.mock.MockActionInvocation;
import com.opensymphony.xwork2.util.ValueStack;
import org.apache.struts2.ActionContext;
import org.apache.struts2.mock.MockActionInvocation;
import org.apache.struts2.util.ValueStack;
import org.apache.struts2.junit.StrutsTestCase;
import org.apache.struts2.junit.util.TestUtils;
import org.springframework.mock.web.MockHttpServletRequest;
@@ -18,10 +18,10 @@
*/
package org.apache.struts2.json;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.Result;
import com.opensymphony.xwork2.mock.MockActionInvocation;
import com.opensymphony.xwork2.util.ValueStack;
import org.apache.struts2.ActionContext;
import org.apache.struts2.Result;
import org.apache.struts2.mock.MockActionInvocation;
import org.apache.struts2.util.ValueStack;
import org.apache.struts2.StrutsStatics;
import org.apache.struts2.junit.StrutsTestCase;
import org.apache.struts2.junit.util.TestUtils;
@@ -18,16 +18,16 @@
*/
package org.apache.struts2.json;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.config.entities.ActionConfig;
import com.opensymphony.xwork2.mock.MockActionInvocation;
import com.opensymphony.xwork2.mock.MockActionProxy;
import com.opensymphony.xwork2.validator.annotations.EmailValidator;
import com.opensymphony.xwork2.validator.annotations.IntRangeFieldValidator;
import com.opensymphony.xwork2.validator.annotations.RequiredStringValidator;
import com.opensymphony.xwork2.validator.annotations.StringLengthFieldValidator;
import org.apache.struts2.Action;
import org.apache.struts2.ActionContext;
import org.apache.struts2.ActionSupport;
import org.apache.struts2.config.entities.ActionConfig;
import org.apache.struts2.mock.MockActionInvocation;
import org.apache.struts2.mock.MockActionProxy;
import org.apache.struts2.validator.annotations.EmailValidator;
import org.apache.struts2.validator.annotations.IntRangeFieldValidator;
import org.apache.struts2.validator.annotations.RequiredStringValidator;
import org.apache.struts2.validator.annotations.StringLengthFieldValidator;
import org.apache.struts2.StrutsStatics;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor;
@@ -25,8 +25,8 @@ import java.util.Set;
import org.apache.struts2.json.annotations.JSON;
import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.Action;
import org.apache.struts2.ActionSupport;
/**
*/