public List<InterceptorMapping> build(Class<?> actionClass, PackageConfig.Builder builder, String actionName, Action annotation) { List<InterceptorMapping> interceptorList = new ArrayList<>( 10); //from @InterceptorRefs annotation InterceptorRefs interceptorRefs = AnnotationUtils.findAnnotation(actionClass, InterceptorRefs.class); if (interceptorRefs != null) interceptorList.addAll(build(interceptorRefs.value(), actionName, builder)); //from @InterceptorRef annotation InterceptorRef interceptorRef = AnnotationUtils.findAnnotation(actionClass, InterceptorRef.class); if (interceptorRef != null) interceptorList.addAll(build(new InterceptorRef[] {interceptorRef}, actionName, builder)); //from @Action annotation if (annotation != null) { InterceptorRef[] interceptors = annotation.interceptorRefs(); if (interceptors != null) { interceptorList.addAll(build(interceptors, actionName, builder)); } } return interceptorList; }
Namespace namespaceAnnotation = AnnotationUtils.findAnnotation(actionClass, Namespace.class); if (namespaceAnnotation != null) { LOG.trace("Using non-default action namespace from Namespace annotation of [{}]", namespaceAnnotation.value()); Namespaces namespacesAnnotation = AnnotationUtils.findAnnotation(actionClass, Namespaces.class); if (namespacesAnnotation != null) { if (LOG.isTraceEnabled()) {
/** * {@inheritDoc} */ public String determineResultPath(Class<?> actionClass) { String localResultPath = resultPath; ResultPath resultPathAnnotation = AnnotationUtils.findAnnotation(actionClass, ResultPath.class); if (resultPathAnnotation != null) { if (resultPathAnnotation.value().equals("") && resultPathAnnotation.property().equals("")) { throw new ConfigurationException("The ResultPath annotation must have either" + " a value or property specified."); } String property = resultPathAnnotation.property(); if (property.equals("")) { localResultPath = resultPathAnnotation.value(); } else { try { ResourceBundle strutsBundle = ResourceBundle.getBundle("struts"); localResultPath = strutsBundle.getString(property); } catch (Exception e) { throw new ConfigurationException("The action class [" + actionClass + "] defines" + " a @ResultPath annotation and a property definition however the" + " struts.properties could not be found in the classpath using ResourceBundle" + " OR the bundle exists but the property [" + property + "] is not defined" + " in the file.", e); } } } return localResultPath; }
ParentPackage parent = AnnotationUtils.findAnnotation(actionClass, ParentPackage.class); String parentName = null; if (parent != null) { DefaultInterceptorRef defaultInterceptorRef = AnnotationUtils.findAnnotation(actionClass, DefaultInterceptorRef.class); if (defaultInterceptorRef != null) { pkgConfig.defaultInterceptorRef(defaultInterceptorRef.value());