gov.nasa.pds.ltdt.testLabel
Class Variable

java.lang.Object
  extended by gov.nasa.pds.ltdt.testLabel.Variable

public class Variable
extends java.lang.Object

Class to handle variables found in label templates. Variables are recognized by a ${xxx} notation, where xxx represents the variable name.

Author:
mcayanan

Constructor Summary
Variable()
          Constructor
 
Method Summary
 java.lang.String doPointerSubstitution(java.lang.String pointerStatement)
          Performs substitution for variables in a pointer statement.
 java.lang.String doSubstitution(java.lang.String statement, gov.nasa.pds.tools.dict.ElementDefinition definition)
          Replaces variables with an appropriate test value based on the given element definition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Variable

public Variable()
Constructor

Method Detail

doSubstitution

public java.lang.String doSubstitution(java.lang.String statement,
                                       gov.nasa.pds.tools.dict.ElementDefinition definition)
                                throws gov.nasa.pds.tools.dict.type.InvalidTypeException,
                                       gov.nasa.pds.tools.dict.type.UnsupportedTypeException,
                                       gov.nasa.pds.tools.dict.parser.UnknownDefinitionException
Replaces variables with an appropriate test value based on the given element definition.

Parameters:
statement - A statement containing variables.
definition - The element definition.
Returns:
A string where the variables are replaced by valid test values.
Throws:
gov.nasa.pds.tools.dict.type.InvalidTypeException
gov.nasa.pds.tools.dict.type.UnsupportedTypeException
gov.nasa.pds.tools.dict.parser.UnknownDefinitionException

doPointerSubstitution

public java.lang.String doPointerSubstitution(java.lang.String pointerStatement)
Performs substitution for variables in a pointer statement. A variable surrounded in quotes will be replaced by a fictituous file name. Un-quoted variables will be replaced by an integer value of '1'.

Returns:
The pointer statement with all variables substituted with an appropriate test value.


Copyright © 2005-2008 NASA Jet Propulsion Laboratory, California Institute of Technology. All Rights Reserved.