org.hyphenType.datastructure
Interface Options<T extends Enum<?> & StatusCode>

Type Parameters:
T - The enumeration for status codes
All Known Subinterfaces:
RBGeneratorOptions

public interface Options<T extends Enum<?> & StatusCode>

Interface that should be extended by all options interfaces.

Author:
Aurelio Akira M. Matsui

Method Summary
 void exit(int code, Object... args)
          Terminates the JVM or other current environment
 boolean exit(Throwable throwable)
          Terminates the JVM or other current environment.
 void exit(T status, Object... arguments)
          Terminates the JVM or other current environment
 String formattedLocaleMessage(String key, Object... values)
          Equivalent to localeMessage(String), but wraps a procedure that allows for replacement of variables within the messages.
 String formattedLocaleMessageDefault(String key, String defaultValue, Object... values)
          Equivalent to localeMessage(String), but wraps a procedure that allows for replacement of variables within the messages.
 String localeMessage(String key)
          Gets a message from the resource bundle of the current locale.
 String localeMessage(String key, String defaultValue)
          Gets a message from the resource bundle of the current locale.
 void printDocumentation()
          Prints the documentation using the preferred documentation formatter to the standard System.out.
 void printDocumentation(Class<? extends Annotation> formatterClass)
          Prints the documentation using the given documentation formatter to the standard System.out.
 void printDocumentation(Class<? extends Annotation> formatterClass, PrintStream pw)
          Prints the documentation using the given documentation formatter.
 void printDocumentation(PrintStream pw)
          Prints the documentation using the preferred documentation formatter.
 String[] rawArguments()
          Retrieves the array of arguments as they were received from the user.
 List<LexToken> unparsedArguments()
          All the arguments that were ignored by the parsing process.
 

Method Detail

printDocumentation

void printDocumentation()
Prints the documentation using the preferred documentation formatter to the standard System.out. Note: if not explicitly set, the preferred formatter is the one defined as the default value of the ArgumentsObject.preferredDocumentationFormatter() property.


printDocumentation

void printDocumentation(PrintStream pw)
Prints the documentation using the preferred documentation formatter. Note: if not explicitly set, the preferred formatter is the one defined as the default value of the ArgumentsObject.preferredDocumentationFormatter() property.

Parameters:
pw -

printDocumentation

void printDocumentation(Class<? extends Annotation> formatterClass)
Prints the documentation using the given documentation formatter to the standard System.out. Uses the given documentation formatter. TODO What happens if we try to load the annotation from the resource bundles but the annotation is not complete?

Parameters:
formatterClass -

printDocumentation

void printDocumentation(Class<? extends Annotation> formatterClass,
                        PrintStream pw)
Prints the documentation using the given documentation formatter. Uses the given PrintStream instead of System.out. TODO What happens if we try to load the annotation from the resource bundles but the annotation is not complete?

Parameters:
formatterClass -
pw -

unparsedArguments

List<LexToken> unparsedArguments()
All the arguments that were ignored by the parsing process.

Returns:

exit

void exit(T status,
          Object... arguments)
Terminates the JVM or other current environment

Parameters:
status - The status code to terminate the JVM
arguments - The arguments that will be passed to StatusCode#beforeExit().

exit

void exit(int code,
          Object... args)
Terminates the JVM or other current environment

Parameters:
code - The status code to terminate the JVM
arguments - The arguments that will be passed to StatusCode#beforeExit().

exit

boolean exit(Throwable throwable)
Terminates the JVM or other current environment. This method searches for one exit status (enumeration constant) that receives the given throwable.

Parameters:
throwable - The throwable object that will be carried to the ExitStatusHelper.
Returns:
True if the throwable could be visited by any enumeration constant.

rawArguments

String[] rawArguments()
Retrieves the array of arguments as they were received from the user.

Returns:
The raw array of arguments.

localeMessage

String localeMessage(String key)
Gets a message from the resource bundle of the current locale. This method is merely a convenience to allow for users to easily access extra messages inside of the resource bundles of hyphenType.

Parameters:
key - The key to search for.
Returns:
The message related to the key.

localeMessage

String localeMessage(String key,
                     String defaultValue)
Gets a message from the resource bundle of the current locale. This method is merely a convenience to allow for users to easily access extra messages inside of the resource bundles of hyphenType.

Parameters:
key - The key to search for.
defaultValue - The default value, in case the key was not found.
Returns:
The message related to the key.

formattedLocaleMessage

String formattedLocaleMessage(String key,
                              Object... values)
Equivalent to localeMessage(String), but wraps a procedure that allows for replacement of variables within the messages. This procedure uses a MessageFormat to replace variables.

Parameters:
key - The key to search for.
values - The values to replace each variable.
Returns:
The message related to the key and formatted according to the values.
See Also:
MessageFormat

formattedLocaleMessageDefault

String formattedLocaleMessageDefault(String key,
                                     String defaultValue,
                                     Object... values)
Equivalent to localeMessage(String), but wraps a procedure that allows for replacement of variables within the messages. This procedure uses a MessageFormat to replace variables.

Parameters:
key - The key to search for.
defaultValue - The default value, in case the key was not found.
values - The values to replace each variable.
Returns:
The message related to the key and formatted according to the values.
See Also:
MessageFormat


Copyright © 2013. All Rights Reserved.