Class SystemDataTools
java.lang.Object
de.aristaflow.adept2.model.common.systemdata.SystemDataTools
This utility class provides methods to deal with
parameter references in the strings returned by
SystemDataConsumer
annotated methods.- Author:
- Patrick Schmidt
-
Method Summary
Modifier and TypeMethodDescriptionstatic ParameterRef[]findParameterReferences(String parameterisedString) Finds all parameter references (seeSystemDataConsumer) in the given string and returns them.static ParameterRefParserReturns a parser for the specified parameterised string.static ParameterRefReplacergetReplacer(String parameterisedString) Returns a replacer for the specified parameterised string to replace parameter references with actual values.static booleanisCompatibleParameter(ParameterRef paramRef, Parameter parameter) Returns true, if the parameter reference and the given parameter are compatible.static ParameterRefparseParameterReference(String parameterReference) Parses the specified string representation of a parameter reference (including the enclosing '%'s) and returns it as aParameterRefobject (ornullif the reference is in any way illegal).
-
Method Details
-
findParameterReferences
Finds all parameter references (seeSystemDataConsumer) in the given string and returns them. This method will avoid returning duplicates (i.e. two parameter references that exactly match in name and type).This method will only recognise parameter references with data types that are supported by system/node parameters (INTEGER, FLOAT and STRING).
- Parameters:
parameterisedString- a string, potentially containing variables / parameter references. This may benull.- Returns:
- all parameter references found in the string
-
parseParameterReference
Parses the specified string representation of a parameter reference (including the enclosing '%'s) and returns it as aParameterRefobject (ornullif the reference is in any way illegal).This method will only recognise parameter references with data types that are supported by system/node parameters (INTEGER, FLOAT and STRING).
- Parameters:
parameterReference- string representation of a parameter reference- Returns:
- a parsed
ParameterRefobject ornullif the reference is in any way illegal
-
getParser
Returns a parser for the specified parameterised string. The advantage compared tofindParameterReferences(String)is that the parser provides position information (start and end index of parameter reference).This method will only recognise parameter references with data types that are supported by system/node parameters (INTEGER, FLOAT and STRING).
- Parameters:
parameterisedString- the parameterised string to be formatted- Returns:
- a formatter for the specified parameterised string
-
getReplacer
Returns a replacer for the specified parameterised string to replace parameter references with actual values.This method will only recognise parameter references with data types that are supported by system/node parameters (INTEGER, FLOAT and STRING).
- Parameters:
parameterisedString- the parameterised string to be processed- Returns:
- a replacer for the specified parameterised string
-
isCompatibleParameter
Returns true, if the parameter reference and the given parameter are compatible.- Parameters:
paramRef- Parameter reference.parameter- Real parameter.- Returns:
- True, if the parameter reference and the given parameter are compatible.
-