org.openmdx.compatibility.base.application.spi
Class CommandOptions_1

java.lang.Object
  extended by org.openmdx.compatibility.base.application.spi.CommandOptions_1
All Implemented Interfaces:
CommandOptions_1_0, Manageable_1_0

Deprecated.

public class CommandOptions_1
extends Object
implements CommandOptions_1_0, Manageable_1_0

Command option parser


Nested Class Summary
static interface CommandOptions_1.Declarator
          Deprecated. The command option declarator interface
static class CommandOptions_1.Option
          Deprecated.  
static class CommandOptions_1.Parameter
          Deprecated.  
static class CommandOptions_1.SystemProperty
          Deprecated.  
 
Field Summary
protected  String[] commandArguments
          Deprecated. The command arguments are retrieved upon activation.
protected  LongOpt[] longOptions
          Deprecated. The long options are constructed upon activation
protected  List optionDeclaration
          Deprecated. A declarator array defining the supported options.
static String PARAMETER_ID
          Deprecated. The parameters are stored as options without long equivalent.
protected  CommandOptions_1.Parameter[] parameterDeclaration
          Deprecated. A declarator array defining the supported parameters.
protected  String shortOptions
          Deprecated. The short options are constructed upon activation.
protected  List systemPropertyDeclaration
          Deprecated. A declarator array defining the required system properties.
protected  CharSequence usageDetails
          Deprecated. The usage notes to be displayed in case of erroneous arguments or help requests are constructed upon activation.
protected  String usageLabel
          Deprecated. The usage notes tag, e.g.
protected  CharSequence usageSummary
          Deprecated. The usage notes to be displayed in case of erroneous arguments or help requests are constructed upon activation.
 
Constructor Summary
CommandOptions_1(Class main, CommandOptions_1.Declarator declarator)
          Deprecated. Client constructor
CommandOptions_1(String usageLabel, String usageStart, CommandOptions_1.Declarator declarator)
          Deprecated. Basic constructor
 
Method Summary
 void activate()
          Deprecated. The activate method initializes a layer or component.
 void deactivate()
          Deprecated. The deactivate method releases a layer or component.
 Configuration getOptions()
          Deprecated. Get the command options.
 String[] getParameters()
          Deprecated. Get the parameters.
 boolean isExecutable()
          Deprecated. Define whether the applications task should be executed or not.
 Getopt newGetopt(String progname)
          Deprecated. Option parser
protected  void processCommandArguments()
          Deprecated. An exception is raised if the actual arguments do not match the declarations.
protected  void processSystemProperties()
          Deprecated. An exception is raised if the actual system do not match the declarations.
static List standardOptions()
          Deprecated. The standard options The option declaration passed to the CommandOption_1 constructor should be extended if additional options are acceptable.
static List standardSystemProperties()
          Deprecated. The standard system properties may be extended by an application framework subclass.
 String toString()
          Deprecated. Get a string representation for log purposes
 String toStringFormatted()
          Deprecated. Get a string representation for log purposes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PARAMETER_ID

public static final String PARAMETER_ID
Deprecated. 
The parameters are stored as options without long equivalent.

See Also:
Constant Field Values

systemPropertyDeclaration

protected final List systemPropertyDeclaration
Deprecated. 
A declarator array defining the required system properties.


parameterDeclaration

protected final CommandOptions_1.Parameter[] parameterDeclaration
Deprecated. 
A declarator array defining the supported parameters.


optionDeclaration

protected final List optionDeclaration
Deprecated. 
A declarator array defining the supported options.


usageLabel

protected final String usageLabel
Deprecated. 
The usage notes tag, e.g. «Usage», «CLOPT», ...


usageSummary

protected final CharSequence usageSummary
Deprecated. 
The usage notes to be displayed in case of erroneous arguments or help requests are constructed upon activation.


usageDetails

protected final CharSequence usageDetails
Deprecated. 
The usage notes to be displayed in case of erroneous arguments or help requests are constructed upon activation.


commandArguments

protected String[] commandArguments
Deprecated. 
The command arguments are retrieved upon activation.

See Also:
activate()

shortOptions

protected String shortOptions
Deprecated. 
The short options are constructed upon activation.


