Class StringReplacerFactory
- java.lang.Object
-
- net.ssehub.easy.instantiation.core.model.templateModel.StringResolverFactory
-
- net.ssehub.easy.instantiation.core.model.templateModel.StringReplacerFactory
-
- All Implemented Interfaces:
IStringParserFactory<VariableDeclaration>
public class StringReplacerFactory extends StringResolverFactory
An extended template language string resolver factory. This factory creates expressions for in-place variable declarations and imports.- Author:
- Holger Eichelberger
-
-
Field Summary
Fields Modifier and Type Field Description static StringReplacerFactoryINSTANCE
-
Constructor Summary
Constructors Modifier Constructor Description protectedStringReplacerFactory()Prevents external creation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExpressioncreateImportExpression(InPlaceImportCommand<VariableDeclaration> cmd)Creates an import expression.ExpressioncreateVarDeclExpression(InPlaceVarDeclCommand<VariableDeclaration> cmd)Creates a variable declaration expression.IVersionRestrictioncreateVersionRestriction(Expression expression, VariableDeclaration variable)Creates a version restriction from the givenexpression.-
Methods inherited from class net.ssehub.easy.instantiation.core.model.templateModel.StringResolverFactory
createForExpression, createIfExpression, createVariable, createVariableDeclaration
-
-
-
-
Field Detail
-
INSTANCE
public static final StringReplacerFactory INSTANCE
-
-
Method Detail
-
createVarDeclExpression
public Expression createVarDeclExpression(InPlaceVarDeclCommand<VariableDeclaration> cmd) throws VilException
Description copied from interface:IStringParserFactoryCreates a variable declaration expression.- Specified by:
createVarDeclExpressionin interfaceIStringParserFactory<VariableDeclaration>- Overrides:
createVarDeclExpressionin classStringResolverFactory- 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
public Expression createImportExpression(InPlaceImportCommand<VariableDeclaration> cmd) throws VilException
Description copied from interface:IStringParserFactoryCreates an import expression.- Specified by:
createImportExpressionin interfaceIStringParserFactory<VariableDeclaration>- Overrides:
createImportExpressionin classStringResolverFactory- 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
-
createVersionRestriction
public IVersionRestriction createVersionRestriction(Expression expression, VariableDeclaration variable) throws VilException
Description copied from interface:IStringParserFactoryCreates a version restriction from the givenexpression.- Specified by:
createVersionRestrictionin interfaceIStringParserFactory<VariableDeclaration>- Overrides:
createVersionRestrictionin classStringResolverFactory- Parameters:
expression- the expressionvariable- the version variable- Returns:
- the version restriction or null if not supported
- Throws:
VilException- if the restriction cannot be created
-
-