Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.5.0)

E13403-06


oracle.javatools.util
Class CommandModel

java.lang.Object
  extended by oracle.javatools.util.CommandModel


public class CommandModel
extends java.lang.Object

A model of a command line. The expected command line syntax is described by, and this model is created by, an instance of CommandParser.


Method Summary
 CommandParser getParser()
          Gets the parser which defines this model.
 java.lang.Object getValue(java.lang.String name)
          Gets the value of a parameter or option, or null if absent.
 int getValue(java.lang.String name, int defaultValue)
          Gets the int value of a parameter or option, or a default value if absent.
 java.lang.String getValue(java.lang.String name, java.lang.String defaultValue)
          Gets the String value of a parameter or option, or a default value if absent.
<T> T
getValue(java.lang.String name, T defaultValue)
          Gets the value of a parameter or option, or a default value if absent.
 boolean isAbsent(java.lang.String name)
          Gets whether a parameter or option is absent.
 boolean isPresent(java.lang.String name)
          Gets whether a parameter or option is present.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Method Detail

getParser

public CommandParser getParser()
Gets the parser which defines this model.

getValue

public java.lang.Object getValue(java.lang.String name)
Gets the value of a parameter or option, or null if absent.
Parameters:
name - The canonical name of the parameter or option.
Throws:
java.lang.IllegalArgumentException - if the name is not defined.

getValue

public <T> T getValue(java.lang.String name,
                      T defaultValue)
Gets the value of a parameter or option, or a default value if absent.
Parameters:
name - The canonical name of the value or option.
defaultValue - The default value.
Throws:
java.lang.IllegalArgumentException - if the name is not defined.

getValue

public int getValue(java.lang.String name,
                    int defaultValue)
Gets the int value of a parameter or option, or a default value if absent.
Parameters:
name - The canonical name of the value or option.
defaultValue - The default value.
Throws:
java.lang.IllegalArgumentException - if the name is not defined.

getValue

public java.lang.String getValue(java.lang.String name,
                                 java.lang.String defaultValue)
Gets the String value of a parameter or option, or a default value if absent.
Parameters:
name - The canonical name of the value or option.
defaultValue - The default value.
Throws:
java.lang.IllegalArgumentException - if the name is not defined.

isAbsent

public boolean isAbsent(java.lang.String name)
Gets whether a parameter or option is absent.
Parameters:
name - The canonical name of the value or option.
Throws:
java.lang.IllegalArgumentException - if the name is not defined.

isPresent

public boolean isPresent(java.lang.String name)
Gets whether a parameter or option is present.
Parameters:
name - The canonical name of the value or option.
Throws:
java.lang.IllegalArgumentException - if the name is not defined.

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1.5.0)

E13403-06


Copyright © 1997, 2011, Oracle. All rights reserved.