|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.dpml.cli.validation.URIValidator
public class URIValidator
The URIValidator validates the string argument
values are valid URIs. If the value is a URI, the string value in
the List of values is replaced with the
URI instance.
The following example shows how to limit the valid values
for the site argument to 'artifact' URIs.
...
ArgumentBuilder builder = new ArgumentBuilder();
Argument plugin =
builder
.withName("plugin");
.withValidator( new URIValidator( "artifact", "link" ) );
| Constructor Summary | |
|---|---|
URIValidator()
Creates a UriValidator. |
|
URIValidator(java.lang.String scheme)
Creates a UriValidator for the specified scheme. |
|
URIValidator(java.lang.String[] schemes)
Creates a UriValidator for the specified schemes. |
|
| Method Summary | |
|---|---|
void |
validate(java.util.List values)
Validate the list of values against the list of permitted values. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public URIValidator()
public URIValidator(java.lang.String scheme)
scheme - the uri schemepublic URIValidator(java.lang.String[] schemes)
schemes - an array of schemes| Method Detail |
|---|
public void validate(java.util.List values)
throws InvalidArgumentException
values
List with the URI instance.
validate in interface Validatorvalues - the list of values to validate
InvalidArgumentException - if a value is invalidValidator.validate(java.util.List)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||