src/main/java/com/amazonaws/hal/client/HalResourceInvocationHandler.java
private String getRelationHref(Link link, Object[] args, Annotation[][] parameterAnnotations) {
        HalLink halLink = halResource.getLink(link.relation());

        if (halLink == null) {
            throw new UnsupportedOperationException(link.relation());
        }

        if (halLink.getDeprecation() != null) {
            log.warn("Link '" + link + "' has been deprecated: " + halLink.getDeprecation());
        }

        String href;

        if (halLink.isTemplated()) {
            try {
                UriTemplate uriTemplate = UriTemplate.fromTemplate(halLink.getHref());

                for (int i = 0; i < args.length; i++) {
                    for (Annotation annotation : parameterAnnotations[i]) {
                        if (annotation.annotationType() == UriVariable.class) {
                            UriVariable uriVariable = (UriVariable) annotation;

                            assignTemplateValue(uriTemplate, uriVariable.name(), args[i]);
                        }
                    }
                }

                for (int i = 0; i < link.uriValues().length; i++) {
                    UriValue uriValue = link.uriValues()[i];

                    assignTemplateValue(uriTemplate, uriValue.name(), uriValue.value());
                }

                href = uriTemplate.expand();
            } catch (MalformedUriTemplateException | VariableExpansionException e) {
                throw new RuntimeException(e);
            }
        } else {
            href = halLink.getHref();
        }

        return href;
    }
private String getRelationHref(Link link, Object[] args, Annotation[][] parameterAnnotations) {
        HalLink halLink = halResource.getLink(link.relation());

        if (halLink == null) {
            throw new UnsupportedOperationException(link.relation());
        }

        if (halLink.getDeprecation() != null) {
            log.warn("Link '" + link + "' has been deprecated: " + halLink.getDeprecation());
        }

        String href;

        if (halLink.isTemplated()) {
            try {
                UriTemplate uriTemplate = UriTemplate.fromTemplate(halLink.getHref());

                for (int i = 0; i < args.length; i++) {
                    for (Annotation annotation : parameterAnnotations[i]) {
                        if (annotation.annotationType() == UriVariable.class) {
                            UriVariable uriVariable = (UriVariable) annotation;

                            assignTemplateValue(uriTemplate, uriVariable.name(), args[i]);
                        }
                    }
                }

                for (int i = 0; i < link.uriValues().length; i++) {
                    UriValue uriValue = link.uriValues()[i];

                    assignTemplateValue(uriTemplate, uriValue.name(), uriValue.value());
                }

                href = uriTemplate.expand();
            } catch (MalformedUriTemplateException | VariableExpansionException e) {
                throw new RuntimeException(e);
            }
        } else {
            href = halLink.getHref();
        }

        return href;
    }
private String getRelationHref ( Link link , Object [ ] args , Annotation [ ] [ ] parameterAnnotations ) { HalLink halLink = halResource . getLink ( link . relation ( ) ) ; if ( halLink == null ) { throw new UnsupportedOperationException ( link . relation ( ) ) ; } if ( halLink . getDeprecation ( ) != null ) { log . warn ( "Link '" + link + "' has been deprecated: " + halLink . getDeprecation ( ) ) ; } String href ; if ( halLink . isTemplated ( ) ) { try { UriTemplate uriTemplate = UriTemplate . fromTemplate ( halLink . getHref ( ) ) ; for ( int i = 0 ; i < args . length ; i ++ ) { for ( Annotation annotation : parameterAnnotations [ i ] ) { if ( annotation . annotationType ( ) == UriVariable . class ) { UriVariable uriVariable = ( UriVariable ) annotation ; assignTemplateValue ( uriTemplate , uriVariable . name ( ) , args [ i ] ) ; } } } for ( int i = 0 ; i < link . uriValues ( ) . length ; i ++ ) { UriValue uriValue = link . uriValues ( ) [ i ] ; assignTemplateValue ( uriTemplate , uriValue . name ( ) , uriValue . value ( ) ) ; } href = uriTemplate . expand ( ) ; } catch ( MalformedUriTemplateException | VariableExpansionException e ) { throw new RuntimeException ( e ) ; } } else { href = halLink . getHref ( ) ; } return href ; }
-------------------------------------------------------------
-------------------------------------------------------------