- Revision
- 559
- Author
- mward
- Date
- 2008-01-18 22:23:41 -0600 (Fri, 18 Jan 2008)
Log Message
javadoc: added more documentation
Modified Paths
- trunk/waffle-core/src/main/java/org/codehaus/waffle/controller/RubyController.java
- trunk/waffle-core/src/main/java/org/codehaus/waffle/controller/RubyControllerDefinitionFactory.java
- trunk/waffle-core/src/main/java/org/codehaus/waffle/i18n/DefaultMessageResources.java
- trunk/waffle-core/src/main/java/org/codehaus/waffle/registrar/RequestAttributeReference.java
- trunk/waffle-core/src/main/java/org/codehaus/waffle/registrar/RequestParameterReference.java
- trunk/waffle-core/src/main/java/org/codehaus/waffle/registrar/pico/AbstractWaffleParameter.java
- trunk/waffle-core/src/main/java/org/codehaus/waffle/registrar/pico/DefaultParameterResolver.java
- trunk/waffle-core/src/main/java/org/codehaus/waffle/registrar/pico/ParameterResolver.java
- trunk/waffle-core/src/main/java/org/codehaus/waffle/registrar/pico/RequestAttributeParameter.java
- trunk/waffle-core/src/main/java/org/codehaus/waffle/registrar/pico/RubyScriptComponentAdapter.java
- trunk/waffle-core/src/main/java/org/codehaus/waffle/registrar/pico/ServletContextAttributeParameter.java
- trunk/waffle-core/src/main/java/org/codehaus/waffle/registrar/pico/SessionAttributeParameter.java
- trunk/waffle-core/src/main/java/org/codehaus/waffle/servlet/ServletContextHelper.java
- trunk/waffle-core/src/main/java/org/codehaus/waffle/view/RedirectView.java
Diff
Modified: trunk/waffle-core/src/main/java/org/codehaus/waffle/controller/RubyController.java (558 => 559)
--- trunk/waffle-core/src/main/java/org/codehaus/waffle/controller/RubyController.java 2008-01-18 16:03:40 UTC (rev 558) +++ trunk/waffle-core/src/main/java/org/codehaus/waffle/controller/RubyController.java 2008-01-19 04:23:41 UTC (rev 559) @@ -14,6 +14,8 @@ /** * This is a wrapper for the underlying ruby script + * + * @author Michael Ward */ public class RubyController { private String methodName; @@ -31,6 +33,11 @@ return rubyObject; } + /** + * This will invoke the method on the ruby object instance this controller is maintaining. + * + * @return the result from the method invocation. + */ public Object execute() { Ruby runtime = rubyObject.getRuntime(); String[] strings = methodName.split("\\|");
Modified: trunk/waffle-core/src/main/java/org/codehaus/waffle/controller/RubyControllerDefinitionFactory.java (558 => 559)
--- trunk/waffle-core/src/main/java/org/codehaus/waffle/controller/RubyControllerDefinitionFactory.java 2008-01-18 16:03:40 UTC (rev 558) +++ trunk/waffle-core/src/main/java/org/codehaus/waffle/controller/RubyControllerDefinitionFactory.java 2008-01-19 04:23:41 UTC (rev 559) @@ -11,6 +11,12 @@ import javax.servlet.http.HttpServletResponse; import java.lang.reflect.Method; +/** + * A JRuby specific extension to the [EMAIL PROTECTED] ContextControllerDefinitionFactory} if the controller found is an instance + * of [EMAIL PROTECTED] IRubyObject} then that object will be wrapped with a [EMAIL PROTECTED] RubyController}. + * + * @author Michael Ward + */ public class RubyControllerDefinitionFactory extends ContextControllerDefinitionFactory { private final MethodNameResolver methodNameResolver; private static final Method executeMethod; @@ -31,6 +37,14 @@ this.methodNameResolver = methodNameResolver; } + /** + * Delegates the lookup of the controller to its super class the result will be wrapped as [EMAIL PROTECTED] RubyController} if + * the type is a [EMAIL PROTECTED] IRubyObject} + * + * @param name the name of the controller being requested + * @param request the current request + * @return the controller requested. + */ @Override protected Object findController(String name, HttpServletRequest request) { Object controller = super.findController(name, request);
Modified: trunk/waffle-core/src/main/java/org/codehaus/waffle/i18n/DefaultMessageResources.java (558 => 559)
--- trunk/waffle-core/src/main/java/org/codehaus/waffle/i18n/DefaultMessageResources.java 2008-01-18 16:03:40 UTC (rev 558) +++ trunk/waffle-core/src/main/java/org/codehaus/waffle/i18n/DefaultMessageResources.java 2008-01-19 04:23:41 UTC (rev 559) @@ -15,6 +15,10 @@ import java.util.MissingResourceException; import java.util.ResourceBundle; +/** + * + * @author Michael Ward + */ public class DefaultMessageResources implements MessageResources { private final static ThreadLocal<Locale> userLocale = new ThreadLocal<Locale>(); public final String bundleName;
Modified: trunk/waffle-core/src/main/java/org/codehaus/waffle/registrar/RequestAttributeReference.java (558 => 559)
--- trunk/waffle-core/src/main/java/org/codehaus/waffle/registrar/RequestAttributeReference.java 2008-01-18 16:03:40 UTC (rev 558) +++ trunk/waffle-core/src/main/java/org/codehaus/waffle/registrar/RequestAttributeReference.java 2008-01-19 04:23:41 UTC (rev 559) @@ -11,7 +11,9 @@ package org.codehaus.waffle.registrar; /** - * Allows for a component dependency to be resolved from a [EMAIL PROTECTED] ServletRequest} attribute. + * <p>Allows for a component dependency to be resolved from a [EMAIL PROTECTED] ServletRequest} attribute.</p> + * <br/> + * <p><b>NOTE:</b> This should only be utilized from [EMAIL PROTECTED] org.codehaus.waffle.registrar.Registrar#request()}.</p> * * @author Michael Ward */ @@ -31,6 +33,7 @@ * @param key is the <code>String</code> specifying the name of the request attribute. */ public static RequestAttributeReference requestAttribute(String key) { + // TODO mward: need to determine current context and if NOT 'request' an exception should be thrown! return new RequestAttributeReference(key); }
Modified: trunk/waffle-core/src/main/java/org/codehaus/waffle/registrar/RequestParameterReference.java (558 => 559)
--- trunk/waffle-core/src/main/java/org/codehaus/waffle/registrar/RequestParameterReference.java 2008-01-18 16:03:40 UTC (rev 558) +++ trunk/waffle-core/src/main/java/org/codehaus/waffle/registrar/RequestParameterReference.java 2008-01-19 04:23:41 UTC (rev 559) @@ -11,7 +11,9 @@ package org.codehaus.waffle.registrar; /** - * Allows for a component dependency to be resolved from a [EMAIL PROTECTED] ServletRequest} parameter. + * <p>Allows for a component dependency to be resolved from a [EMAIL PROTECTED] ServletRequest} parameter</p> + * <br/> + * <p><b>NOTE:</b> This should only be utilized from [EMAIL PROTECTED] org.codehaus.waffle.registrar.Registrar#request()}.</p> * * @author Michael Ward */ @@ -51,6 +53,7 @@ * @param key is the <code>String</code> specifying the name of the request parameter. */ public static RequestParameterReference requestParameter(String key) { + // TODO mward: need to determine current context and if NOT 'request' an exception should be thrown! return new RequestParameterReference(key); } @@ -63,6 +66,7 @@ * default value since the standard default value will be returned (e.g. int => 0, double => 0.0) */ public static RequestParameterReference requestParameter(String key, Object defaultValue) { + // TODO mward: need to determine current context and if NOT 'request' an exception should be thrown! return new RequestParameterReference(key, defaultValue); } } \ No newline at end of file
Modified: trunk/waffle-core/src/main/java/org/codehaus/waffle/registrar/pico/AbstractWaffleParameter.java (558 => 559)
--- trunk/waffle-core/src/main/java/org/codehaus/waffle/registrar/pico/AbstractWaffleParameter.java 2008-01-18 16:03:40 UTC (rev 558) +++ trunk/waffle-core/src/main/java/org/codehaus/waffle/registrar/pico/AbstractWaffleParameter.java 2008-01-19 04:23:41 UTC (rev 559) @@ -15,6 +15,11 @@ import org.picocontainer.PicoContainer; import org.picocontainer.PicoVisitor; +/** + * A base for Waffle's implementation of PicoContainer Parameter. + * + * @author Michael Ward + */ abstract class AbstractWaffleParameter implements Parameter { private final String key; @@ -31,7 +36,7 @@ } public void verify(PicoContainer picoContainer, ComponentAdapter componentAdapter, Class clazz) { - + // do nothing } public void accept(PicoVisitor picoVisitor) {
Modified: trunk/waffle-core/src/main/java/org/codehaus/waffle/registrar/pico/DefaultParameterResolver.java (558 => 559)
--- trunk/waffle-core/src/main/java/org/codehaus/waffle/registrar/pico/DefaultParameterResolver.java 2008-01-18 16:03:40 UTC (rev 558) +++ trunk/waffle-core/src/main/java/org/codehaus/waffle/registrar/pico/DefaultParameterResolver.java 2008-01-19 04:23:41 UTC (rev 559) @@ -22,6 +22,11 @@ import org.picocontainer.defaults.ComponentParameter; import org.picocontainer.defaults.ConstantParameter; +/** + * This base implementation will determine the correct [EMAIL PROTECTED] Parameter} based on the argument being resolved. + * + * @author Michael Ward + */ public class DefaultParameterResolver implements ParameterResolver { private final StringTransmuter stringTransmuter; @@ -29,6 +34,13 @@ this.stringTransmuter = stringTransmuter; } + /** + * An argument of type Reference will be mapped to the correct Parameter implemntation while other types + * will be treated as a constant ([EMAIL PROTECTED] ConstantParameter}) + * + * @param argument the argument to be resolved + * @return the correct Parameter. + */ public Parameter resolve(Object argument) { if (argument instanceof Reference) { Reference reference = (Reference) argument;
Modified: trunk/waffle-core/src/main/java/org/codehaus/waffle/registrar/pico/ParameterResolver.java (558 => 559)
--- trunk/waffle-core/src/main/java/org/codehaus/waffle/registrar/pico/ParameterResolver.java 2008-01-18 16:03:40 UTC (rev 558) +++ trunk/waffle-core/src/main/java/org/codehaus/waffle/registrar/pico/ParameterResolver.java 2008-01-19 04:23:41 UTC (rev 559) @@ -12,6 +12,19 @@ import org.picocontainer.Parameter; +/** + * Implementations of this interface will find the correct PicoContainer Parameter needed based on the + * argument being resolved + * + * @author Michael Ward + */ public interface ParameterResolver { + + /** + * Find the correct Parameter + * + * @param arg the argument to be resolved + * @return the correct Parameter. + */ Parameter resolve(Object arg); }
Modified: trunk/waffle-core/src/main/java/org/codehaus/waffle/registrar/pico/RequestAttributeParameter.java (558 => 559)
--- trunk/waffle-core/src/main/java/org/codehaus/waffle/registrar/pico/RequestAttributeParameter.java 2008-01-18 16:03:40 UTC (rev 558) +++ trunk/waffle-core/src/main/java/org/codehaus/waffle/registrar/pico/RequestAttributeParameter.java 2008-01-19 04:23:41 UTC (rev 559) @@ -15,6 +15,11 @@ import javax.servlet.http.HttpServletRequest; +/** + * Will resolve value from the [EMAIL PROTECTED] HttpServletRequest} attribute. + * + * @author Michael Ward + */ class RequestAttributeParameter extends AbstractWaffleParameter { protected RequestAttributeParameter(String key) {
Modified: trunk/waffle-core/src/main/java/org/codehaus/waffle/registrar/pico/RubyScriptComponentAdapter.java (558 => 559)
--- trunk/waffle-core/src/main/java/org/codehaus/waffle/registrar/pico/RubyScriptComponentAdapter.java 2008-01-18 16:03:40 UTC (rev 558) +++ trunk/waffle-core/src/main/java/org/codehaus/waffle/registrar/pico/RubyScriptComponentAdapter.java 2008-01-19 04:23:41 UTC (rev 559) @@ -9,6 +9,11 @@ import org.picocontainer.PicoIntrospectionException; import org.picocontainer.PicoVisitor; +/** + * This ComponentAdapter implementation is needed to correctly instantiate a Ruby script for use in Waffle. + * + * @author Michael Ward + */ public class RubyScriptComponentAdapter implements ComponentAdapter { private final Object componentKey; private final String rubyClassName;
Modified: trunk/waffle-core/src/main/java/org/codehaus/waffle/registrar/pico/ServletContextAttributeParameter.java (558 => 559)
--- trunk/waffle-core/src/main/java/org/codehaus/waffle/registrar/pico/ServletContextAttributeParameter.java 2008-01-18 16:03:40 UTC (rev 558) +++ trunk/waffle-core/src/main/java/org/codehaus/waffle/registrar/pico/ServletContextAttributeParameter.java 2008-01-19 04:23:41 UTC (rev 559) @@ -15,6 +15,11 @@ import javax.servlet.ServletContext; +/** + * Will resolve value from the [EMAIL PROTECTED] ServletContext} attribute. + * + * @author Michael Ward + */ class ServletContextAttributeParameter extends AbstractWaffleParameter { protected ServletContextAttributeParameter(String key) {
Modified: trunk/waffle-core/src/main/java/org/codehaus/waffle/registrar/pico/SessionAttributeParameter.java (558 => 559)
--- trunk/waffle-core/src/main/java/org/codehaus/waffle/registrar/pico/SessionAttributeParameter.java 2008-01-18 16:03:40 UTC (rev 558) +++ trunk/waffle-core/src/main/java/org/codehaus/waffle/registrar/pico/SessionAttributeParameter.java 2008-01-19 04:23:41 UTC (rev 559) @@ -15,6 +15,11 @@ import javax.servlet.http.HttpSession; +/** + * Will resolve value from the [EMAIL PROTECTED] HttpSession} attribute. + * + * @author Michael Ward + */ class SessionAttributeParameter extends AbstractWaffleParameter { protected SessionAttributeParameter(String key) {
Modified: trunk/waffle-core/src/main/java/org/codehaus/waffle/servlet/ServletContextHelper.java (558 => 559)
--- trunk/waffle-core/src/main/java/org/codehaus/waffle/servlet/ServletContextHelper.java 2008-01-18 16:03:40 UTC (rev 558) +++ trunk/waffle-core/src/main/java/org/codehaus/waffle/servlet/ServletContextHelper.java 2008-01-19 04:23:41 UTC (rev 559) @@ -10,20 +10,28 @@ *****************************************************************************/ package org.codehaus.waffle.servlet; -import javax.servlet.ServletContext; - import org.codehaus.waffle.ComponentRegistry; import org.codehaus.waffle.WaffleException; import org.codehaus.waffle.context.WaffleContextListener; +import javax.servlet.ServletContext; import java.text.MessageFormat; +/** + * @author Michael Ward + */ public class ServletContextHelper { private ServletContextHelper() { // should not be instantiated } + /** + * Allows access to Waffle core components + * + * @param servletContext + * @return the ComponentRegistry for the running application + */ public static ComponentRegistry getComponentRegistry(ServletContext servletContext) { ComponentRegistry componentRegistry = (ComponentRegistry) servletContext .getAttribute(ComponentRegistry.class.getName());
Modified: trunk/waffle-core/src/main/java/org/codehaus/waffle/view/RedirectView.java (558 => 559)
--- trunk/waffle-core/src/main/java/org/codehaus/waffle/view/RedirectView.java 2008-01-18 16:03:40 UTC (rev 558) +++ trunk/waffle-core/src/main/java/org/codehaus/waffle/view/RedirectView.java 2008-01-19 04:23:41 UTC (rev 559) @@ -13,6 +13,8 @@ import javax.servlet.http.HttpServletResponse; /** + * Indicates that the view should be redirected to. + * * @author Michael Ward */ public class RedirectView extends View {
To unsubscribe from this list please visit:
