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

com.botronsoft.cmj.spitools.dsl.ArgumentDescriptor Maven / Gradle / Ivy

package com.botronsoft.cmj.spitools.dsl;

import com.botronsoft.cmj.spi.annotations.PublicApi;

/**
 * Base interface for all argument descriptors. Holds the common methods for describing argument syntax - how references to configuration
 * elements are stored in the arguments. Instances of this interface may be created by invoking the methods of
 * {@link ArgumentContainerDescriptor}.
 *
 * @param 
 *            the actual extending interface of this base interface.
 */
@PublicApi
public interface ArgumentDescriptor> {

	/**
	 * Describes the type of a referenced configuration element in this argument.
	 *
	 * @param argumentType
	 *            type of a referenced configuration element in this argument.
	 * @return itself.
	 */
	T ofType(ArgumentType argumentType);

	/**
	 * Describes if the configuration element is referenced by id in this argument. For {@link ArgumentType#USER} this method will behave in
	 * the same way as {@link #byKey()}.
	 *
	 * @return itself.
	 */
	T byId();

	/**
	 * Describes if the configuration element is referenced by name in this argument.
	 *
	 * @return itself.
	 */
	T byName();

	/**
	 * Describes if the is referenced by key in this argument. This is supported only for elements which have keys -
	 * {@link ArgumentType#PROJECT} and {@link ArgumentType#USER}. For all other configuration elements this method will behave in the same
	 * way as {@link #byId()}.
	 *
	 * @return itself.
	 */
	T byKey();

	/**
	 * Describes the literal values of this argument that should be moved as-is. If the argument holds any of the values passed to this
	 * method, it will be exported and imported without any modifications.
	 *
	 * @param literalValues
	 *            literal values of this argument.
	 * @return itself.
	 */
	T withLiteralValues(String... literalValues);

	/**
	 * Describes addition of a new argument descriptor for the parent {@link ArgumentContainerDescriptor}.
	 *
	 * @return the parent {@link ArgumentContainerDescriptor} instance.
	 */
	ArgumentContainerDescriptor and();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy