Class InPlaceImportCommand<I extends VariableDeclaration>
- java.lang.Object
-
- net.ssehub.easy.instantiation.core.model.expressions.Expression
-
- net.ssehub.easy.instantiation.core.model.expressions.InPlaceCommand<I>
-
- net.ssehub.easy.instantiation.core.model.expressions.InPlaceImportCommand<I>
-
- Type Parameters:
I- the variable declaration type
public class InPlaceImportCommand<I extends VariableDeclaration> extends InPlaceCommand<I>
Represents an in-place import command.- Author:
- Holger Eichelberger
-
-
Field Summary
Fields Modifier and Type Field Description private IVersionRestrictionrestrictionprivate java.lang.Stringtemplate
-
Constructor Summary
Constructors Constructor Description InPlaceImportCommand(java.lang.String template, IVersionRestriction restriction)Creates an in-place import command.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidappend(java.util.List<Expression> exprs)Appends the sub-expressions in parse sequence toexprsleaving out this command as fallback.protected voidappend(Expression ex)Appends a sub-expression.protected Expressionclose(IStringParserFactory<I> factory)Closes this in-place command by creating the real expression.java.lang.StringgetTemplate()Returns the template name.IVersionRestrictiongetVersionRestriction()Returns the version restriction.protected voidreplace(InPlaceCommand<I> cmd, Expression expr)Replacescmdbyexpr.-
Methods inherited from class net.ssehub.easy.instantiation.core.model.expressions.InPlaceCommand
accept, advanceState, holdsResolverLevel, inferType, replace
-
Methods inherited from class net.ssehub.easy.instantiation.core.model.expressions.Expression
getFormattingHint, replaceEmptyLine
-
-
-
-
Field Detail
-
template
private java.lang.String template
-
restriction
private IVersionRestriction restriction
-
-
Constructor Detail
-
InPlaceImportCommand
public InPlaceImportCommand(java.lang.String template, IVersionRestriction restriction)Creates an in-place import command.- Parameters:
template- the template to importrestriction- the version restriction (may be null)
-
-
Method Detail
-
getTemplate
public java.lang.String getTemplate()
Returns the template name.- Returns:
- the template name
-
getVersionRestriction
public IVersionRestriction getVersionRestriction()
Returns the version restriction.- Returns:
- the version restriction
-
append
protected void append(Expression ex)
Description copied from class:InPlaceCommandAppends a sub-expression. An in-place command can have multiple sub-structures, that are sequentially switched to active viaInPlaceCommand.advanceState().- Specified by:
appendin classInPlaceCommand<I extends VariableDeclaration>- Parameters:
ex- the expression to append
-
close
protected Expression close(IStringParserFactory<I> factory) throws VilException
Description copied from class:InPlaceCommandCloses this in-place command by creating the real expression.- Specified by:
closein classInPlaceCommand<I extends VariableDeclaration>- Parameters:
factory- the factory used to create the real expression- Returns:
- the real expression, may be null if optional / none shall be created
- Throws:
VilException- if the provided information is not sufficient for creating an expression
-
append
protected void append(java.util.List<Expression> exprs)
Description copied from class:InPlaceCommandAppends the sub-expressions in parse sequence toexprsleaving out this command as fallback.- Specified by:
appendin classInPlaceCommand<I extends VariableDeclaration>- Parameters:
exprs- the expressions to add the sub-expressions to
-
replace
protected void replace(InPlaceCommand<I> cmd, Expression expr)
Description copied from class:InPlaceCommandReplacescmdbyexpr.- Specified by:
replacein classInPlaceCommand<I extends VariableDeclaration>- Parameters:
cmd- the command to be replacedexpr- the replacing expression
-
-