Class CaseInsensitiveAttributeExtractor


  • public class CaseInsensitiveAttributeExtractor
    extends AttributeExtractor
    author Pascal Knueppel
    created at: 23.07.2022 - 13:22

    used to extract an attribute from a json document case-insensitive
    • Constructor Detail

      • CaseInsensitiveAttributeExtractor

        public CaseInsensitiveAttributeExtractor​(com.fasterxml.jackson.databind.JsonNode jsonDocument)
    • Method Detail

      • getAttribute

        public Optional<com.fasterxml.jackson.databind.JsonNode> getAttribute​(SchemaAttribute schemaAttribute)
        will try to extract an attribute from the json document case-insensitive:
        1. try to extract it by its correct attribute name from the json document
        2. if not found try to extract it from the attributeMap
        3. if not found iterate over the document and store each found element with its key value in lowercase in the attributeMap until found
        Specified by:
        getAttribute in class AttributeExtractor
        Parameters:
        schemaAttribute - the attribute that should be extracted from the document
        Returns:
        the attribute or an empty if not found