Class AbstractExtensionPattern

java.lang.Object
org.xwiki.extension.AbstractExtensionPattern
All Implemented Interfaces:
ExtensionPattern
Direct Known Subclasses:
DefaultExtensionPattern

public abstract class AbstractExtensionPattern extends Object implements ExtensionPattern
Base class for ExtensionPattern implementations.
Since:
12.2CR1
Version:
$Id: a9a4d84faf7113c37cfd0e7426aa3df13252c09b $
  • Field Details

  • Constructor Details

    • AbstractExtensionPattern

      public AbstractExtensionPattern(ExtensionPattern pattern)
      Create new instance by cloning the provided one.
      Parameters:
      pattern - a pattern to copy
    • AbstractExtensionPattern

      public AbstractExtensionPattern(Pattern idPattern)
      Create new instance by cloning the provided one with different version constraint.
      Parameters:
      idPattern - a regular expression matching all the ids to exclude
    • AbstractExtensionPattern

      public AbstractExtensionPattern(String id)
      Parameters:
      id - the exact id to exclude
  • Method Details

    • getIdPattern

      public Pattern getIdPattern()
      Specified by:
      getIdPattern in interface ExtensionPattern
      Returns:
      a regular expression matching all the ids to exclude or null to match everything
    • matches

      public boolean matches(String extensionId)
      Parameters:
      extensionId - the extension id to match
      Returns:
      true if the passed extension is matched by the pattern
    • matches

      public boolean matches(ExtensionId extensionId)
      Specified by:
      matches in interface ExtensionPattern
      Parameters:
      extensionId - the extension id to match
      Returns:
      true if the passed extension is matched by the pattern
    • matches

      public boolean matches(ExtensionDependency dependency)
      Specified by:
      matches in interface ExtensionPattern
      Parameters:
      dependency - the extension dependency to match
      Returns:
      true if the passed extension dependency is matched by the pattern
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object