Package org.xwiki.model.validation
Class AbstractEntityNameValidation
- java.lang.Object
-
- org.xwiki.model.validation.AbstractEntityNameValidation
-
- All Implemented Interfaces:
EntityNameValidation
public abstract class AbstractEntityNameValidation extends Object implements EntityNameValidation
Define generic methods for transforming or validating entities based on the implementation of theEntityNameValidation.transform(String)
andEntityNameValidation.isValid(String)
.- Since:
- 12.0RC1
- Version:
- $Id: f6c14d55272e8d2934f63d2beef47e8bb5e1d552 $
-
-
Constructor Summary
Constructors Constructor Description AbstractEntityNameValidation()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isValid(EntityReference entityReference)
Validate that the givenEntityReference
respects the current policy.EntityReference
transform(EntityReference entityReference)
Aims at transforming an entity reference such asEntityNameValidation.isValid(EntityReference)
returns true.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.xwiki.model.validation.EntityNameValidation
isValid, transform
-
-
-
-
Method Detail
-
transform
public EntityReference transform(EntityReference entityReference)
Description copied from interface:EntityNameValidation
Aims at transforming an entity reference such asEntityNameValidation.isValid(EntityReference)
returns true. Note that this method should return exactlyentityReference
ifEntityNameValidation.isValid(EntityReference)
already returns true for it.- Specified by:
transform
in interfaceEntityNameValidation
- Parameters:
entityReference
- the entity reference on which to perform transformation.- Returns:
- a new
EntityReference
with the fewer possible transformation to make it passEntityNameValidation.isValid(EntityReference)
.
-
isValid
public boolean isValid(EntityReference entityReference)
Description copied from interface:EntityNameValidation
Validate that the givenEntityReference
respects the current policy.- Specified by:
isValid
in interfaceEntityNameValidation
- Parameters:
entityReference
- the entity reference to check- Returns:
true
if the policy is respected.
-
-