You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by th...@apache.org on 2014/04/30 20:54:45 UTC

[2/5] git commit: Closes #2305: @Sortable annotation

Closes #2305: @Sortable annotation


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/7bad88dd
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/7bad88dd
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/7bad88dd

Branch: refs/heads/master
Commit: 7bad88dd69df7eb191c1a1494bba31d5a7d9fdd0
Parents: da14f36
Author: Thiago H. de Paula Figueiredo <th...@apache.org>
Authored: Mon Mar 24 17:39:38 2014 -0300
Committer: Thiago H. de Paula Figueiredo <th...@apache.org>
Committed: Mon Mar 24 17:39:38 2014 -0300

----------------------------------------------------------------------
 .../apache/tapestry5/beaneditor/Sortable.java   | 43 ++++++++++++++++++++
 1 file changed, 43 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/7bad88dd/tapestry5-annotations/src/main/java/org/apache/tapestry5/beaneditor/Sortable.java
----------------------------------------------------------------------
diff --git a/tapestry5-annotations/src/main/java/org/apache/tapestry5/beaneditor/Sortable.java b/tapestry5-annotations/src/main/java/org/apache/tapestry5/beaneditor/Sortable.java
new file mode 100644
index 0000000..823bbf8
--- /dev/null
+++ b/tapestry5-annotations/src/main/java/org/apache/tapestry5/beaneditor/Sortable.java
@@ -0,0 +1,43 @@
+// Copyright 2014 The Apache Software Foundation
+//
+// Licensed 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.
+
+package org.apache.tapestry5.beaneditor;
+
+import static org.apache.tapestry5.ioc.annotations.AnnotationUseContext.BEAN;
+import static org.apache.tapestry5.ioc.annotations.AnnotationUseContext.COMPONENT;
+import static org.apache.tapestry5.ioc.annotations.AnnotationUseContext.MIXIN;
+import static org.apache.tapestry5.ioc.annotations.AnnotationUseContext.PAGE;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import org.apache.tapestry5.ioc.annotations.UseWith;
+
+/**
+ * Used to explicitly define whether a property should be considerable sortable or not.
+ * If this annotation isn't used, then the property will be considered sortable only if
+ * its type implements {@link Comparable}.
+ * This annotation may be attached to a getter or setter method, or the matching field.
+ */
+@Target({ ElementType.FIELD, ElementType.METHOD })
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+@UseWith({BEAN,COMPONENT,MIXIN,PAGE})
+public @interface Sortable
+{
+    boolean value();
+}