本文整理汇总了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();
}
}
}
示例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;
}
示例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;
}
}
示例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