@Role
@Unstable
public interface EntityNameValidation
Modifier and Type | Method and Description |
---|---|
boolean |
isValid(EntityReference entityReference)
Validate that the given
EntityReference respects the current policy. |
boolean |
isValid(String name)
Validate a name against a set of rules: usually a pattern is used to validate a name.
|
EntityReference |
transform(EntityReference entityReference)
Aims at transforming an entity reference such as
isValid(EntityReference) returns true. |
String |
transform(String name)
Transforms a name such as
isValid(String) return true . |
String transform(String name)
isValid(String)
return true
.name
- a name that should be transformed to be validated.name
if it was already valid.boolean isValid(String name)
name
- the name to validate.true
if it's correct according to the current policy.EntityReference transform(EntityReference entityReference)
isValid(EntityReference)
returns true.
Note that this method should return exactly entityReference
if isValid(EntityReference)
already
returns true for it.entityReference
- the entity reference on which to perform transformation.EntityReference
with the fewer possible transformation to make
it pass isValid(EntityReference)
.boolean isValid(EntityReference entityReference)
EntityReference
respects the current policy.entityReference
- the entity reference to checktrue
if the policy is respected.Copyright © 2004–2021 XWiki. All rights reserved.