| 1 | package org.jboss.resteasy.spi.touri; |
| 2 | |
| 3 | import java.lang.annotation.ElementType; |
| 4 | import java.lang.annotation.Retention; |
| 5 | import java.lang.annotation.RetentionPolicy; |
| 6 | import java.lang.annotation.Target; |
| 7 | |
| 8 | /** |
| 9 | * <p> |
| 10 | * This annotation can be added to any object to perform Java beans-based |
| 11 | * transformation between URI template and bean properties. For example, take |
| 12 | * the following bean: |
| 13 | * </p> |
| 14 | * <p/> |
| 15 | * <pre> |
| 16 | * @URITemplate("/foo/{id}") |
| 17 | * public class Foo |
| 18 | * { |
| 19 | * private int id; |
| 20 | * // getters and setters |
| 21 | * } |
| 22 | * </pre> |
| 23 | * <p/> |
| 24 | * <p> |
| 25 | * for a Foo f with id = 123, ObjectToURI.getInstance(f) = "/foo/123" |
| 26 | * </p> |
| 27 | * |
| 28 | * @author <a href="mailto:[email protected]">Solomon Duskis</a> |
| 29 | * @version $Revision: 1 $ |
| 30 | */ |
| 31 | |
| 32 | @Target( |
| 33 | {ElementType.TYPE}) |
| 34 | @Retention(RetentionPolicy.RUNTIME) |
| 35 | public @interface URITemplate |
| 36 | { |
| 37 | String value(); |
| 38 | } |