org.hawk.module.script
Class AliasScript

java.lang.Object
  extended by org.hawk.module.script.AbstractScript
      extended by org.hawk.module.script.SingleLineScript
          extended by org.hawk.module.script.AliasScript
All Implemented Interfaces:
IScript

public class AliasScript
extends SingleLineScript

This defines alias for a target application module.

e.g.

alias SampleAppModule = sam
sam can be used anywhere in the hawk script instead of SampleAppModule.

Suppose SampleAppModule has a sub task named Finish
Following statements are valid.
SampleAppModule->Finish
sam->Finish


Field Summary
 
Fields inherited from class org.hawk.module.script.AbstractScript
outerMultiLineScript
 
Constructor Summary
AliasScript()
          Default CTOR
 
Method Summary
static AliasScript createScript(java.util.Map<java.lang.Integer,java.lang.String> lineAliasMatcherMap)
          This creates AliasScript from the Alias matcher map.
 Variable execute()
          This executes the alias script
 java.lang.String get(java.lang.String moduleAlias)
          This returns module name from it's alias
static AliasScript getInstance()
          This returns SingleTon instance
static java.util.regex.Pattern getPattern()
          Getter for Alias pattern
 boolean isVariable()
           
 boolean parseAliases(java.util.Map<java.lang.Integer,java.lang.String> scriptMap)
           
static void setInstance(AliasScript ins)
          There is only one AliasScript.
 boolean store(java.lang.String module, java.lang.String moduleAlias)
          This stores the module's alias.
 
Methods inherited from class org.hawk.module.script.SingleLineScript
addScripts, copy, findNearestOuterMLScript, getVariable, getVariableValue, setVariable, setVariableValue, toUI
 
Methods inherited from class org.hawk.module.script.AbstractScript
add, and, arrayBracket, assign, divide, equalTo, evaluateGlobalVariable, evaluateLocalBoolean, evaluateLocalVariable, getLineNumber, getOuterMultiLineScript, greaterThan, greaterThanEqualTo, isLastScript, lessThan, lessThanEqualTo, mangle, modulus, multiply, or, popLocalVars, pushLocalVars, refer, setLastScript, setLineNumber, setOuterMultiLineScript, subtract, toJava, toJavaMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AliasScript

public AliasScript()
Default CTOR

Method Detail

getInstance

public static AliasScript getInstance()
This returns SingleTon instance

Returns:
returns SingleTon instance

setInstance

public static void setInstance(AliasScript ins)
There is only one AliasScript. SingleTonSetter helps the generic script generation mechanism defined in SingleLineScript

Parameters:
ins -
See Also:
SingleLineScript

getPattern

public static java.util.regex.Pattern getPattern()
Getter for Alias pattern

Returns:
alias pattern

store

public boolean store(java.lang.String module,
                     java.lang.String moduleAlias)
              throws HawkException
This stores the module's alias.

Parameters:
module - module
moduleAlias - module's alias
Returns:
returns true on success false on failure
Throws:
HawkException

get

public java.lang.String get(java.lang.String moduleAlias)
This returns module name from it's alias

Parameters:
moduleAlias -
Returns:
returns module name from it's alias

createScript

public static AliasScript createScript(java.util.Map<java.lang.Integer,java.lang.String> lineAliasMatcherMap)
                                throws HawkException
This creates AliasScript from the Alias matcher map. The alias matcher map is earlier computed from getPattern()

Parameters:
lineAliasMatcherMap -
Returns:
returns alias script
Throws:
HawkException

execute

public Variable execute()
                 throws HawkException
This executes the alias script

Specified by:
execute in interface IScript
Overrides:
execute in class SingleLineScript
Returns:
returns boolean
Throws:
HawkException

isVariable

public boolean isVariable()
Specified by:
isVariable in interface IScript
Overrides:
isVariable in class SingleLineScript
Returns:

parseAliases

public boolean parseAliases(java.util.Map<java.lang.Integer,java.lang.String> scriptMap)
                     throws HawkException
Throws:
HawkException