Package org.xwiki.extension
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 forExtensionPattern
implementations.- Since:
- 12.2CR1
- Version:
- $Id: a9a4d84faf7113c37cfd0e7426aa3df13252c09b $
-
-
Constructor Summary
Constructors Constructor Description AbstractExtensionPattern(String id)
AbstractExtensionPattern(Pattern idPattern)
Create new instance by cloning the provided one with different version constraint.AbstractExtensionPattern(ExtensionPattern pattern)
Create new instance by cloning the provided one.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
Pattern
getIdPattern()
int
hashCode()
boolean
matches(String extensionId)
boolean
matches(ExtensionDependency dependency)
boolean
matches(ExtensionId extensionId)
String
toString()
-
-
-
Field Detail
-
idPattern
protected final Pattern idPattern
- See Also:
getIdPattern()
-
-
Constructor Detail
-
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 Detail
-
getIdPattern
public Pattern getIdPattern()
- Specified by:
getIdPattern
in interfaceExtensionPattern
- 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 interfaceExtensionPattern
- 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 interfaceExtensionPattern
- Parameters:
dependency
- the extension dependency to match- Returns:
- true if the passed extension dependency is matched by the pattern
-
-