Author: lukaszlenart
Date: Thu Sep 6 11:25:26 2012
New Revision: 1381560
URL: http://svn.apache.org/viewvc?rev=1381560&view=rev
Log:
WW-3874 merges AnnotationTools into AnnotationUtils
Added:
struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/annotation/
struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/annotation/Dummy2Class.java
struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/annotation/DummyClass.java
struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/annotation/DummyClassExt.java
struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/annotation/MyAnnotation.java
struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/annotation/MyAnnotation2.java
struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/annotation/package-info.java
Removed:
struts/struts2/trunk/plugins/convention/src/main/java/org/apache/struts2/convention/annotation/AnnotationTools.java
struts/struts2/trunk/plugins/convention/src/test/java/org/apache/struts2/convention/annotation/AnnotationToolsTest.java
Modified:
struts/struts2/trunk/plugins/convention/src/main/java/org/apache/struts2/convention/ConventionsServiceImpl.java
struts/struts2/trunk/plugins/convention/src/main/java/org/apache/struts2/convention/DefaultInterceptorMapBuilder.java
struts/struts2/trunk/plugins/convention/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java
struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/AnnotationUtils.java
struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/AnnotationUtilsTest.java
Modified:
struts/struts2/trunk/plugins/convention/src/main/java/org/apache/struts2/convention/ConventionsServiceImpl.java
URL:
http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/convention/src/main/java/org/apache/struts2/convention/ConventionsServiceImpl.java?rev=1381560&r1=1381559&r2=1381560&view=diff
==============================================================================
---
struts/struts2/trunk/plugins/convention/src/main/java/org/apache/struts2/convention/ConventionsServiceImpl.java
(original)
+++
struts/struts2/trunk/plugins/convention/src/main/java/org/apache/struts2/convention/ConventionsServiceImpl.java
Thu Sep 6 11:25:26 2012
@@ -25,8 +25,8 @@ import com.opensymphony.xwork2.config.en
import com.opensymphony.xwork2.config.entities.PackageConfig;
import com.opensymphony.xwork2.config.entities.ResultTypeConfig;
import com.opensymphony.xwork2.inject.Inject;
+import com.opensymphony.xwork2.util.AnnotationUtils;
import com.opensymphony.xwork2.util.ClassLoaderUtil;
-import org.apache.struts2.convention.annotation.AnnotationTools;
import org.apache.struts2.convention.annotation.ResultPath;
import java.util.HashMap;
@@ -58,7 +58,7 @@ public class ConventionsServiceImpl impl
*/
public String determineResultPath(Class<?> actionClass) {
String localResultPath = resultPath;
- ResultPath resultPathAnnotation =
AnnotationTools.findAnnotation(actionClass, ResultPath.class);
+ 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" +
Modified:
struts/struts2/trunk/plugins/convention/src/main/java/org/apache/struts2/convention/DefaultInterceptorMapBuilder.java
URL:
http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/convention/src/main/java/org/apache/struts2/convention/DefaultInterceptorMapBuilder.java?rev=1381560&r1=1381559&r2=1381560&view=diff
==============================================================================
---
struts/struts2/trunk/plugins/convention/src/main/java/org/apache/struts2/convention/DefaultInterceptorMapBuilder.java
(original)
+++
struts/struts2/trunk/plugins/convention/src/main/java/org/apache/struts2/convention/DefaultInterceptorMapBuilder.java
Thu Sep 6 11:25:26 2012
@@ -20,19 +20,8 @@
*/
package org.apache.struts2.convention;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.struts2.convention.annotation.Action;
-import org.apache.struts2.convention.annotation.AnnotationTools;
-import org.apache.struts2.convention.annotation.InterceptorRef;
-import org.apache.struts2.convention.annotation.InterceptorRefs;
-
import com.opensymphony.xwork2.ObjectFactory;
import com.opensymphony.xwork2.config.Configuration;
-import com.opensymphony.xwork2.config.ConfigurationException;
import com.opensymphony.xwork2.config.entities.InterceptorMapping;
import com.opensymphony.xwork2.config.entities.PackageConfig;
import com.opensymphony.xwork2.config.providers.InterceptorBuilder;
@@ -40,6 +29,13 @@ import com.opensymphony.xwork2.inject.In
import com.opensymphony.xwork2.util.AnnotationUtils;
import com.opensymphony.xwork2.util.logging.Logger;
import com.opensymphony.xwork2.util.logging.LoggerFactory;
+import org.apache.struts2.convention.annotation.Action;
+import org.apache.struts2.convention.annotation.InterceptorRef;
+import org.apache.struts2.convention.annotation.InterceptorRefs;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
/**
* <p>
@@ -58,12 +54,12 @@ public class DefaultInterceptorMapBuilde
10);
//from @InterceptorRefs annotation
- InterceptorRefs interceptorRefs =
AnnotationTools.findAnnotation(actionClass, InterceptorRefs.class);
+ InterceptorRefs interceptorRefs =
AnnotationUtils.findAnnotation(actionClass, InterceptorRefs.class);
if (interceptorRefs != null)
interceptorList.addAll(build(interceptorRefs.value(), actionName,
builder));
//from @InterceptorRef annotation
- InterceptorRef interceptorRef =
AnnotationTools.findAnnotation(actionClass, InterceptorRef.class);
+ InterceptorRef interceptorRef =
AnnotationUtils.findAnnotation(actionClass, InterceptorRef.class);
if (interceptorRef != null)
interceptorList.addAll(build(new InterceptorRef[]
{interceptorRef}, actionName, builder));
Modified:
struts/struts2/trunk/plugins/convention/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java
URL:
http://svn.apache.org/viewvc/struts/struts2/trunk/plugins/convention/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java?rev=1381560&r1=1381559&r2=1381560&view=diff
==============================================================================
---
struts/struts2/trunk/plugins/convention/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java
(original)
+++
struts/struts2/trunk/plugins/convention/src/main/java/org/apache/struts2/convention/PackageBasedActionConfigBuilder.java
Thu Sep 6 11:25:26 2012
@@ -33,6 +33,7 @@ import com.opensymphony.xwork2.config.en
import com.opensymphony.xwork2.config.entities.ResultConfig;
import com.opensymphony.xwork2.inject.Container;
import com.opensymphony.xwork2.inject.Inject;
+import com.opensymphony.xwork2.util.AnnotationUtils;
import com.opensymphony.xwork2.util.TextParseUtil;
import com.opensymphony.xwork2.util.WildcardHelper;
import com.opensymphony.xwork2.util.classloader.ReloadingClassLoader;
@@ -50,7 +51,6 @@ import org.apache.struts2.StrutsConstant
import org.apache.struts2.StrutsException;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Actions;
-import org.apache.struts2.convention.annotation.AnnotationTools;
import org.apache.struts2.convention.annotation.DefaultInterceptorRef;
import org.apache.struts2.convention.annotation.ExceptionMapping;
import org.apache.struts2.convention.annotation.ExceptionMappings;
@@ -753,7 +753,7 @@ public class PackageBasedActionConfigBui
// Check if there is a class or package level annotation for the
namespace
//single namespace
- Namespace namespaceAnnotation =
AnnotationTools.findAnnotation(actionClass, Namespace.class);
+ Namespace namespaceAnnotation =
AnnotationUtils.findAnnotation(actionClass, Namespace.class);
if (namespaceAnnotation != null) {
if (LOG.isTraceEnabled()) {
LOG.trace("Using non-default action namespace from Namespace
annotation of [#0]", namespaceAnnotation.value());
@@ -763,7 +763,7 @@ public class PackageBasedActionConfigBui
}
//multiple annotations
- Namespaces namespacesAnnotation =
AnnotationTools.findAnnotation(actionClass, Namespaces.class);
+ Namespaces namespacesAnnotation =
AnnotationUtils.findAnnotation(actionClass, Namespaces.class);
if (namespacesAnnotation != null) {
if (LOG.isTraceEnabled()) {
StringBuilder sb = new StringBuilder();
@@ -979,7 +979,7 @@ public class PackageBasedActionConfigBui
}
// Next grab the parent annotation from the class
- ParentPackage parent = AnnotationTools.findAnnotation(actionClass,
ParentPackage.class);
+ ParentPackage parent = AnnotationUtils.findAnnotation(actionClass,
ParentPackage.class);
String parentName = null;
if (parent != null) {
if (LOG.isTraceEnabled()) {
@@ -1013,7 +1013,7 @@ public class PackageBasedActionConfigBui
packageConfigs.put(name, pkgConfig);
//check for @DefaultInterceptorRef in the package
- DefaultInterceptorRef defaultInterceptorRef =
AnnotationTools.findAnnotation(actionClass, DefaultInterceptorRef.class);
+ DefaultInterceptorRef defaultInterceptorRef =
AnnotationUtils.findAnnotation(actionClass, DefaultInterceptorRef.class);
if (defaultInterceptorRef != null) {
pkgConfig.defaultInterceptorRef(defaultInterceptorRef.value());
Modified:
struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/AnnotationUtils.java
URL:
http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/AnnotationUtils.java?rev=1381560&r1=1381559&r2=1381560&view=diff
==============================================================================
---
struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/AnnotationUtils.java
(original)
+++
struts/struts2/trunk/xwork-core/src/main/java/com/opensymphony/xwork2/util/AnnotationUtils.java
Thu Sep 6 11:25:26 2012
@@ -15,13 +15,14 @@
*/
package com.opensymphony.xwork2.util;
-import java.io.File;
import java.lang.annotation.Annotation;
import java.lang.reflect.AnnotatedElement;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
-import java.net.URL;
-import java.util.*;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -49,7 +50,7 @@ public class AnnotationUtils {
* @param clazz
* @param allFields
*/
- public static void addAllFields(Class annotationClass, Class clazz,
List<Field> allFields) {
+ public static void addAllFields(Class<? extends Annotation>
annotationClass, Class clazz, List<Field> allFields) {
if (clazz == null) {
return;
@@ -73,7 +74,7 @@ public class AnnotationUtils {
* @param clazz
* @param allMethods
*/
- public static void addAllMethods(Class annotationClass, Class clazz,
List<Method> allMethods) {
+ public static void addAllMethods(Class<? extends Annotation>
annotationClass, Class clazz, List<Method> allMethods) {
if (clazz == null) {
return;
@@ -116,11 +117,11 @@ public class AnnotationUtils {
* @return A {@link Collection}<{@link AnnotatedElement}>
containing all of the
* method {@link AnnotatedElement}s matching the specified {@link
Annotation}s
*/
- public static final Collection<Method> getAnnotatedMethods(Class clazz,
Class<? extends Annotation>... annotation){
+ public static Collection<Method> getAnnotatedMethods(Class clazz,
Class<? extends Annotation>... annotation){
Collection<Method> toReturn = new HashSet<Method>();
for(Method m : clazz.getMethods()){
- if( ArrayUtils.isNotEmpty(annotation) &&
isAnnotatedBy(m,annotation) ){
+ if( ArrayUtils.isNotEmpty(annotation) &&
isAnnotatedBy(m, annotation) ){
toReturn.add(m);
}else if( ArrayUtils.isEmpty(annotation) &&
ArrayUtils.isNotEmpty(m.getAnnotations())){
toReturn.add(m);
@@ -134,44 +135,19 @@ public class AnnotationUtils {
* Varargs version of
<code>AnnotatedElement.isAnnotationPresent()</code>
* @see AnnotatedElement
*/
- public static final boolean isAnnotatedBy(AnnotatedElement
annotatedElement, Class<? extends Annotation>... annotation) {
+ public static boolean isAnnotatedBy(AnnotatedElement annotatedElement,
Class<? extends Annotation>... annotation) {
if(ArrayUtils.isEmpty(annotation)) return false;
-
+
for( Class<? extends Annotation> c : annotation ){
if( annotatedElement.isAnnotationPresent(c) ) return
true;
}
-
- return false;
- }
-
- /**
- *
- * @deprecated since 2.0.4 use getAnnotatedMethods
- */
- @Deprecated
- public static List<Method> findAnnotatedMethods(Class clazz, Class<?
extends Annotation> annotationClass) {
- List<Method> methods = new ArrayList<Method>();
- findRecursively(clazz, annotationClass, methods);
- return methods;
- }
- /**
- *
- * @deprecated since 2.0.4 use getAnnotatedMethods
- */
- @Deprecated
- public static void findRecursively(Class clazz, Class<? extends
Annotation> annotationClass, List<Method> methods) {
- for (Method m : clazz.getDeclaredMethods()) {
- if (m.getAnnotation(annotationClass) != null) { methods.add(0, m);
}
- }
- if (clazz.getSuperclass() != Object.class) {
- findRecursively(clazz.getSuperclass(), annotationClass, methods);
- }
- }
+ return false;
+ }
/**
* Returns the property name for a method.
- * This method is independant from property fields.
+ * This method is independent from property fields.
*
* @param method The method to get the property name for.
* @return the property name for given method; null if non could be
resolved.
@@ -193,35 +169,28 @@ public class AnnotationUtils {
return null;
}
-
/**
- * Retrieves all classes within a packages.
- * TODO: this currently does not work with jars.
+ * Returns the annotation on the given class or the package of the class.
This searchs up the
+ * class hierarchy and the package hierarchy for the closest match.
*
- * @param pckgname
- * @return Array of full qualified class names from this package.
- */
- public static String[] find(Class clazz, final String pckgname) {
-
- List<String> classes = new ArrayList<String>();
- String name = new String(pckgname);
- if (!name.startsWith("/")) {
- name = "/" + name;
- }
-
- name = name.replace('.', File.separatorChar);
-
- final URL url = clazz.getResource(name);
- final File directory = new File(url.getFile());
-
- if (directory.exists()) {
- final String[] files = directory.list();
- for (String file : files) {
- if (file.endsWith(".class")) {
- classes.add(pckgname + "." + file.substring(0,
file.length() - 6));
+ * @param klass The class to search for the annotation.
+ * @param annotationClass The Class of the annotation.
+ * @return The annotation or null.
+ */
+ public static <T extends Annotation> T findAnnotation(Class<?> klass,
Class<T> annotationClass) {
+ T ann = klass.getAnnotation(annotationClass);
+ while (ann == null && klass != null) {
+ ann = klass.getAnnotation(annotationClass);
+ if (ann == null)
+ ann = klass.getPackage().getAnnotation(annotationClass);
+ if (ann == null) {
+ klass = klass.getSuperclass();
+ if (klass != null ) {
+ ann = klass.getAnnotation(annotationClass);
}
}
}
- return classes.toArray(new String[classes.size()]);
+
+ return ann;
}
}
Modified:
struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/AnnotationUtilsTest.java
URL:
http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/AnnotationUtilsTest.java?rev=1381560&r1=1381559&r2=1381560&view=diff
==============================================================================
---
struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/AnnotationUtilsTest.java
(original)
+++
struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/AnnotationUtilsTest.java
Thu Sep 6 11:25:26 2012
@@ -1,9 +1,12 @@
package com.opensymphony.xwork2.util;
+import com.opensymphony.xwork2.util.annotation.Dummy2Class;
+import com.opensymphony.xwork2.util.annotation.DummyClass;
+import com.opensymphony.xwork2.util.annotation.DummyClassExt;
+import com.opensymphony.xwork2.util.annotation.MyAnnotation;
+import com.opensymphony.xwork2.util.annotation.MyAnnotation2;
import junit.framework.TestCase;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
import java.lang.reflect.AnnotatedElement;
import java.util.Collection;
@@ -12,43 +15,33 @@ import java.util.Collection;
*/
public class AnnotationUtilsTest extends TestCase {
-
+ @SuppressWarnings("unchecked")
public void testIsAnnotatedByWithoutAnnotationArgsReturnsFalse() throws
Exception {
-
assertFalse(AnnotationUtils.isAnnotatedBy(DummyClass.class));
assertFalse(AnnotationUtils.isAnnotatedBy(DummyClass.class.getMethod("methodWithAnnotation")));
-
}
@SuppressWarnings("unchecked")
public void testIsAnnotatedByWithSingleAnnotationArgMatchingReturnsTrue()
throws Exception {
-
assertTrue(AnnotationUtils.isAnnotatedBy(DummyClass.class.getMethod("methodWithAnnotation"),
MyAnnotation.class));
-
}
@SuppressWarnings("unchecked")
public void testIsAnnotatedByWithMultiAnnotationArgMatchingReturnsTrue()
throws Exception {
-
assertFalse(AnnotationUtils.isAnnotatedBy(DummyClass.class.getMethod("methodWithAnnotation"),
Deprecated.class));
assertTrue(AnnotationUtils.isAnnotatedBy(DummyClass.class.getMethod("methodWithAnnotation"),
MyAnnotation.class, Deprecated.class));
assertTrue(AnnotationUtils.isAnnotatedBy(DummyClass.class.getMethod("methodWithAnnotation"),
Deprecated.class, MyAnnotation.class));
-
}
+ @SuppressWarnings("unchecked")
public void testGetAnnotedMethodsWithoutAnnotationArgs() throws Exception {
-
Collection<? extends AnnotatedElement> ans =
AnnotationUtils.getAnnotatedMethods(DummyClass.class);
-
assertTrue(ans.size() == 1);
-
assertEquals(ans.iterator().next(),
DummyClass.class.getMethod("methodWithAnnotation"));
-
}
@SuppressWarnings("unchecked")
public void testGetAnnotatedMethodsWithAnnotationArgs() throws Exception {
-
Collection<? extends AnnotatedElement> ans =
AnnotationUtils.getAnnotatedMethods(DummyClass.class, Deprecated.class);
assertTrue(ans.isEmpty());
@@ -63,39 +56,18 @@ public class AnnotationUtilsTest extends
ans = AnnotationUtils.getAnnotatedMethods(DummyClassExt.class,
MyAnnotation.class, MyAnnotation2.class);
assertEquals(2, ans.size());
-
- }
-
- /**
- * *****************************************************************
- * <p/>
- * TEST CLASSES
- */
- private static class DummyClass {
-
- public DummyClass() {
- }
-
- @MyAnnotation
- public void methodWithAnnotation() {
- }
-
- }
-
- @Retention(RetentionPolicy.RUNTIME)
- public @interface MyAnnotation {
}
- private static final class DummyClassExt extends DummyClass {
-
- @MyAnnotation2
- public void anotherAnnotatedMethod() {
- }
-
+ public void testFindAnnotationOnClass() {
+ MyAnnotation a1 = AnnotationUtils.findAnnotation(DummyClass.class,
MyAnnotation.class);
+ assertNotNull(a1);
+ assertEquals("class-test", a1.value());
}
- @Retention(RetentionPolicy.RUNTIME)
- public @interface MyAnnotation2 {
+ public void testFindAnnotationOnPackage() {
+ MyAnnotation ns = AnnotationUtils.findAnnotation(Dummy2Class.class,
MyAnnotation.class);
+ assertNotNull(ns);
+ assertEquals("package-test", ns.value());
}
}
Added:
struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/annotation/Dummy2Class.java
URL:
http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/annotation/Dummy2Class.java?rev=1381560&view=auto
==============================================================================
---
struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/annotation/Dummy2Class.java
(added)
+++
struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/annotation/Dummy2Class.java
Thu Sep 6 11:25:26 2012
@@ -0,0 +1,9 @@
+package com.opensymphony.xwork2.util.annotation;
+
+public class Dummy2Class {
+
+ @MyAnnotation("class-test")
+ public void methodWithAnnotation() {
+ }
+
+}
Added:
struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/annotation/DummyClass.java
URL:
http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/annotation/DummyClass.java?rev=1381560&view=auto
==============================================================================
---
struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/annotation/DummyClass.java
(added)
+++
struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/annotation/DummyClass.java
Thu Sep 6 11:25:26 2012
@@ -0,0 +1,13 @@
+package com.opensymphony.xwork2.util.annotation;
+
+@MyAnnotation("class-test")
+public class DummyClass {
+
+ public DummyClass() {
+ }
+
+ @MyAnnotation("method-test")
+ public void methodWithAnnotation() {
+ }
+
+}
Added:
struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/annotation/DummyClassExt.java
URL:
http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/annotation/DummyClassExt.java?rev=1381560&view=auto
==============================================================================
---
struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/annotation/DummyClassExt.java
(added)
+++
struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/annotation/DummyClassExt.java
Thu Sep 6 11:25:26 2012
@@ -0,0 +1,9 @@
+package com.opensymphony.xwork2.util.annotation;
+
+public final class DummyClassExt extends DummyClass {
+
+ @MyAnnotation2
+ public void anotherAnnotatedMethod() {
+ }
+
+}
Added:
struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/annotation/MyAnnotation.java
URL:
http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/annotation/MyAnnotation.java?rev=1381560&view=auto
==============================================================================
---
struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/annotation/MyAnnotation.java
(added)
+++
struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/annotation/MyAnnotation.java
Thu Sep 6 11:25:26 2012
@@ -0,0 +1,11 @@
+package com.opensymphony.xwork2.util.annotation;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+@Retention(RetentionPolicy.RUNTIME)
+public @interface MyAnnotation {
+
+ String value();
+
+}
Added:
struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/annotation/MyAnnotation2.java
URL:
http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/annotation/MyAnnotation2.java?rev=1381560&view=auto
==============================================================================
---
struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/annotation/MyAnnotation2.java
(added)
+++
struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/annotation/MyAnnotation2.java
Thu Sep 6 11:25:26 2012
@@ -0,0 +1,8 @@
+package com.opensymphony.xwork2.util.annotation;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+@Retention(RetentionPolicy.RUNTIME)
+public @interface MyAnnotation2 {
+}
Added:
struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/annotation/package-info.java
URL:
http://svn.apache.org/viewvc/struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/annotation/package-info.java?rev=1381560&view=auto
==============================================================================
---
struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/annotation/package-info.java
(added)
+++
struts/struts2/trunk/xwork-core/src/test/java/com/opensymphony/xwork2/util/annotation/package-info.java
Thu Sep 6 11:25:26 2012
@@ -0,0 +1,22 @@
+/*
+ * $Id: package-info.java 655902 2008-05-13 15:15:12Z bpontarelli $
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+@MyAnnotation("package-test")
+package com.opensymphony.xwork2.util.annotation;