Tabnine Logo
LinkDescriptor.getRel
Code IndexAdd Tabnine to your IDE (free)

How to use
getRel
method
in
org.springframework.restdocs.hypermedia.LinkDescriptor

Best Java code snippets using org.springframework.restdocs.hypermedia.LinkDescriptor.getRel (Showing top 4 results out of 315)

origin: spring-projects/spring-restdocs

/**
 * Creates a new {@code LinksSnippet} that will extract links using the given
 * {@code linkExtractor} and document them using the given {@code descriptors}. The
 * given {@code attributes} will be included in the model during template rendering.
 * If {@code ignoreUndocumentedLinks} is {@code true}, undocumented links will be
 * ignored and will not trigger a failure.
 * @param linkExtractor the link extractor
 * @param descriptors the link descriptors
 * @param attributes the additional attributes
 * @param ignoreUndocumentedLinks whether undocumented links should be ignored
 */
protected LinksSnippet(LinkExtractor linkExtractor, List<LinkDescriptor> descriptors,
    Map<String, Object> attributes, boolean ignoreUndocumentedLinks) {
  super("links", attributes);
  this.linkExtractor = linkExtractor;
  for (LinkDescriptor descriptor : descriptors) {
    Assert.notNull(descriptor.getRel(), "Link descriptors must have a rel");
    this.descriptorsByRel.put(descriptor.getRel(), descriptor);
  }
  this.ignoreUndocumentedLinks = ignoreUndocumentedLinks;
}
origin: spring-projects/spring-restdocs

/**
 * Returns a model for the given {@code descriptor}.
 * @param descriptor the descriptor
 * @return the model
 */
protected Map<String, Object> createModelForDescriptor(LinkDescriptor descriptor) {
  Map<String, Object> model = new HashMap<>();
  model.put("rel", descriptor.getRel());
  model.put("description", descriptor.getDescription());
  model.put("optional", descriptor.isOptional());
  model.putAll(descriptor.getAttributes());
  return model;
}
origin: spring-projects/spring-restdocs

private List<Map<String, Object>> createLinksModel(Map<String, List<Link>> links) {
  List<Map<String, Object>> model = new ArrayList<>();
  for (Entry<String, LinkDescriptor> entry : this.descriptorsByRel.entrySet()) {
    LinkDescriptor descriptor = entry.getValue();
    if (!descriptor.isIgnored()) {
      if (descriptor.getDescription() == null) {
        descriptor = createDescriptor(
            getDescriptionFromLinkTitle(links, descriptor.getRel()),
            descriptor);
      }
      model.add(createModelForDescriptor(descriptor));
    }
  }
  return model;
}
origin: spring-projects/spring-restdocs

private LinkDescriptor createDescriptor(String description, LinkDescriptor source) {
  LinkDescriptor newDescriptor = new LinkDescriptor(source.getRel())
      .description(description);
  if (source.isOptional()) {
    newDescriptor.optional();
  }
  if (source.isIgnored()) {
    newDescriptor.ignored();
  }
  return newDescriptor;
}
org.springframework.restdocs.hypermediaLinkDescriptorgetRel

Javadoc

Returns the rel of the link described by this descriptor.

Popular methods of LinkDescriptor

  • description
  • ignored
  • optional
    Marks the link as optional.
  • <init>
    Creates a new LinkDescriptor describing a link with the given rel.
  • attributes
  • getAttributes
  • getDescription
  • isIgnored
  • isOptional
    Returns true if the described link is optional, otherwise false.

Popular in Java

  • Updating database using SQL prepared statement
  • getContentResolver (Context)
  • getApplicationContext (Context)
  • getSystemService (Context)
  • InputStream (java.io)
    A readable source of bytes.Most clients will use input streams that read data from the file system (
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • Collectors (java.util.stream)
  • DataSource (javax.sql)
    An interface for the creation of Connection objects which represent a connection to a database. This
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now