Class ExcelTranslatorRegistry


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

      • ExcelTranslatorRegistry

        public ExcelTranslatorRegistry()
    • Method Detail

      • getTranslator

        public java.util.Optional<ExcelValueTranslator<java.lang.Object>> getTranslator​(AttributeDescriptorModel attributeDescriptor)
        Finds translator which can handle given attribute descriptor.
        Parameters:
        attributeDescriptor - which represents selected attribute.
        Returns:
        Optional of ExcelValueTranslator. If none translator can handle given attribute descriptor then Optional.empty() will be returned.
      • getTranslator

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

        @Deprecated
        @PostConstruct
        public void init()
        Deprecated.
        since 1811 use method getTranslators() which return sorted translators
        Post construct method which sorts translators by its order. The method shouldn't be invoked manually.
      • canHandle

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

        public java.util.List<ExcelValueTranslator<java.lang.Object>> getTranslators()
        Returns list of registered translators.
        Returns:
        list of registered translators.
      • setTranslators

        public void setTranslators​(java.util.List<ExcelValueTranslator<java.lang.Object>> translators)
        Sets list of translators for the registry.
        Parameters:
        translators - for the registry.