Class PropertyEdgeConverterManager

java.lang.Object
de.fraunhofer.aisec.cpg.graph.edge.PropertyEdgeConverterManager

public class PropertyEdgeConverterManager
extends java.lang.Object
Since Neo4J uses the PropertyEdgeConverter (as it implements the CompositeAttributeConverter interface), we cannot define it as a singleton, as it requires to have a constructor. We want to be able to dynamically define converters for PropertyEdges that have more complex structures such as enums or custom classes, we need a singleton to be able to add the converters. Refer to the documentation of PropertyEdgeConverter to see which primitives are supported by default, and which require a custom converter.
  • Method Summary

    Modifier and Type Method Description
    void addDeserializer​(java.lang.String name, java.util.function.Function<java.lang.Object,​java.lang.Object> func)  
    void addSerializer​(java.lang.String clazz, java.util.function.Function<java.lang.Object,​java.lang.String> func)  
    java.util.Map<java.lang.String,​java.util.function.Function<java.lang.Object,​java.lang.Object>> getDeserializer()  
    static PropertyEdgeConverterManager getInstance()  
    java.util.Map<java.lang.String,​java.util.function.Function<java.lang.Object,​java.lang.String>> getSerializer()  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • getInstance

      public static PropertyEdgeConverterManager getInstance()
    • addSerializer

      public void addSerializer​(java.lang.String clazz, java.util.function.Function<java.lang.Object,​java.lang.String> func)
    • addDeserializer

      public void addDeserializer​(java.lang.String name, java.util.function.Function<java.lang.Object,​java.lang.Object> func)
    • getSerializer

      public java.util.Map<java.lang.String,​java.util.function.Function<java.lang.Object,​java.lang.String>> getSerializer()
    • getDeserializer

      public java.util.Map<java.lang.String,​java.util.function.Function<java.lang.Object,​java.lang.Object>> getDeserializer()