@Retention(value: RetentionPolicy.SOURCE) @Target(value: [ElementType.TYPE]) @GroovyASTTransformationClass(value: org.grails.plugins.web.rest.transform.LinkableTransform) @interface Linkable
A transform that makes it possible to attach Link instances to any class. Two methods are added, one called link(Map args) and another called links() to retrieve the links. Example:
- Linkable:
- class Book {
String title
}
def b = new Book()
b.link(rel:"publisher", href="http://foo.com/books")
println b.links()