test_class.declarator: eventMapper
test_class.modifier: @Autowired
      public
test_class.original_string: @Autowired
      public EventMapper eventMapper;
test_class.type: EventMapper
test_class.var_name: eventMapper
test_class.file: cepheus-cep/src/test/java/com/orange/cepheus/cep/EventMapperTest.java
test_class.identifier: EventMapperTest
test_case.body: @Test(expected = EventProcessingException.class)
      public void testContextElementConversionNull() throws Exception {
          ContextElement ce = new ContextElement();
          ce.setEntityId(new EntityId("S1", "TempSensor", false));
  
          List<ContextAttribute> attributes = new LinkedList<>();
          attributes.add(new ContextAttribute("1", "string", null));
          ce.setContextAttributeList(attributes);
  
          eventMapper.eventFromContextElement(ce).getValues();
      }
test_case.class_method_signature: EventMapperTest.testContextElementConversionNull()
test_case.full_signature: @Test(expected = EventProcessingException.class) public void testContextElementConversionNull()
test_case.identifier: testContextElementConversionNull
test_case.invocations: setEntityId add setContextAttributeList getValues eventFromContextElement
test_case.modifiers: @Test(expected = EventProcessingException.class) public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testContextElementConversionNull()
focal_class.declarator: jsonpaths = new HashMap<>()
focal_class.modifier: private
focal_class.original_string: private Map<String, JsonPath> jsonpaths = new HashMap<>();
focal_class.type: Map<String, JsonPath>
focal_class.var_name: jsonpaths
focal_class.declarator: iso8691DateFormat = new ISO8601DateFormat()
focal_class.modifier: private
focal_class.original_string: private ISO8601DateFormat iso8691DateFormat = new ISO8601DateFormat();
focal_class.type: ISO8601DateFormat
focal_class.var_name: iso8691DateFormat
focal_class.file: cepheus-cep/src/main/java/com/orange/cepheus/cep/EventMapper.java
focal_class.identifier: EventMapper
focal_class.class_method_signature: EventMapper.setConfiguration(Configuration configuration)
focal_class.full_signature: public void setConfiguration(Configuration configuration)
focal_class.identifier: setConfiguration
focal_class.modifiers: public
focal_class.parameters: (Configuration configuration)
focal_class.return: void
focal_class.signature: void setConfiguration(Configuration configuration)
focal_class.class_method_signature: EventMapper.esperTypeFromEventType(EventType eventType)
focal_class.full_signature: public Map<String, Object> esperTypeFromEventType(EventType eventType)
focal_class.identifier: esperTypeFromEventType
focal_class.modifiers: public
focal_class.parameters: (EventType eventType)
focal_class.return: Map<String, Object>
focal_class.signature: Map<String, Object> esperTypeFromEventType(EventType eventType)
focal_class.class_method_signature: EventMapper.eventFromContextElement(ContextElement contextElement)
focal_class.full_signature: public Event eventFromContextElement(ContextElement contextElement)
focal_class.identifier: eventFromContextElement
focal_class.modifiers: public
focal_class.parameters: (ContextElement contextElement)
focal_class.return: Event
focal_class.signature: Event eventFromContextElement(ContextElement contextElement)
focal_class.class_method_signature: EventMapper.contextElementFromEvent(EventBean eventBean, EventType eventType)
focal_class.full_signature: public ContextElement contextElementFromEvent(EventBean eventBean, EventType eventType)
focal_class.identifier: contextElementFromEvent
focal_class.modifiers: public
focal_class.parameters: (EventBean eventBean, EventType eventType)
focal_class.return: ContextElement
focal_class.signature: ContextElement contextElementFromEvent(EventBean eventBean, EventType eventType)
focal_class.class_method_signature: EventMapper.attributeValueFromEventProperty(Object value, String type)
focal_class.full_signature: public Object attributeValueFromEventProperty(Object value, String type)
focal_class.identifier: attributeValueFromEventProperty
focal_class.modifiers: public
focal_class.parameters: (Object value, String type)
focal_class.return: Object
focal_class.signature: Object attributeValueFromEventProperty(Object value, String type)
focal_class.class_method_signature: EventMapper.classForType(String attributeType)
focal_class.full_signature: private Class classForType(String attributeType)
focal_class.identifier: classForType
focal_class.modifiers: private
focal_class.parameters: (String attributeType)
focal_class.return: Class
focal_class.signature: Class classForType(String attributeType)
focal_class.class_method_signature: EventMapper.valueForType(Object value, String type, String name)
focal_class.full_signature: private Object valueForType(Object value, String type, String name)
focal_class.identifier: valueForType
focal_class.modifiers: private
focal_class.parameters: (Object value, String type, String name)
focal_class.return: Object
focal_class.signature: Object valueForType(Object value, String type, String name)
focal_class.class_method_signature: EventMapper.valueForString(String value, String type, String name)
focal_class.full_signature: private Object valueForString(String value, String type, String name)
focal_class.identifier: valueForString
focal_class.modifiers: private
focal_class.parameters: (String value, String type, String name)
focal_class.return: Object
focal_class.signature: Object valueForString(String value, String type, String name)
focal_method.body: public Event eventFromContextElement(ContextElement contextElement) throws EventProcessingException, TypeNotFoundException {
          String eventId = contextElement.getEntityId().getId();
          String eventType = contextElement.getEntityId().getType();
  
          Event event = new Event(eventType);
  
          // Add metadata values first
          for(ContextAttribute contextAttribute : contextElement.getContextAttributeList()) {
              String attrName = contextAttribute.getName();
              for (ContextMetadata contextMetada : contextAttribute.getMetadata()) {
                  String name = contextMetada.getName();
                  String type = contextMetada.getType();
  
                  Object value = contextMetada.getValue();
  
                  // Extract value from jsonpath if any
                  JsonPath jsonPath = jsonpaths.get(eventType + "/" + attrName + "/" + name);
                  if (jsonPath != null) {
                      value = jsonPath.read(value);
                  }
  
                  value = valueForType(value, type, name);
                  event.addValue(attrName + "_" + name, value);
              }
          }
  
          // Override with attributes values
          for(ContextAttribute contextAttribute : contextElement.getContextAttributeList()) {
              String name = contextAttribute.getName();
              String type = contextAttribute.getType();
  
              Object value = contextAttribute.getValue();
  
              // Extract value from jsonpath if any
              JsonPath jsonPath = jsonpaths.get(eventType + "/" + name);
              if (jsonPath != null) {
                  value = jsonPath.read(value);
              }
  
              value = valueForType(value, type, name);
              if (value == null) {
                  throw new EventProcessingException("Value cannot be null for attribute "+name);
              }
  
              event.addValue(name, value);
          }
  
          // Override with id
          event.addValue("id", eventId);
  
          return event;
      }
focal_method.class_method_signature: EventMapper.eventFromContextElement(ContextElement contextElement)
focal_method.full_signature: public Event eventFromContextElement(ContextElement contextElement)
focal_method.identifier: eventFromContextElement
focal_method.invocations: getId getEntityId getType getEntityId getContextAttributeList getName getMetadata getName getType getValue get read valueForType addValue getContextAttributeList getName getType getValue get read valueForType addValue addValue
focal_method.modifiers: public
focal_method.parameters: (ContextElement contextElement)
focal_method.return: Event
focal_method.signature: Event eventFromContextElement(ContextElement contextElement)