org.opends.server.util.cli
Interface ValidationCallback<T>

Type Parameters:
T - The type of the decoded input.

public interface ValidationCallback<T>

An interface for validating user input.


Method Summary
 T validate(ConsoleApplication app, java.lang.String input)
          Validates and decodes the user-provided input.
 

Method Detail

validate

T validate(ConsoleApplication app,
           java.lang.String input)
           throws CLIException
Validates and decodes the user-provided input. Implementations must validate input and return the decoded value if the input is acceptable. If the input is unacceptable, implementations must return null and output a user friendly error message to the provided application console.

Parameters:
app - The console application.
input - The user input to be validated.
Returns:
Returns the decoded input if the input is valid, or null if it is not.
Throws:
CLIException - If an unexpected error occurred which prevented validation.