Package org.xwiki.model.reference
Class RegexEntityReference
- java.lang.Object
-
- org.xwiki.model.reference.EntityReference
-
- org.xwiki.model.reference.PartialEntityReference
-
- org.xwiki.model.reference.RegexEntityReference
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<EntityReference>
public class RegexEntityReference extends PartialEntityReference
AnEntityReference
used to match another one.This
EntityReference
contains aPattern
which will tries to match providedEntityReference
name and type.The
RegexEntityReference
can be partial or contain holes, for example if only the space regex reference is provided it will tries to match only space part of the provided reference and consider other parts as matched.It's of course possible to mix regex and "normal"
EntityReference
member. In that case normal memberPartialEntityReference.equals(Object)
method behave as usual and then call following memberPartialEntityReference.equals(Object)
etc.- Since:
- 3.2M1
- Version:
- $Id: c0f926c92e1d47206167027c18026202ccfc3dd8 $
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.xwiki.model.reference.EntityReference
TOSTRING_SERIALIZER
-
-
Constructor Summary
Constructors Constructor Description RegexEntityReference(Pattern pattern, EntityType type)
RegexEntityReference(Pattern pattern, EntityType type, EntityReference parent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Pattern
getPattern()
protected boolean
isNameEqual(String name)
-
Methods inherited from class org.xwiki.model.reference.PartialEntityReference
equals, hashCode
-
Methods inherited from class org.xwiki.model.reference.EntityReference
appendParent, compareTo, equals, equals, equalsNonRecursive, extractFirstReference, extractReference, getName, getParameter, getParameters, getParent, getReversedReferenceChain, getRoot, getType, hasParent, removeParent, replaceParent, replaceParent, setName, setParameter, setParameters, setParent, setType, size, toString
-
-
-
-
Constructor Detail
-
RegexEntityReference
public RegexEntityReference(Pattern pattern, EntityType type)
- Parameters:
pattern
- the pattern used to match the nametype
- the type of the reference
-
RegexEntityReference
public RegexEntityReference(Pattern pattern, EntityType type, EntityReference parent)
- Parameters:
pattern
- the pattern used to match the nametype
- the type of the referenceparent
- the parent of the reference
-
-
Method Detail
-
getPattern
public Pattern getPattern()
- Returns:
- the pattern used to match the name
-
isNameEqual
protected boolean isNameEqual(String name)
- Overrides:
isNameEqual
in classPartialEntityReference
- Parameters:
name
- the name to compare to this name- Returns:
- true of the passed name is equal to this name
-
-