private Link annotationToLink ( Siren4JLink linkAnno , EntityContext context ) { LinkBuilder builder = LinkBuilder . newInstance ( ) . setRelationship ( linkAnno . rel ( ) ) . setHref ( linkAnno . href ( ) ) ; if ( StringUtils . isNotBlank ( linkAnno . title ( ) ) ) { builder . setTitle ( linkAnno . title ( ) ) ; } if ( ArrayUtils . isNotEmpty ( linkAnno . linkClass ( ) ) ) { builder . setComponentClass ( linkAnno . linkClass ( ) ) ; } return builder . build ( ) ; }
Convert a link annotation to an actual link . The href will not be resolved in the instantiated link this will need to be post processed .