code: private Link getAnchorLink(Element element) {
      SyntheticLinkResource resource = new SyntheticLinkResource(resourceResolver);
      ValueMap resourceProps = resource.getValueMap();
  
      // get link metadata from data element
      boolean foundMetadata = getAnchorMetadataFromData(resourceProps, element);
      if (!foundMetadata) {
        // support for legacy metadata stored in single "data" attribute
        foundMetadata = getAnchorLegacyMetadataFromSingleData(resourceProps, element);
        if (!foundMetadata) {
          // support for legacy metadata stored in rel attribute
          getAnchorLegacyMetadataFromRel(resourceProps, element);
        }
      }
  
      // build anchor via linkhandler
      return linkHandler.get(resource).build();
    }
docs: Extracts link metadata from the DOM elements attributes and resolves them to a {@link Link} object.
  @param element DOM element
  @return Link metadata