Repository: tapestry-5 Updated Branches: refs/heads/5.3 a0ac605db -> 7485d9167
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/985675b2 Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/985675b2 Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/985675b2 Branch: refs/heads/5.3 Commit: 985675b2086b860a6467b27e76dcd247b288c66b Parents: a0ac605 Author: Thiago H. de Paula Figueiredo <[email protected]> Authored: Mon Mar 24 17:39:38 2014 -0300 Committer: Thiago H. de Paula Figueiredo <[email protected]> Committed: Sat May 24 15:51:52 2014 -0300 ---------------------------------------------------------------------- .../apache/tapestry5/beaneditor/Sortable.java | 43 ++++++++++++++++++++ 1 file changed, 43 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/985675b2/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(); +}
