Polish Javadoc for LookupOverride and related code

master
Sam Brannen 11 years ago
parent c335e99e3f
commit f77bf2422e
  1. 6
      spring-beans/src/main/java/org/springframework/beans/factory/support/CglibSubclassingInstantiationStrategy.java
  2. 10
      spring-beans/src/main/java/org/springframework/beans/factory/support/LookupOverride.java

@ -56,7 +56,7 @@ public class CglibSubclassingInstantiationStrategy extends SimpleInstantiationSt
/** /**
* Index in the CGLIB callback array for a method that should * Index in the CGLIB callback array for a method that should
* be overridden using generic Methodreplacer functionality. * be overridden using generic <em>method replacer</em> functionality.
*/ */
private static final int METHOD_REPLACER = 2; private static final int METHOD_REPLACER = 2;
@ -96,13 +96,13 @@ public class CglibSubclassingInstantiationStrategy extends SimpleInstantiationSt
} }
/** /**
* Create a new instance of a dynamically generated subclasses implementing the * Create a new instance of a dynamically generated subclass implementing the
* required lookups. * required lookups.
* @param ctor constructor to use. If this is {@code null}, use the * @param ctor constructor to use. If this is {@code null}, use the
* no-arg constructor (no parameterization, or Setter Injection) * no-arg constructor (no parameterization, or Setter Injection)
* @param args arguments to use for the constructor. * @param args arguments to use for the constructor.
* Ignored if the ctor parameter is {@code null}. * Ignored if the ctor parameter is {@code null}.
* @return new instance of the dynamically generated class * @return new instance of the dynamically generated subclass
*/ */
public Object instantiate(Constructor<?> ctor, Object[] args) { public Object instantiate(Constructor<?> ctor, Object[] args) {
Enhancer enhancer = new Enhancer(); Enhancer enhancer = new Enhancer();

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2012 the original author or authors. * Copyright 2002-2014 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -39,8 +39,8 @@ public class LookupOverride extends MethodOverride {
* Construct a new LookupOverride. * Construct a new LookupOverride.
* @param methodName the name of the method to override. * @param methodName the name of the method to override.
* This method must have no arguments. * This method must have no arguments.
* @param beanName name of the bean in the current BeanFactory * @param beanName the name of the bean in the current BeanFactory
* that the overriden method should return * that the overridden method should return
*/ */
public LookupOverride(String methodName, String beanName) { public LookupOverride(String methodName, String beanName) {
super(methodName); super(methodName);
@ -55,16 +55,14 @@ public class LookupOverride extends MethodOverride {
return this.beanName; return this.beanName;
} }
/** /**
* Match method of the given name, with no parameters. * Match the method of the given name, with no parameters.
*/ */
@Override @Override
public boolean matches(Method method) { public boolean matches(Method method) {
return (method.getName().equals(getMethodName()) && method.getParameterTypes().length == 0); return (method.getName().equals(getMethodName()) && method.getParameterTypes().length == 0);
} }
@Override @Override
public String toString() { public String toString() {
return "LookupOverride for method '" + getMethodName() + "'; will return bean '" + this.beanName + "'"; return "LookupOverride for method '" + getMethodName() + "'; will return bean '" + this.beanName + "'";

Loading…
Cancel
Save