Class InstanceNameValueMapper
- java.lang.Object
-
- net.ssehub.easy.instantiation.core.model.vilTypes.configuration.InstanceNameValueMapper
-
- All Implemented Interfaces:
IVariableValueMapper
public class InstanceNameValueMapper extends java.lang.Object implements IVariableValueMapper
Implements a simple instance-name based value mapper.- Author:
- Holger Eichelberger
-
-
Constructor Summary
Constructors Constructor Description InstanceNameValueMapper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clears all values.private booleangetBoolean(IvmlElement element, java.lang.String prefix, boolean deflt)Returns a boolean value forelement.java.lang.ObjectgetValue(IvmlElement element)Returns the value of the specified element.booleanisEnacting(IvmlElement element)Returns whether the givenelementis valid.booleanisValid(IvmlElement element)Returns whether the givenelementis valid.voidsetEnacting(java.lang.String name, java.lang.Boolean value)Defines a enacting flag forelement.voidsetEnacting(IvmlElement element, java.lang.Boolean value)Defines the enacting flag forelement.voidsetValid(java.lang.String name, java.lang.Boolean value)Defines the validity flag forelement.voidsetValid(IvmlElement element, java.lang.Boolean value)Defines the validity flag forelement.voidsetValue(java.lang.String name, java.lang.Object value)Defines the value of an IVML element.voidsetValue(IvmlElement element, java.lang.Object value)Defines the value ofelement.
-
-
-
Field Detail
-
VALID
private static final java.lang.String VALID
- See Also:
- Constant Field Values
-
ENACTING
private static final java.lang.String ENACTING
- See Also:
- Constant Field Values
-
values
private transient java.util.Map<java.lang.String,java.lang.Object> values
-
-
Method Detail
-
getBoolean
private boolean getBoolean(IvmlElement element, java.lang.String prefix, boolean deflt)
Returns a boolean value forelement.- Parameters:
element- the elementprefix- the prefixdeflt- the default value if the actual value is not defined- Returns:
- the boolean value
-
isValid
public boolean isValid(IvmlElement element)
Description copied from interface:IVariableValueMapperReturns whether the givenelementis valid.- Specified by:
isValidin interfaceIVariableValueMapper- Parameters:
element- the element- Returns:
trueif valid (also if no mapping),falseif invalid
-
isEnacting
public boolean isEnacting(IvmlElement element)
Description copied from interface:IVariableValueMapperReturns whether the givenelementis valid.- Specified by:
isEnactingin interfaceIVariableValueMapper- Parameters:
element- the element- Returns:
trueif valid,falseif invalid (also if no mapping)
-
getValue
public java.lang.Object getValue(IvmlElement element)
Description copied from interface:IVariableValueMapperReturns the value of the specified element.- Specified by:
getValuein interfaceIVariableValueMapper- Parameters:
element- the element- Returns:
- the value, null if undefined or if there is no mapping
-
setValue
public void setValue(IvmlElement element, java.lang.Object value)
Defines the value ofelement.- Parameters:
element- the element to change the value forvalue- the value (null for undefined)
-
setValue
public void setValue(java.lang.String name, java.lang.Object value)Defines the value of an IVML element.- Parameters:
name- the instance name of the element to change the value forvalue- the value (null for undefined)
-
setValid
public void setValid(IvmlElement element, java.lang.Boolean value)
Defines the validity flag forelement.- Parameters:
element- the element to change the flag forvalue- the validity flag (null for undefined, the value for the flag)
-
setValid
public void setValid(java.lang.String name, java.lang.Boolean value)Defines the validity flag forelement.- Parameters:
name- the instance name of the IVML element to change the flag forvalue- the validity flag (null for undefined)
-
setEnacting
public void setEnacting(IvmlElement element, java.lang.Boolean value)
Defines the enacting flag forelement.- Parameters:
element- the element to change the flag forvalue- the enacting flag (null for undefined)
-
setEnacting
public void setEnacting(java.lang.String name, java.lang.Boolean value)Defines a enacting flag forelement.- Parameters:
name- the instance name of the IVML element to change the flag forvalue- the enacting flag (null for undefined)
-
clear
public void clear()
Clears all values.
-
-