当前位置: 首页>>代码示例>>Java>>正文


Java HandlesEvent.value方法代码示例

本文整理汇总了Java中net.sourceforge.stripes.action.HandlesEvent.value方法的典型用法代码示例。如果您正苦于以下问题:Java HandlesEvent.value方法的具体用法?Java HandlesEvent.value怎么用?Java HandlesEvent.value使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.sourceforge.stripes.action.HandlesEvent的用法示例。


在下文中一共展示了HandlesEvent.value方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initDefaultValueWithDefaultHandlerIfNeeded

import net.sourceforge.stripes.action.HandlesEvent; //导入方法依赖的package包/类
/**
 * Ensure the default event name is set if the binding uses the $event parameter.
 * Can only be done safely after the event mappings have been processed.
 * see http://www.stripesframework.org/jira/browse/STS-803
 */
void initDefaultValueWithDefaultHandlerIfNeeded(ActionResolver actionResolver) {
    if (PARAMETER_NAME_EVENT.equals(name)) {
        Method defaultHandler;
        try {
            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();
        }
    }
}
 
开发者ID:nkasvosve,项目名称:beyondj,代码行数:23,代码来源:UrlBindingParameter.java

示例2: getDefaultValue

import net.sourceforge.stripes.action.HandlesEvent; //导入方法依赖的package包/类
/**
 * Get the parameter's default value, which may be null.
 * 
 * @return the default value
 */
public String getDefaultValue() {
    // 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. */
        }
    }

    return defaultValue;
}
 
开发者ID:scarcher2,项目名称:stripes,代码行数:25,代码来源:UrlBindingParameter.java

示例3: getHandledEvent

import net.sourceforge.stripes.action.HandlesEvent; //导入方法依赖的package包/类
/**
 * Responsible for determining the name of the event handled by this method, if indeed
 * it handles one at all.  By default looks for the HandlesEvent annotations and returns
 * it's value if present.
 *
 * @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;
    }
}
 
开发者ID:nkasvosve,项目名称:beyondj,代码行数:18,代码来源:AnnotatedClassActionResolver.java

示例4: getHandledEvent

import net.sourceforge.stripes.action.HandlesEvent; //导入方法依赖的package包/类
/**
 * Responsible for determining the name of the event handled by this method,
 * if indeed it handles one at all. By default looks for the HandlesEvent
 * annotations and returns it's value if present.
 * 
 * @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;
    }
}
 
开发者ID:geetools,项目名称:geeCommerce-Java-Shop-Software-and-PIM,代码行数:18,代码来源:AnnotatedClassActionResolver.java


注:本文中的net.sourceforge.stripes.action.HandlesEvent.value方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。