polishing
This commit is contained in:
@@ -101,6 +101,11 @@ public class BeanWrapperImpl extends AbstractPropertyAccessor implements BeanWra
|
||||
|
||||
private TypeConverterDelegate typeConverterDelegate;
|
||||
|
||||
/**
|
||||
* The security context used for invoking the property methods
|
||||
*/
|
||||
private AccessControlContext acc;
|
||||
|
||||
/**
|
||||
* Cached introspections results for this object, to prevent encountering
|
||||
* the cost of JavaBeans introspection every time.
|
||||
@@ -112,9 +117,6 @@ public class BeanWrapperImpl extends AbstractPropertyAccessor implements BeanWra
|
||||
*/
|
||||
private Map<String, BeanWrapperImpl> nestedBeanWrappers;
|
||||
|
||||
/** The security context used for invoking the property methods */
|
||||
private AccessControlContext acc;
|
||||
|
||||
private boolean autoGrowNestedPaths = false;
|
||||
|
||||
|
||||
@@ -216,16 +218,6 @@ public class BeanWrapperImpl extends AbstractPropertyAccessor implements BeanWra
|
||||
setIntrospectionClass(object.getClass());
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the security context used during the invocation of the wrapped instance methods.
|
||||
* Can be null.
|
||||
*
|
||||
* @param acc
|
||||
*/
|
||||
public void setSecurityContext(AccessControlContext acc) {
|
||||
this.acc = acc;
|
||||
}
|
||||
|
||||
public final Object getWrappedInstance() {
|
||||
return this.object;
|
||||
}
|
||||
@@ -274,6 +266,22 @@ public class BeanWrapperImpl extends AbstractPropertyAccessor implements BeanWra
|
||||
return this.autoGrowNestedPaths;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the security context used during the invocation of the wrapped instance methods.
|
||||
* Can be null.
|
||||
*/
|
||||
public void setSecurityContext(AccessControlContext acc) {
|
||||
this.acc = acc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the security context used during the invocation of the wrapped instance methods.
|
||||
* Can be null.
|
||||
*/
|
||||
public AccessControlContext getSecurityContext() {
|
||||
return this.acc;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the class to introspect.
|
||||
* Needs to be called when the target object changes.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2007 the original author or authors.
|
||||
* Copyright 2002-2010 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -91,7 +91,7 @@ import org.springframework.util.Assert;
|
||||
* @see org.springframework.beans.factory.ObjectFactory
|
||||
* @see ServiceLocatorFactoryBean
|
||||
*/
|
||||
public class ObjectFactoryCreatingFactoryBean extends AbstractFactoryBean {
|
||||
public class ObjectFactoryCreatingFactoryBean extends AbstractFactoryBean<ObjectFactory> {
|
||||
|
||||
private String targetBeanName;
|
||||
|
||||
@@ -123,7 +123,7 @@ public class ObjectFactoryCreatingFactoryBean extends AbstractFactoryBean {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object createInstance() {
|
||||
protected ObjectFactory createInstance() {
|
||||
return new ObjectFactory() {
|
||||
public Object getObject() throws BeansException {
|
||||
return getTargetBean(targetBeanName);
|
||||
|
||||
Reference in New Issue
Block a user