org.xwiki.model.reference
Class RegexEntityReference

java.lang.Object
  extended by org.xwiki.model.reference.EntityReference
      extended by org.xwiki.model.reference.PartialEntityReference
          extended by org.xwiki.model.reference.RegexEntityReference
All Implemented Interfaces:
Serializable, Cloneable, Comparable<EntityReference>

public class RegexEntityReference
extends PartialEntityReference

An EntityReference used to match another one.

This EntityReference contains a Pattern which will tries to match provided EntityReference 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 member PartialEntityReference.equals(Object) method behave as usual and then call following member PartialEntityReference.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
RegexEntityReference(Pattern pattern, EntityType type)
           
RegexEntityReference(Pattern pattern, EntityType type, EntityReference parent)
           
 
Method Summary
 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, extractReference, getName, getParameter, getParent, getReversedReferenceChain, getRoot, getType, removeParent, replaceParent, setName, setParameter, setParameters, setParent, setType, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RegexEntityReference

public RegexEntityReference(Pattern pattern,
                            EntityType type)
Parameters:
pattern - the pattern used to match the name
type - the type of the reference

RegexEntityReference

public RegexEntityReference(Pattern pattern,
                            EntityType type,
                            EntityReference parent)
Parameters:
pattern - the pattern used to match the name
type - the type of the reference
parent - 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 class PartialEntityReference
Parameters:
name - the name to compare to this name
Returns:
true of the passed name is equal to this name


Copyright © 2004–2014 XWiki. All rights reserved.