Class ContentValuesExtractorFactory.SimpleContentValuesExtractor

    • Constructor Detail

      • SimpleContentValuesExtractor

        public SimpleContentValuesExtractor​(Collection<String> contentTypes,
                                            List<String> fieldNames)
        Build a simple ContentValuesExtractor on a list of content types.
        Parameters:
        contentTypes - The content types, can be empty.
        fieldNames - The field names.
    • Method Detail

      • initializeFields

        protected Map<String,​ObjectinitializeFields​(List<String> fieldNames)
        Initialize the fields from the field names.
        Parameters:
        fieldNames - The field names.
        Returns:
        The fields definitions (either MetadataDefinition or SystemProperty), indexed by field name.
      • getFields

        protected Map<String,​ObjectgetFields​(List<String> fieldNames)
        Retrieves a Map with the fields corresponding to the given name
        Parameters:
        fieldNames - The names of the fields to retrieve
        Returns:
        a Map with the fields
      • getAllAttributes

        protected Map<String,​ObjectgetAllAttributes​(ModelItemContainer container)
        Retrieve all the attributes present in the given container.
        Parameters:
        container - The model item container.
        Returns:
        All the attributes present in the given container.
      • getValues

        public Map<String,​ObjectgetValues​(Content content,
                                                  Locale defaultLocale)
        Get the values from the given content.
        Parameters:
        content - The content.
        defaultLocale - The default locale for localized values if the content's language is null. Can be null.
        Returns:
        the extracted values.
      • getValues

        public Map<String,​ObjectgetValues​(Content content,
                                                  Locale defaultLocale,
                                                  Map<String,​Object> contextualParameters)
        Get the values from the given content.
        Parameters:
        content - The content.
        defaultLocale - The default locale for localized values if the content's language is null. Can be null.
        contextualParameters - The search contextual parameters.
        Returns:
        the extracted values.
      • getValue

        protected Object getValue​(Content content,
                                  String fieldName,
                                  Object field,
                                  Locale defaultLocale)
        Get a value from the Content.
        Parameters:
        content - The content.
        fieldName - The field name.
        field - The field definition.
        defaultLocale - The default locale for localized values if the content's language is null. Can be null.
        Returns:
        The value.