Class DefaultResourceIdentifierMatcher

java.lang.Object
com.atlassian.confluence.content.render.xhtml.model.resource.identifiers.DefaultResourceIdentifierMatcher
All Implemented Interfaces:
ResourceIdentifierMatcher

public class DefaultResourceIdentifierMatcher extends Object implements ResourceIdentifierMatcher
Match a ContentEntityObject against the supplied ResourceIdentifier. Note that the ResourceIdentifier may be partially populated, following the rules of the respective ResourceIdentifierResolver implementations.

This implementation only supports the CEO and RI's that are legitimate render context CEOs. Any other CEO to RI matches will return false. This implementation

  • Constructor Details

    • DefaultResourceIdentifierMatcher

      public DefaultResourceIdentifierMatcher()
  • Method Details

    • matches

      public boolean matches(ContentEntityObject ceo, ResourceIdentifier ri)
      Specified by:
      matches in interface ResourceIdentifierMatcher
      Parameters:
      ceo - the entity to compare
      ri - the resource identifier to compare
      Returns:
      true if the supplied ResourceIdentifier matches.
    • matches

      protected boolean matches(Page page, ResourceIdentifier ri)
    • matches

      protected boolean matches(BlogPost blog, ResourceIdentifier ri)
    • matches

      protected boolean matches(Draft draft, ResourceIdentifier ri)
    • matches

      protected boolean matches(Comment comment, ResourceIdentifier ri)
      Remembering that this implementation is intended for use in rendering then a Comment is said to match the ResourceIdentifier if the parent of the Comment matches the ResourceIdentifier. This is because -
      1. We do set a Comment as the render CEO but we don't support linking to them (yet) - no ResourceIdentifier.
      2. We don't add attachments to comments, we add them to the parent.
      Parameters:
      comment -
      ri -
      Returns:
      true if the parent of the comment matches the ResourceIdentifier