All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.redhat.ceylon.common.tool.Argument Maven / Gradle / Ivy

There is a newer version: 1.3.3
Show newest version
package com.redhat.ceylon.common.tool;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Annotates a setter to be called with the value of a command line 
 * argument
 * @see Option
 * @see OptionArgument
 */
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface Argument {

    /** 
     * The name of this argument (used in doc)
     */
    String argumentName() default "value";
    
    /**
     * The number of times this argument can appear in a command line. 
     * 

Allowed syntax:

*
*
?
*
argument must appear 0 or 1 times
*
*
*
argument must appear 0 or more times
*
+
*
argument must appear 1 or more times
*
n
*
where n is a positive decimal integer: argument must appear exactly n times
*
[n,]
*
where n is a positive decimal integer: argument must appear n times or more
*
[n,m]
*
where n and m are a positive decimal integers: * argument must appear between n and m times, inclusive
*
* */ String multiplicity(); /** * The position of this argument relative to other {@code @Argument}s * in the argument list. It is an error for two occurances of @Argument * in a class to have the same order. */ int order() default 0; }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy