first commit
This commit is contained in:
58
hrmsEjb/wenrgise/common/utility/ReportManager.java
Normal file
58
hrmsEjb/wenrgise/common/utility/ReportManager.java
Normal file
@@ -0,0 +1,58 @@
|
||||
package wenrgise.common.utility;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import wenrgise.common.xml.vo.INFOClass;
|
||||
import wenrgise.common.xml.vo.Module;
|
||||
import wenrgise.common.xml.vo.Report;
|
||||
import wenrgise.common.xml.vo.ReportInfo;
|
||||
import wenrgise.common.xml.vo.Reports;
|
||||
import wenrgise.common.xml.vo.ScreenInfo;
|
||||
|
||||
public class ReportManager {
|
||||
private static ReportManager me;
|
||||
|
||||
private HashMap oMap = new HashMap();
|
||||
|
||||
public static ReportManager getInstance() {
|
||||
if (me == null)
|
||||
me = new ReportManager();
|
||||
return me;
|
||||
}
|
||||
|
||||
public ReportInfo getCachedObject(String name_) {
|
||||
if (name_ == null || name_.trim().length() <= 0)
|
||||
return null;
|
||||
return (ReportInfo)this.oMap.get(name_);
|
||||
}
|
||||
|
||||
public void init(INFOClass oINFOClass) {
|
||||
if (oINFOClass == null)
|
||||
return;
|
||||
ArrayList oList = oINFOClass.get_Module();
|
||||
Iterator oIt = oList.iterator();
|
||||
while (oIt.hasNext()) {
|
||||
Module oModule = oIt.next();
|
||||
String sModuleName = oModule.get_ModuleName();
|
||||
ArrayList oScreenInfoList = oModule.get_ScreenInfo();
|
||||
Iterator oScreenInfoIt = oScreenInfoList.iterator();
|
||||
while (oScreenInfoIt.hasNext()) {
|
||||
ScreenInfo oScreenInfo = oScreenInfoIt.next();
|
||||
String sScreenName = oScreenInfo.get_ScreenName();
|
||||
Reports oReports = oScreenInfo.get_Reports();
|
||||
ArrayList oReportList = oReports.get_Report();
|
||||
Iterator oReportIt = oReportList.iterator();
|
||||
while (oReportIt.hasNext()) {
|
||||
Report oReport = oReportIt.next();
|
||||
ReportInfo oReportInfo = new ReportInfo();
|
||||
oReportInfo.setReportKey(oReport.get_ReportKey());
|
||||
String sCombinedKey = String.valueOf(String.valueOf(sModuleName).concat(String.valueOf(sScreenName))).concat(String.valueOf(oReport.get_KeyInfo()));
|
||||
System.out.println(String.valueOf("The key is ").concat(String.valueOf(sCombinedKey)));
|
||||
if (!this.oMap.containsKey(sCombinedKey))
|
||||
this.oMap.put(sCombinedKey, oReportInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user