@Test public void resourceLinkForDirectLink() throws Exception { ResourceLinkGenerator generator = new TestResourceLinkGenerator(); final ResourceLink resourceLink = generator.resourceLinkFor(TestController.class.getMethod("directLink")); assertEquals(resourceLink.asDirectLink().getHref().toString(), APPLICATION_BASE_URI + "/foo"); }
public ResourceLink resourceLinkFor(final Method method) { ResourceLink resourceLink = null; if (isCandidateForAnalysis(method)) { final String resourcePath = overriddenOrCalculatedResourcePathFor(method); final URI relationType = relationTypeFrom(method); final URI varTypeBaseUri = this.varTypeBaseUri != null ? this.varTypeBaseUri : relationType; if (relationType != null) { final Hints hints = hintsGenerator.hintsOf(relationType, method); if (resourcePath.matches(".*\\{.*\\}.*")) { resourceLink = templatedLink( relationType, resourcePath, hrefVarsGenerator.hrefVarsFor(varTypeBaseUri, this.varTypeBaseUri == null, method), hints ); } else { resourceLink = directLink( relationType, create(resourcePath), hints ); } } } return resourceLink; }
ResourceLinkGenerator { public ResourceLink resourceLinkFor(final Method method) { ResourceLink resourceLink = null; if (isCandidateForAnalysis(method)) { final String resourcePath = overriddenOrCalculatedResourcePathFor(method); final URI relationType = relationTypeFrom(method); final URI varTypeBaseUri = this.varTypeBaseUri != null ? this.varTypeBaseUri : relationType; if (relationType != null) { final Hints hints = hintsGenerator.hintsOf(relationType, method); if (resourcePath.matches(".*\\{.*\\}.*")) { resourceLink = templatedLink( relationType, resourcePath, hrefVarsGenerator.hrefVarsFor(varTypeBaseUri, this.varTypeBaseUri == null, method), hints ); } else { resourceLink = directLink( relationType, create(resourcePath), hints ); } } } return resourceLink; } }
ResourceLinkGenerator { public ResourceLink resourceLinkFor(final Method method) { ResourceLink resourceLink = null; if (isCandidateForAnalysis(method)) { final String resourcePath = overriddenOrCalculatedResourcePathFor(method); final URI relationType = relationTypeFrom(method); final URI varTypeBaseUri = this.varTypeBaseUri != null ? this.varTypeBaseUri : relationType; if (relationType != null) { final Hints hints = hintsGenerator.hintsOf(relationType, method); if (resourcePath.matches(".*\\{.*\\}.*")) { resourceLink = templatedLink( relationType, resourcePath, hrefVarsGenerator.hrefVarsFor(varTypeBaseUri, this.varTypeBaseUri == null, method), hints ); } else { resourceLink = directLink( relationType, create(resourcePath), hints ); } } } return resourceLink; } protected  ResourceLinkGenerator(final URI applicationBaseUri,
                                    final URI relationTypeBaseUri,
                                    final URI varTypeBaseUri,
                                    final HintsGenerator hintsGenerator,
                                    final HrefVarsGenerator hrefVarsGenerator); }
ResourceLinkGenerator { public ResourceLink resourceLinkFor(final Method method) { ResourceLink resourceLink = null; if (isCandidateForAnalysis(method)) { final String resourcePath = overriddenOrCalculatedResourcePathFor(method); final URI relationType = relationTypeFrom(method); final URI varTypeBaseUri = this.varTypeBaseUri != null ? this.varTypeBaseUri : relationType; if (relationType != null) { final Hints hints = hintsGenerator.hintsOf(relationType, method); if (resourcePath.matches(".*\\{.*\\}.*")) { resourceLink = templatedLink( relationType, resourcePath, hrefVarsGenerator.hrefVarsFor(varTypeBaseUri, this.varTypeBaseUri == null, method), hints ); } else { resourceLink = directLink( relationType, create(resourcePath), hints ); } } } return resourceLink; } protected  ResourceLinkGenerator(final URI applicationBaseUri,
                                    final URI relationTypeBaseUri,
                                    final URI varTypeBaseUri,
                                    final HintsGenerator hintsGenerator,
                                    final HrefVarsGenerator hrefVarsGenerator); ResourceLink resourceLinkFor(final Method method); }
ResourceLinkGenerator { public ResourceLink resourceLinkFor(final Method method) { ResourceLink resourceLink = null; if (isCandidateForAnalysis(method)) { final String resourcePath = overriddenOrCalculatedResourcePathFor(method); final URI relationType = relationTypeFrom(method); final URI varTypeBaseUri = this.varTypeBaseUri != null ? this.varTypeBaseUri : relationType; if (relationType != null) { final Hints hints = hintsGenerator.hintsOf(relationType, method); if (resourcePath.matches(".*\\{.*\\}.*")) { resourceLink = templatedLink( relationType, resourcePath, hrefVarsGenerator.hrefVarsFor(varTypeBaseUri, this.varTypeBaseUri == null, method), hints ); } else { resourceLink = directLink( relationType, create(resourcePath), hints ); } } } return resourceLink; } protected  ResourceLinkGenerator(final URI applicationBaseUri,
                                    final URI relationTypeBaseUri,
                                    final URI varTypeBaseUri,
                                    final HintsGenerator hintsGenerator,
                                    final HrefVarsGenerator hrefVarsGenerator); ResourceLink resourceLinkFor(final Method method);  }