EASP API 7.8.0

net.juniper.smgt.lib.subst
Interface Substitution


public interface Substitution

This interface represents a substitution specified as a replacement of a variable for a value. A Substitution can be used to simply define a variable (by omitting the value), fix a value for a variable (by setting fixed to true), or defining a default value for a variable (by defining a value and setting fixed to false).


Method Summary
 java.lang.String getDescription()
          Returns the description of the substitution.
 java.util.Set getRoles()
          gets the roles of the Substitution
 java.lang.String getVal()
          Returns the value for the Substitution or null if there is no value.
 java.lang.String[] getValVars()
          Returns an array of the variable names occuring in the value of the Substitution.
 java.lang.String getVar()
          Returns the variable for the substitution.
 boolean isFixed()
          Returns true if the substitution fixes its variable.
 boolean isGrounding()
          Returns true if the substitution has no variables in its value.
 java.lang.String toString()
          Returns a string representation of this substution which is suitable for input to SubstEngine.createSubstitution(String).
 void validate()
          Checks the syntax of the substitution
 

Method Detail

getDescription

java.lang.String getDescription()
Returns the description of the substitution.

Returns:
java.lang.String the string representing the description

getRoles

java.util.Set getRoles()
                       throws RuntimeSubstException
gets the roles of the Substitution

Returns:
a Set of Strings, which are the role names defined for the variable of the Substitution
Throws:
RuntimeSubstException - thrown if there is an error in the syntax of the substitution

getVal

java.lang.String getVal()
                        throws RuntimeSubstException
Returns the value for the Substitution or null if there is no value.

Returns:
java.lang.String the string representation of the value of the substitution or null if the substitution has no value
Throws:
RuntimeSubstException - thrown if there is an error in the syntax of the substitution.

getVar

java.lang.String getVar()
                        throws RuntimeSubstException
Returns the variable for the substitution.

Returns:
java.lang.String the string representing the variable in a form that would be parsable by SubstEngine.createSubstitution(String). If you are using spaces or special characters in your variable names, use SubstEngineFactory.decodeIdentifier(String) to remove escpaed special characters to put the variable name in a form that is suitable for presentation to users.
Throws:
RuntimeSubstException - thrown if there is an error in the syntax of the substitution.

isFixed

boolean isFixed()
Returns true if the substitution fixes its variable.

Returns:
boolean true if the substituion fixes the variable to a value

isGrounding

boolean isGrounding()
                    throws RuntimeSubstException
Returns true if the substitution has no variables in its value.

Returns:
boolean true if the substitutiion has no variables in its value.
Throws:
RuntimeSubstException - thrown if there is an error in the syntax of the substitution.

toString

java.lang.String toString()
Returns a string representation of this substution which is suitable for input to SubstEngine.createSubstitution(String).

Overrides:
toString in class java.lang.Object
Returns:
java.lang.String the string representation of the substitution.

getValVars

java.lang.String[] getValVars()
                              throws RuntimeSubstException
Returns an array of the variable names occuring in the value of the Substitution. See getVar() for further information if you are using variable names containing spaces and other special characters.

Returns:
java.lang.String[] an array of variable names in the value of the substitution.
Throws:
RuntimeSubstException - thrown if there is an error in the syntax of the substitution.

validate

void validate()
              throws SubstitutionFormatException
Checks the syntax of the substitution

Throws:
SubstitutionFormatException - thrown if the Substitution is invalid for reasons including lexical or syntax errors in the string used to construct it, or if literal numbers in the string cannot be represented by primitive Java data types.

EASP API 7.8.0