Interface IStringParserFactory<I extends VariableDeclaration>
-
- Type Parameters:
I- the variable declaration type
- All Known Implementing Classes:
StringReplacerFactory,StringResolverFactory
public interface IStringParserFactory<I extends VariableDeclaration>An optional factory turning in-place commands into language-specific expressions. If none is given, in-place commands shall not be resolved but shall remain as string expressions.- Author:
- Holger Eichelberger
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ExpressioncreateForExpression(InPlaceForCommand<I> cmd)Creates a for-loop expression.ExpressioncreateIfExpression(InPlaceIfCommand<I> cmd)Creates an alternative expression.ExpressioncreateImportExpression(InPlaceImportCommand<I> cmd)Creates an import expression.ExpressioncreateVarDeclExpression(InPlaceVarDeclCommand<I> cmd)Creates a variable declaration expression.IcreateVariable(java.lang.String name, Expression initExpression, boolean asIterator)Creates a variable.IcreateVariableDeclaration(java.lang.String name, TypeDescriptor<?> type)Creates a non-constant variable declaration.IVersionRestrictioncreateVersionRestriction(Expression expression, I variable)Creates a version restriction from the givenexpression.
-
-
-
Method Detail
-
createIfExpression
Expression createIfExpression(InPlaceIfCommand<I> cmd) throws VilException
Creates an alternative expression.- Parameters:
cmd- the command to create an if-expression for- Returns:
- an alternative expression (may be null if not supported)
- Throws:
VilException- if the expression cannot be created
-
createForExpression
Expression createForExpression(InPlaceForCommand<I> cmd) throws VilException
Creates a for-loop expression.- Parameters:
cmd- the command to create a for-loop expression for- Returns:
- a for-loop expression (may be null if not supported)
- Throws:
VilException- if the expression cannot be created
-
createVarDeclExpression
Expression createVarDeclExpression(InPlaceVarDeclCommand<I> cmd) throws VilException
Creates a variable declaration expression.- Parameters:
cmd- the command to create a variable declaration expression for- Returns:
- a for-loop expression (may be null if not supported)
- Throws:
VilException- if the expression cannot be created
-
createImportExpression
Expression createImportExpression(InPlaceImportCommand<I> cmd) throws VilException
Creates an import expression.- Parameters:
cmd- the command to create an import expression for- Returns:
- a for-loop expression (may be null if not supported)
- Throws:
VilException- if the expression cannot be created
-
createVariable
I createVariable(java.lang.String name, Expression initExpression, boolean asIterator) throws VilException
Creates a variable.- Parameters:
name- the name of the variableinitExpression- the initialization expression determining the type of the iterator variableasIterator- whether the variable shall act as iterator- Returns:
- the variable
- Throws:
VilException- if the variable cannot be created
-
createVariableDeclaration
I createVariableDeclaration(java.lang.String name, TypeDescriptor<?> type)
Creates a non-constant variable declaration.- Parameters:
name- the name of the variabletype- the type of the variable- Returns:
- the variable declaration
-
createVersionRestriction
IVersionRestriction createVersionRestriction(Expression expression, I variable) throws VilException
Creates a version restriction from the givenexpression.- Parameters:
expression- the expressionvariable- the version variable- Returns:
- the version restriction or null if not supported
- Throws:
VilException- if the restriction cannot be created
-
-