org.xwiki.model.reference
Class RegexEntityReference

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

public class RegexEntityReference
extends EntityReference

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 equals(Object) method behave as usual and then call following member equals(Object) etc.

Since:
3.2M1
Version:
$Id$
See Also:
Serialized Form

Constructor Summary
RegexEntityReference(Pattern pattern, EntityType type)
           
RegexEntityReference(Pattern pattern, EntityType type, EntityReference parent)
           
 
Method Summary
 boolean equals(Object obj)
          
 Pattern getPattern()
           
 
Methods inherited from class org.xwiki.model.reference.EntityReference
clone, compareTo, extractReference, getChild, getName, getParent, getRoot, getType, hashCode, setChild, setName, setParent, setType, toString
 
Methods inherited from class java.lang.Object
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

equals

public boolean equals(Object obj)

This equals method actually matches provided reference using patterns.

Overrides:
equals in class EntityReference
See Also:
EntityReference.equals(java.lang.Object)


Copyright © 2004-2011 XWiki. All Rights Reserved.