Package com.almis.awe.model.dao
Class AweElementsDao
- java.lang.Object
-
- com.almis.awe.model.dao.AweElementsDao
-
public class AweElementsDao extends Object
-
-
Constructor Summary
Constructors Constructor Description AweElementsDao(XStreamSerializer serializer, BaseConfigProperties baseConfigProperties)
Autowired constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> T
parseTemplate(Class<T> clazz, String template)
Deserialize string template<T> void
readFolderXmlFiles(Class<T> clazz, String path, Map<String,T> storage)
Read all XML files and store them in the component<T> Future<String>
readFolderXmlFilesAsync(Class<T> clazz, String path, Map<String,T> storage)
Read all XML files and store them in the componentFuture<String>
readLocaleAsync(String basePath, String language, Map<String,Map<String,String>> localeList)
Read a locale file asynchronously<T extends XMLFile,N extends XMLNode>
StringreadModuleFile(Class<T> rootClass, Map<String,N> storage, String filePath)
Read all XML files and store them in the component<T> List<String>
readModuleFolderXmlFile(Class<T> clazz, String path, Map<String,T> storage)
Read all XML files and store them in the component<T> T
readXmlFile(Class<T> clazz, String filePath)
Read all XML files and store them in the component<T extends XMLFile,N extends XMLNode>
voidreadXmlFiles(Class<T> rootClass, Map<String,N> storage, String filePath)
Read all XML files and store them in the component<T extends XMLFile,N extends XMLNode>
Future<String>readXmlFilesAsync(Class<T> rootClass, Map<String,N> storage, String filePath)
Read all XML files and store them in the component<T> String
toXMLString(Class<T> clazz, T template)
Deserialize string template
-
-
-
Constructor Detail
-
AweElementsDao
public AweElementsDao(XStreamSerializer serializer, BaseConfigProperties baseConfigProperties)
Autowired constructor- Parameters:
serializer
- SerializerbaseConfigProperties
- Base config properties
-
-
Method Detail
-
readXmlFilesAsync
@Async("contextlessTaskExecutor") public <T extends XMLFile,N extends XMLNode> Future<String> readXmlFilesAsync(Class<T> rootClass, Map<String,N> storage, String filePath)
Read all XML files and store them in the component- Parameters:
rootClass
- Root classstorage
- Storage listfilePath
- 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 classstorage
- Storage listfilePath
- File path
-
readModuleFile
public <T extends XMLFile,N extends XMLNode> String readModuleFile(Class<T> rootClass, Map<String,N> storage, String filePath)
Read all XML files and store them in the component- Parameters:
rootClass
- Root classstorage
- Storage listfilePath
- 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 classfilePath
- 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 classpath
- Base directory pathstorage
- 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 classpath
- Base directory pathstorage
- 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 classpath
- 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 pathlanguage
- languagelocaleList
- locale list
-
toXMLString
public <T> String toXMLString(Class<T> clazz, T template)
Deserialize string template- Parameters:
clazz
- Object classtemplate
- String template- Returns:
- Object deserialized
-
-