Example usage for org.apache.commons.cli2.validation UrlValidator UrlValidator

List of usage examples for org.apache.commons.cli2.validation UrlValidator UrlValidator

Introduction

In this page you can find the example usage for org.apache.commons.cli2.validation UrlValidator UrlValidator.

Prototype

public UrlValidator() 

Source Link

Document

Creates a UrlValidator.

Usage

From source file:de.tu_chemnitz.mi.barcd.app.CommandLineArgumentsParser.java

private DefaultOption createXmlSchemaOption() {
    ArgumentBuilder ab = new ArgumentBuilder();
    DefaultOptionBuilder ob = new DefaultOptionBuilder();

    UrlValidator urlValidator = new UrlValidator();

    Argument xmlSchemaArgument = ab.withName("URL").withMinimum(1).withMaximum(1).withValidator(urlValidator)
            .create();//from w  w w.j a v a2  s  .c  o m

    DefaultOption xmlSchemaOption = ob.withLongName("xml-schema").withShortName("xs")
            .withDescription("Specify the location of the XML schema used for validation.")
            .withArgument(xmlSchemaArgument).withRequired(false).create();

    return xmlSchemaOption;
}