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 = ConfigurationException.class)
      public void testContextElementWithBadJsonPathInMetadata() throws ConfigurationException {
          Metadata m = new Metadata("Meta", "string");
          m.setJsonpath("$BADJSONPATH2");
  
          Attribute a = new Attribute("Attr", "string");
          a.setMetadata(Collections.singleton(m));
  
          EventTypeIn e = new EventTypeIn("S.*", "TempSensor", true);
          e.setAttributes(Collections.singleton(a));
  
          Configuration configuration = new Configuration();
          configuration.setEventTypeIns(Collections.singletonList(e));
  
          eventMapper.setConfiguration(configuration);
      }
test_case.class_method_signature: EventMapperTest.testContextElementWithBadJsonPathInMetadata()
test_case.full_signature: @Test(expected = ConfigurationException.class) public void testContextElementWithBadJsonPathInMetadata()
test_case.identifier: testContextElementWithBadJsonPathInMetadata
test_case.invocations: setJsonpath setMetadata singleton setAttributes singleton setEventTypeIns singletonList setConfiguration
test_case.modifiers: @Test(expected = ConfigurationException.class) public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testContextElementWithBadJsonPathInMetadata()
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 void setConfiguration(Configuration configuration) throws ConfigurationException {
          Map<String, JsonPath> jsonpaths = new HashMap<>();
  
          for (EventTypeIn eventTypeIn : configuration.getEventTypeIns()) {
              for (Attribute attribute : eventTypeIn.getAttributes()) {
                  String jsonpath = attribute.getJsonpath();
                  if (jsonpath != null) {
                      // JsonPath caches paths internally, no need to reuse them from one configuration to another.
                      // Aggregate path by event type / attribute name
                      try {
                          jsonpaths.put(eventTypeIn.getType() + "/" + attribute.getName(), JsonPath.compile(jsonpath));
                      } catch (IllegalArgumentException|InvalidPathException e) {
                          throw new ConfigurationException("invalid jsonpath expression for attribute "+attribute.getName(), e);
                      }
                  }
  
                  for (Metadata metadata : attribute.getMetadata()) {
                      jsonpath = metadata.getJsonpath();
                      if (jsonpath != null) {
                          // Same as attribute but with metadata name
                          try {
                              jsonpaths.put(eventTypeIn.getType() + "/" + attribute.getName() + "/" + metadata.getName(), JsonPath.compile(jsonpath));
                          } catch (IllegalArgumentException|InvalidPathException e) {
                              throw new ConfigurationException("invalid jsonpath expression for metadata "+attribute.getName()+"/"+metadata.getName(), e);
                          }
                      }
                  }
              }
          }
  
          this.jsonpaths = jsonpaths;
      }
focal_method.class_method_signature: EventMapper.setConfiguration(Configuration configuration)
focal_method.full_signature: public void setConfiguration(Configuration configuration)
focal_method.identifier: setConfiguration
focal_method.invocations: getEventTypeIns getAttributes getJsonpath put getType getName compile getName getMetadata getJsonpath put getType getName getName compile getName getName
focal_method.modifiers: public
focal_method.parameters: (Configuration configuration)
focal_method.return: void
focal_method.signature: void setConfiguration(Configuration configuration)