Class VelocityContextInitializer

  • All Implemented Interfaces:
    net.ssehub.easy.varModel.model.datatypes.IDatatypeVisitor

    class VelocityContextInitializer
    extends java.lang.Object
    implements net.ssehub.easy.varModel.model.datatypes.IDatatypeVisitor
    Converts an IDecisionVariable into flat VelocityContextItem, because Velocity needs a simple (name, value) tuple for instantiation.
    Author:
    Sascha El-Sharkawy
    • Constructor Summary

      Constructors 
      Constructor Description
      VelocityContextInitializer​(net.ssehub.easy.varModel.confModel.IDecisionVariable variable)
      Sole constructor, will immediately start the conversation.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) java.util.List<VelocityContextItem> getItems()
      The converted VelocityContextItems.
      private void handleContainer()
      Shall convert ContainerVariable into VelocityContextItems, but not implemented yet.
      void visitAnyType​(net.ssehub.easy.varModel.model.datatypes.AnyType datatype)  
      void visitBooleanType​(net.ssehub.easy.varModel.model.datatypes.BooleanType type)  
      void visitCompoundType​(net.ssehub.easy.varModel.model.datatypes.Compound compound)  
      void visitConstraintType​(net.ssehub.easy.varModel.model.datatypes.ConstraintType datatype)  
      void visitDatatype​(net.ssehub.easy.varModel.model.datatypes.IDatatype datatype)  
      void visitDerivedType​(net.ssehub.easy.varModel.model.datatypes.DerivedDatatype datatype)  
      void visitEnumType​(net.ssehub.easy.varModel.model.datatypes.Enum enumType)  
      void visitIntegerType​(net.ssehub.easy.varModel.model.datatypes.IntegerType type)  
      void visitMetaType​(net.ssehub.easy.varModel.model.datatypes.MetaType datatype)  
      void visitOrderedEnumType​(net.ssehub.easy.varModel.model.datatypes.OrderedEnum enumType)  
      void visitRealType​(net.ssehub.easy.varModel.model.datatypes.RealType type)  
      void visitReference​(net.ssehub.easy.varModel.model.datatypes.Reference reference)  
      void visitSequence​(net.ssehub.easy.varModel.model.datatypes.Sequence sequence)  
      void visitSet​(net.ssehub.easy.varModel.model.datatypes.Set set)  
      void visitStringType​(net.ssehub.easy.varModel.model.datatypes.StringType type)  
      void visitVersionType​(net.ssehub.easy.varModel.model.datatypes.VersionType type)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • variableName

        private java.lang.StringBuffer variableName
      • variable

        private net.ssehub.easy.varModel.confModel.IDecisionVariable variable
    • Constructor Detail

      • VelocityContextInitializer

        VelocityContextInitializer​(net.ssehub.easy.varModel.confModel.IDecisionVariable variable)
        Sole constructor, will immediately start the conversation.
        Parameters:
        variable - A frozen IDecisionVariable of the configuration which shall be used inside the instantiation process.
    • Method Detail

      • getItems

        java.util.List<VelocityContextItem> getItems()
        The converted VelocityContextItems. Structured variables like compounds oder container will be converted into multiple items, one item for each nested element.
        Returns:
        The converted items of the IDecisionVariable passed to the constructor.
      • visitDatatype

        public void visitDatatype​(net.ssehub.easy.varModel.model.datatypes.IDatatype datatype)
        Specified by:
        visitDatatype in interface net.ssehub.easy.varModel.model.datatypes.IDatatypeVisitor
      • visitAnyType

        public void visitAnyType​(net.ssehub.easy.varModel.model.datatypes.AnyType datatype)
        Specified by:
        visitAnyType in interface net.ssehub.easy.varModel.model.datatypes.IDatatypeVisitor
      • visitMetaType

        public void visitMetaType​(net.ssehub.easy.varModel.model.datatypes.MetaType datatype)
        Specified by:
        visitMetaType in interface net.ssehub.easy.varModel.model.datatypes.IDatatypeVisitor
      • visitConstraintType

        public void visitConstraintType​(net.ssehub.easy.varModel.model.datatypes.ConstraintType datatype)
        Specified by:
        visitConstraintType in interface net.ssehub.easy.varModel.model.datatypes.IDatatypeVisitor
      • visitDerivedType

        public void visitDerivedType​(net.ssehub.easy.varModel.model.datatypes.DerivedDatatype datatype)
        Specified by:
        visitDerivedType in interface net.ssehub.easy.varModel.model.datatypes.IDatatypeVisitor
      • visitSet

        public void visitSet​(net.ssehub.easy.varModel.model.datatypes.Set set)
        Specified by:
        visitSet in interface net.ssehub.easy.varModel.model.datatypes.IDatatypeVisitor
      • visitSequence

        public void visitSequence​(net.ssehub.easy.varModel.model.datatypes.Sequence sequence)
        Specified by:
        visitSequence in interface net.ssehub.easy.varModel.model.datatypes.IDatatypeVisitor
      • visitReference

        public void visitReference​(net.ssehub.easy.varModel.model.datatypes.Reference reference)
        Specified by:
        visitReference in interface net.ssehub.easy.varModel.model.datatypes.IDatatypeVisitor
      • visitBooleanType

        public void visitBooleanType​(net.ssehub.easy.varModel.model.datatypes.BooleanType type)
        Specified by:
        visitBooleanType in interface net.ssehub.easy.varModel.model.datatypes.IDatatypeVisitor
      • visitStringType

        public void visitStringType​(net.ssehub.easy.varModel.model.datatypes.StringType type)
        Specified by:
        visitStringType in interface net.ssehub.easy.varModel.model.datatypes.IDatatypeVisitor
      • visitIntegerType

        public void visitIntegerType​(net.ssehub.easy.varModel.model.datatypes.IntegerType type)
        Specified by:
        visitIntegerType in interface net.ssehub.easy.varModel.model.datatypes.IDatatypeVisitor
      • visitRealType

        public void visitRealType​(net.ssehub.easy.varModel.model.datatypes.RealType type)
        Specified by:
        visitRealType in interface net.ssehub.easy.varModel.model.datatypes.IDatatypeVisitor
      • visitCompoundType

        public void visitCompoundType​(net.ssehub.easy.varModel.model.datatypes.Compound compound)
        Specified by:
        visitCompoundType in interface net.ssehub.easy.varModel.model.datatypes.IDatatypeVisitor
      • visitEnumType

        public void visitEnumType​(net.ssehub.easy.varModel.model.datatypes.Enum enumType)
        Specified by:
        visitEnumType in interface net.ssehub.easy.varModel.model.datatypes.IDatatypeVisitor
      • visitOrderedEnumType

        public void visitOrderedEnumType​(net.ssehub.easy.varModel.model.datatypes.OrderedEnum enumType)
        Specified by:
        visitOrderedEnumType in interface net.ssehub.easy.varModel.model.datatypes.IDatatypeVisitor
      • visitVersionType

        public void visitVersionType​(net.ssehub.easy.varModel.model.datatypes.VersionType type)
        Specified by:
        visitVersionType in interface net.ssehub.easy.varModel.model.datatypes.IDatatypeVisitor