# Class Program

java.lang.Object
org.a11y.brlapi.Component
org.a11y.brlapi.ProgramComponent
org.a11y.brlapi.Program

All Implemented Interfaces:
  `Runnable`

Direct Known Subclasses:
  `ApiToolCommand, Client, VersionProgram`

public abstract class Program extends ProgramComponent implements Runnable

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`protected static class`
`Program.Option`

## Field Summary

Fields
Modifier and Type
Field
Description
`static final char`
`USAGE_OPTIONAL_BEGIN`
`static final char`
`USAGE_OPTIONAL_END`
`static final String`
`USAGE_REPEATING_INDICATOR`

### Fields inherited from class ProgramComponent

`EXIT_CODE_EXTERNAL, EXIT_CODE_INTERNAL, EXIT_CODE_SEMANTIC, EXIT_CODE_SUCCESS, EXIT_CODE_SYNTAX`

### Fields inherited from class Component

`BYTE_MASK, UNICODE_BRAILLE_ROW`

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`Program(String... arguments)`

## Method Summary

Modifier and Type
Method
Description
`protected final void`
`addOption(String name, Program.Option.Handler handler, String... operands)`
`protected final void`
`addOptionalParameters(String... parameters)`
`protected final void`
`addRepeatingParameter(String parameter)`
`protected final void`
`addRequiredParameters(String... parameters)`
`protected void`
`extendUsageSummary(StringBuilder usage)`
`final String`
`getProgramName()`
`String`
`getPurpose()`
`final String`
`getUsageSummary()`
`final boolean`
`isClient()`
`protected void`
`onProgramException(ProgramException exception)`
`protected void`
`processParameters(String[] parameters)`
`final void`
`run()`
`protected abstract void`
`runProgram()`
`final Program`
`setProgramName(String name)`
`protected final void`
`writeProgramMessage(String format, Object... arguments)`

### Methods inherited from class ProgramComponent

`isClient, isClient`

### Methods inherited from class Component

`getObjectName, getObjectName, printf, toOperandName, toUnicodeBraille, toUnicodeBraille`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### USAGE_OPTIONAL_BEGIN

public static final char USAGE_OPTIONAL_BEGIN

See Also:
  - Constant Field Values

### USAGE_OPTIONAL_END

public static final char USAGE_OPTIONAL_END

See Also:
  - Constant Field Values

### USAGE_REPEATING_INDICATOR

public static final String USAGE_REPEATING_INDICATOR

See Also:
  - Constant Field Values

## Constructor Details

### Program

protected Program(String... arguments)

## Method Details

### runProgram

protected abstract void runProgram() throws ProgramException

Throws:
  `ProgramException`

### isClient

public final boolean isClient()

### getProgramName

public final String getProgramName()

### setProgramName

public final Program setProgramName(String name)

### writeProgramMessage

protected final void writeProgramMessage(String format, Object... arguments)

### addOption

protected final void addOption(String name, Program.Option.Handler handler, String... operands)

### addRequiredParameters

protected final void addRequiredParameters(String... parameters)

### addOptionalParameters

protected final void addOptionalParameters(String... parameters)

### addRepeatingParameter

protected final void addRepeatingParameter(String parameter)

### getPurpose

public String getPurpose()

### extendUsageSummary

protected void extendUsageSummary(StringBuilder usage)

### getUsageSummary

public final String getUsageSummary()

### processParameters

protected void processParameters(String[] parameters) throws SyntaxException

Throws:
  `SyntaxException`

### onProgramException

protected void onProgramException(ProgramException exception)

### run

public final void run()

Specified by:
  `run` in interface `Runnable`