Package net.sourceforge.stripes.action

Examples of net.sourceforge.stripes.action.HandlesEvent


        // for $event parameters with no explicit default value, get default from action resolver
        if (this.defaultValue == null && PARAMETER_NAME_EVENT.equals(name)) {
            try {
                Method defaultHandler = StripesFilter.getConfiguration().getActionResolver()
                        .getDefaultHandler(beanClass);
                HandlesEvent annotation = defaultHandler.getAnnotation(HandlesEvent.class);
                if (annotation != null)
                    this.defaultValue = annotation.value();
                else
                    this.defaultValue = defaultHandler.getName();
            }
            catch (Exception e) {
                /* Ignore any exceptions and just return null. */
 
View Full Code Here


     *
     * @param handler a method that might or might not be a handler method
     * @return the name of the event handled, or null
     */
    public String getHandledEvent(Method handler) {
        HandlesEvent mapping = handler.getAnnotation(HandlesEvent.class);
        if (mapping != null) {
            return mapping.value();
        }
        else {
            return null;
        }
    }
View Full Code Here

     *
     * @param handler a method that might or might not be a handler method
     * @return the name of the event handled, or null
     */
    public String getHandledEvent(Method handler) {
        HandlesEvent mapping = handler.getAnnotation(HandlesEvent.class);
        if (mapping != null) {
            return mapping.value();
        }
        else {
            return null;
        }
    }
View Full Code Here

        // for $event parameters with no explicit default value, get default from action resolver
        if (this.defaultValue == null && PARAMETER_NAME_EVENT.equals(name)) {
            try {
                Method defaultHandler = StripesFilter.getConfiguration().getActionResolver()
                        .getDefaultHandler(beanClass);
                HandlesEvent annotation = defaultHandler.getAnnotation(HandlesEvent.class);
                if (annotation != null)
                    this.defaultValue = annotation.value();
                else
                    this.defaultValue = defaultHandler.getName();
            }
            catch (Exception e) {
                /* Ignore any exceptions and just return null. */
 
View Full Code Here

            DefaultHandler defaultHandler = methodDec.getAnnotation(DefaultHandler.class);
            if (defaultHandler != null) {
                event.setDefaultEvent(true);
            }

            HandlesEvent handlesEvent = methodDec.getAnnotation(HandlesEvent.class);
            if (handlesEvent != null) {
                event.setName(handlesEvent.value());
            }

            // Now find the resolutions and add those to the event info
            SortedSet<String> resolutions = getResolutions(methodDec);
            event.setResolutions(resolutions);
View Full Code Here

                defaultHandler = actionResolver.getDefaultHandler(beanClass);
            } catch (StripesServletException e) {
                throw new StripesRuntimeException("Caught an exception trying to get default handler for ActionBean '" + beanClass.getName() +
                        "'. Make sure this ActionBean has a default handler.", e);
            }
            HandlesEvent annotation = defaultHandler.getAnnotation(HandlesEvent.class);
            if (annotation != null) {
                this.defaultValue = annotation.value();
            } else {
                this.defaultValue = defaultHandler.getName();
            }
        }
    }
View Full Code Here

     *
     * @param handler a method that might or might not be a handler method
     * @return the name of the event handled, or null
     */
    public String getHandledEvent(Method handler) {
        HandlesEvent mapping = handler.getAnnotation(HandlesEvent.class);
        if (mapping != null) {
            return mapping.value();
        }
        else {
            return null;
        }
    }
View Full Code Here

TOP

Related Classes of net.sourceforge.stripes.action.HandlesEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.