Class AweElementsDao


  • public class AweElementsDao
    extends Object
    • Constructor Detail

      • AweElementsDao

        public AweElementsDao​(XStreamSerializer serializer,
                              BaseConfigProperties baseConfigProperties)
        Autowired constructor
        Parameters:
        serializer - Serializer
        baseConfigProperties - Base config properties
    • Method Detail

      • readXmlFilesAsync

        @Async("contextlessTaskExecutor")
        public <T extends XMLFile,​N extends XMLNodeFuture<String> readXmlFilesAsync​(Class<T> rootClass,
                                                                                            Map<String,​N> storage,
                                                                                            String filePath)
        Read all XML files and store them in the component
        Parameters:
        rootClass - Root class
        storage - Storage list
        filePath - File path
      • readXmlFiles

        public <T extends XMLFile,​N extends XMLNode> void readXmlFiles​(Class<T> rootClass,
                                                                             Map<String,​N> storage,
                                                                             String filePath)
        Read all XML files and store them in the component
        Parameters:
        rootClass - Root class
        storage - Storage list
        filePath - File path
      • readModuleFile

        public <T extends XMLFile,​N extends XMLNodeString readModuleFile​(Class<T> rootClass,
                                                                                 Map<String,​N> storage,
                                                                                 String filePath)
        Read all XML files and store them in the component
        Parameters:
        rootClass - Root class
        storage - Storage list
        filePath - File path
      • readXmlFile

        @Cacheable(value="xml",
                   key="{ #p0.toString(), #p1 }")
        public <T> T readXmlFile​(Class<T> clazz,
                                 String filePath)
        Read all XML files and store them in the component
        Type Parameters:
        T - Class type
        Parameters:
        clazz - File class
        filePath - File path
        Returns:
        Xml file object
      • readFolderXmlFilesAsync

        @Async("contextlessTaskExecutor")
        public <T> Future<String> readFolderXmlFilesAsync​(Class<T> clazz,
                                                          String path,
                                                          Map<String,​T> storage)
        Read all XML files and store them in the component
        Parameters:
        clazz - File class
        path - Base directory path
        storage - Storage to keep read files
      • readFolderXmlFiles

        public <T> void readFolderXmlFiles​(Class<T> clazz,
                                           String path,
                                           Map<String,​T> storage)
        Read all XML files and store them in the component
        Parameters:
        clazz - File class
        path - Base directory path
        storage - Storage to keep read files
      • readModuleFolderXmlFile

        public <T> List<String> readModuleFolderXmlFile​(Class<T> clazz,
                                                        String path,
                                                        Map<String,​T> storage)
        Read all XML files and store them in the component
        Parameters:
        clazz - File class
        path - Base directory path
        Returns:
        Xml file object
      • readLocaleAsync

        @Async("contextlessTaskExecutor")
        public Future<String> readLocaleAsync​(String basePath,
                                              String language,
                                              Map<String,​Map<String,​String>> localeList)
        Read a locale file asynchronously
        Parameters:
        basePath - base path
        language - language
        localeList - locale list
      • toXMLString

        public <T> String toXMLString​(Class<T> clazz,
                                      T template)
        Deserialize string template
        Parameters:
        clazz - Object class
        template - String template
        Returns:
        Object deserialized
      • parseTemplate

        public <T> T parseTemplate​(Class<T> clazz,
                                   String template)
        Deserialize string template
        Parameters:
        clazz - Object class
        template - String template
        Returns:
        Object deserialized