longOptions

protected LongOpt[] longOptions
Deprecated. 
The long options are constructed upon activation

Constructor Detail

CommandOptions_1

public CommandOptions_1(String usageLabel,
                        String usageStart,
                        CommandOptions_1.Declarator declarator)
Deprecated. 
Basic constructor

Parameters:
usageLabel - Usage tag
usageStart - Initial usage summary
declarator - To declare the command options

CommandOptions_1

public CommandOptions_1(Class main,
                        CommandOptions_1.Declarator declarator)
Deprecated. 
Client constructor

Parameters:
main - the main class
declarator - To declare the command options
Method Detail

standardSystemProperties

public static List standardSystemProperties()
Deprecated. 
The standard system properties may be extended by an application framework subclass.
   public List standardSystemProperties () {
           final List properties = super.standardSystemProperties();
     // If a BasicException.Parameter's value is fixed
     properties.add (
       new CommandOptions_1.SystemProperty (
                        "propertyName", 
                        "value"
                 )
     );
     ...
     // If the BasicException.Parameter is mandatory but its value free
     properties.add (
       new CommandOptions_1.SystemProperty (
                        "anotherPropertyName", 
                        "another BasicException.Parameter's default value",
                        "The system BasicException.Parameter «anotherPropertyName» is required" 
                 )
     );
     ...
     return properties;
   }
 

Note: This method may be called before the object's activation is completed.

Returns:
An system BasicException.Parameter declaration list

standardOptions

public static List standardOptions()
Deprecated. 
The standard options The option declaration passed to the CommandOption_1 constructor should be extended if additional options are acceptable.
   public List optionDeclaration () {
           final List options = CommandOptions_1.standardOptions();
     options.add(new CommandOptions_1.Option(«1st option»));
     options.add(new CommandOptions_1.Option(«2nd option»));
     ...
     return options;
   }
 

Returns:
An option declaration list

newGetopt

public Getopt newGetopt(String progname)
Deprecated. 
Option parser

Parameters:
progname - The name to display as the program name when printing errors. Error message display will be suppressed if progname is null.
Returns:
New Getopt object

getOptions

public Configuration getOptions()
Deprecated. 
Get the command options.

Specified by:
getOptions in interface CommandOptions_1_0
Returns:
A BasicException.Parameter set containing the command options.

getParameters

public String[] getParameters()
Deprecated. 
Get the parameters.

Specified by:
getParameters in interface CommandOptions_1_0
Returns:
A non-null array containing the parameters.

isExecutable

public boolean isExecutable()
Deprecated. 
Define whether the applications task should be executed or not.

Specified by:
isExecutable in interface CommandOptions_1_0
Returns:
False if for example a help request has been processed, true otherwise.

toString

public String toString()
Deprecated. 
Get a string representation for log purposes

Overrides:
toString in class Object
Returns:
a string representation of the options and parameters

toStringFormatted

public String toStringFormatted()
Deprecated. 
Get a string representation for log purposes

Returns:
a string representation of the non-sensitive options and parameters

activate

public void activate()
              throws Exception,
                     ServiceException
Deprecated. 
The activate method initializes a layer or component.

An exception is raised if the actual arguments do not match the declarations.

Specified by:
activate in interface Manageable_1_0
Throws:
Exception - the application framwork maps all java Exceptions internally to standard ServiceExceptions.
ServiceException

deactivate

public void deactivate()
                throws Exception,
                       ServiceException
Deprecated. 
The deactivate method releases a layer or component.

Specified by:
deactivate in interface Manageable_1_0
Throws:
Exception - the application framwork maps all java Exceptions internally to standard ServiceExceptions.
ServiceException

processSystemProperties

protected void processSystemProperties()
                                throws ServiceException
Deprecated. 
An exception is raised if the actual system do not match the declarations.

Throws:
ServiceException

processCommandArguments

protected void processCommandArguments()
                                throws ServiceException
Deprecated. 
An exception is raised if the actual arguments do not match the declarations.

Throws:
ServiceException


This software is published under the BSD license. Copyright © 2003-2007, OMEX AG, Switzerland, All rights reserved. Use is subject to license terms.