gr.uoa.di.madgik.workflow.adaptor.utils.jdl
Class JDLParsingUtils

java.lang.Object
  extended by gr.uoa.di.madgik.workflow.adaptor.utils.jdl.JDLParsingUtils

public class JDLParsingUtils
extends Object

The Class JDLParsingUtils is a utility class used during the parsing of a jdl description

Author:
gpapanikos

Constructor Summary
JDLParsingUtils()
           
 
Method Summary
static String GetDefinitionBlock(String val)
          Retrieves the the next definition block contained in the provided value including all its internally contained definition blocks
static Map<String,List<String>> GetDependencies(String dependencies)
          Retrieves the dependencies list from the serialization of the respective DAG jdl attribute.
static String GetKeyValue(Map<String,String> KeyValues, ParsedJDLInfo.KnownKeys Key, boolean mandatory)
          Retrieves the value of the requested key
static Map<String,String> GetKeyValues(String block)
          Retrieves the attributes and the respective values that are defined for them within the provided definition block
static boolean IsSandboxNameReference(String SandboxName)
           
static List<gr.uoa.di.madgik.execution.utils.EnvironmentKeyValue> ParseEnvironment(String val)
          Parses the environment jdl attribute serialization
static List<String> ParseSandbox(String val)
          Parses a sandbox
static String StripBrackets(String val)
          Strip brackets
static String StripComments(String val)
          Strip comments.
static String StripQuotes(String val)
          Strip quotes.
static String Trim(String val)
          Trims the provided value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDLParsingUtils

public JDLParsingUtils()
Method Detail

IsSandboxNameReference

public static boolean IsSandboxNameReference(String SandboxName)

Trim

public static String Trim(String val)
Trims the provided value

Parameters:
val - the value to trim
Returns:
the trimmed string

ParseSandbox

public static List<String> ParseSandbox(String val)
Parses a sandbox

Parameters:
val - the sandbox serialization
Returns:
a list of the elements of the sandbox initially separated by a comma character

ParseEnvironment

public static List<gr.uoa.di.madgik.execution.utils.EnvironmentKeyValue> ParseEnvironment(String val)
Parses the environment jdl attribute serialization

Parameters:
val - the serialization
Returns:
the list of key value pairs parsed

StripBrackets

public static String StripBrackets(String val)
Strip brackets

Parameters:
val - the string to strip the brackets from
Returns:
the stripped value

StripQuotes

public static String StripQuotes(String val)
Strip quotes.

Parameters:
val - the string to strip the quotes from
Returns:
the stripped value

StripComments

public static String StripComments(String val)
Strip comments.

Parameters:
val - the value to remove the commented characters from
Returns:
the value without the commented characters

GetDefinitionBlock

public static String GetDefinitionBlock(String val)
Retrieves the the next definition block contained in the provided value including all its internally contained definition blocks

Parameters:
val - the value to retrieve the definition block from
Returns:
the definition block

GetDependencies

public static Map<String,List<String>> GetDependencies(String dependencies)
Retrieves the dependencies list from the serialization of the respective DAG jdl attribute. Supported dependency definition includes only pairs and not nested lists

Parameters:
dependencies - the dependencies serialization
Returns:
A map containing the declared dependencies.

GetKeyValues

public static Map<String,String> GetKeyValues(String block)
Retrieves the attributes and the respective values that are defined for them within the provided definition block

Parameters:
block - the definition block to parse
Returns:
the map containing the keys and the respective values

GetKeyValue

public static String GetKeyValue(Map<String,String> KeyValues,
                                 ParsedJDLInfo.KnownKeys Key,
                                 boolean mandatory)
                          throws WorkflowValidationException
Retrieves the value of the requested key

Parameters:
KeyValues - the map containing the keys and values as returned by GetKeyValues(String)
Key - the key
mandatory - Whether the key is mandatory
Returns:
the respective value
Throws:
WorkflowValidationException - In case the key is mandatory but it is not found


Copyright © 2012. All Rights Reserved.