Class ExcelAttributeTranslatorRegistry


  • public class ExcelAttributeTranslatorRegistry
    extends java.lang.Object
    Default registry for excel attribute translator strategies.
    • Constructor Detail

      • ExcelAttributeTranslatorRegistry

        public ExcelAttributeTranslatorRegistry()
    • Method Detail

      • findTranslator

        public java.util.Optional<ExcelAttributeTranslator<ExcelAttribute>> findTranslator​(ExcelAttribute excelAttribute)
        Finds translator which can handle given excel attribute.
        Parameters:
        excelAttribute - which represents selected excel attribute.
        Returns:
        Optional of ExcelAttributeTranslator. If none translator can handle given attribute descriptor then Optional.empty() will be returned.
      • findTranslator

        public java.util.Optional<ExcelAttributeTranslator<ExcelAttribute>> findTranslator​(ExcelAttribute excelAttribute,
                                                                                           java.lang.Class<? extends ExcelAttributeTranslator>... exclude)
        Finds translator which can handle given excel attribute.
        Parameters:
        excelAttribute - which represents selected excel attribute.
        exclude - translators classes which should not be taken into account
        Returns:
        Optional of ExcelAttributeTranslator. If none translator can handle given attribute descriptor then Optional.empty() will be returned.
      • init

        @PostConstruct
        public void init()
        Post construct method which sorts translators by its order. The method shouldn't be invoked manually.
      • canHandle

        public boolean canHandle​(ExcelAttribute excelAttribute)
        Indicates whether there is at least one translator which can handle given attribute descriptor.
        Parameters:
        excelAttribute - which represents selected attribute.
        Returns:
        true whether at least one translator can handle given attribute descriptor.
      • getTranslators

        public java.util.List<ExcelAttributeTranslator<ExcelAttribute>> getTranslators()
        Returns list of registered attribute translators.
        Returns:
        list of registered translators.
      • setTranslators

        public void setTranslators​(java.util.List<ExcelAttributeTranslator<ExcelAttribute>> translators)
        Sets list of attribute translators for the registry.
        Parameters:
        translators - for the registry.