Skip to content
Open
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@
*/
package org.apache.struts2.ognl;

import ognl.OgnlContext;
import org.apache.struts2.conversion.NullHandler;

import java.util.Map;

public class OgnlNullHandlerWrapper implements ognl.NullHandler {

private final NullHandler wrapped;
Expand All @@ -31,13 +30,13 @@ public OgnlNullHandlerWrapper(NullHandler target) {
}

@Override
public Object nullMethodResult(Map context, Object target,
String methodName, Object[] args) {
public Object nullMethodResult(OgnlContext context, Object target,
String methodName, Object[] args) {
return wrapped.nullMethodResult(context, target, methodName, args);
}

@Override
public Object nullPropertyValue(Map context, Object target, Object property) {
public Object nullPropertyValue(OgnlContext context, Object target, Object property) {
return wrapped.nullPropertyValue(context, target, property);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,18 @@
*/
package org.apache.struts2.ognl;

import ognl.OgnlContext;
import org.apache.struts2.util.reflection.ReflectionContextFactory;
import ognl.Ognl;

import java.util.Map;

/**
* @deprecated since 6.8.0, to be removed, see {@link ReflectionContextFactory}
*/
@Deprecated(since = "6.8.0", forRemoval = true)
public class OgnlReflectionContextFactory implements ReflectionContextFactory {

@Override
public Map createDefaultContext(Object root) {
public OgnlContext createDefaultContext(Object root) {
return Ognl.createDefaultContext(root);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,13 @@ public Field getField(Class inClass, String name) {
@Override
public Method getGetMethod(Class targetClass, String propertyName)
throws IntrospectionException, ReflectionException {
try {
return OgnlRuntime.getGetMethod(null, targetClass, propertyName);
} catch (OgnlException e) {
throw new ReflectionException(e);
}
return OgnlRuntime.getGetMethod(targetClass, propertyName);
}

@Override
public Method getSetMethod(Class targetClass, String propertyName)
throws IntrospectionException, ReflectionException {
try {
return OgnlRuntime.getSetMethod(null, targetClass, propertyName);
} catch (OgnlException e) {
throw new ReflectionException(e);
}
return OgnlRuntime.getSetMethod(null, targetClass, propertyName);
}

@Override
Expand All @@ -71,7 +63,7 @@ public void setProperties(Map<String, ?> props, Object o, Map<String, Object> co
}

@Override
public void setProperties(Map<String, ?> props, Object o, Map<String, Object> context, boolean throwPropertyExceptions) throws ReflectionException{
public void setProperties(Map<String, ?> props, Object o, Map<String, Object> context, boolean throwPropertyExceptions) throws ReflectionException {
ognlUtil.setProperties(props, o, context, throwPropertyExceptions);
}

Expand All @@ -82,7 +74,7 @@ public void setProperties(Map<String, ?> properties, Object o) {

@Override
public PropertyDescriptor getPropertyDescriptor(Class targetClass,
String propertyName) throws IntrospectionException,
String propertyName) throws IntrospectionException,
ReflectionException {
try {
return OgnlRuntime.getPropertyDescriptor(targetClass, propertyName);
Expand All @@ -93,7 +85,7 @@ public PropertyDescriptor getPropertyDescriptor(Class targetClass,

@Override
public void copy(Object from, Object to, Map<String, Object> context,
Collection<String> exclusions, Collection<String> inclusions) {
Collection<String> exclusions, Collection<String> inclusions) {
copy(from, to, context, exclusions, inclusions, null);
}

Expand Down Expand Up @@ -145,7 +137,7 @@ public Object getValue(String expression, Map<String, Object> context, Object ro

@Override
public void setValue(String expression, Map<String, Object> context, Object root,
Object value) throws ReflectionException {
Object value) throws ReflectionException {
try {
ognlUtil.setValue(expression, context, root, value);
} catch (OgnlException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
*/
package org.apache.struts2.ognl;

import ognl.OgnlContext;
import org.apache.struts2.conversion.TypeConverter;

import java.lang.reflect.Member;
import java.util.Map;

/**
* Wraps an XWork type conversion class for as an OGNL TypeConverter
Expand All @@ -38,7 +38,7 @@ public OgnlTypeConverterWrapper(TypeConverter converter) {
}

@Override
public Object convertValue(Map context, Object target, Member member, String propertyName, Object value, Class toType) {
public Object convertValue(OgnlContext context, Object target, Member member, String propertyName, Object value, Class<?> toType) {
return typeConverter.convertValue(context, target, member, propertyName, value, toType);
}

Expand Down
Loading