JexFramework 에서 은행 영업일 확인 클래스 구현

128 views
Skip to first unread message

Icjun Park

unread,
Mar 31, 2013, 9:21:03 PM3/31/13
to jexf...@googlegroups.com
1. Jex Core library(JexFrame.0.2.jar)에서  jex.util.JexDefaultBusinessDateUtil 클래스를 상속받아서 getBusinessDayType 메서드를 오버라이딩합니다.
 
getBusinessDayType 메서드의 소스는 아래처럼 되어 있습니다. 구현 부분에서 은행별 영업일 정보 데이터를 조회하여 구현하십시오.
 
public int getBusinessDayType(Calendar cal)
    {
        int week_day = cal.get(Calendar.DAY_OF_WEEK);
       
        int result  = BUSINESS_DAY; // 영업일
        
        if (week_day == Calendar.SUNDAY)
        {
            result = HOLIDAY;  // 휴일
        }
        else if (week_day == Calendar.SATURDAY)
        {
            result = HALF_HOLIDAY; // 반영업일
        }
        return result;
    }
 
 
 
 2, 해당 프로젝트 클래스매니져 (jex config - jex.프로젝트 아이디.xml) 에서 보시면 아래와 같이 클래스 매니저로 설정된 클래스를 열어서 아래 처럼 수정하여 주십시오.
 
jex config -> <classmanger class="클래스매니저명"/>
 
수정 부분
 
-----------------------------------
public class 클래스매니저 implements IJexBIZClassManager2, IJexDataChecker
{
   BusinessDateUtil bdate = null;
 
   public JexDefaultBIZClassManager()
   {
   }
 
 
    public BusinessDateUtil getBusinessDateUtil()
    {
    if (bdate == null)
    {
    bdate = new 구현 클래스명();
    }
    return bdate;
    }
 
}
3. 영업일 확인 예제
 
 
BusinessDateUtil bUtil = (JexSystem.getClassManager() != null)?JexSystem.getClassManager().getBusinessDateUtil():null;
if (bUtil!= null)
{
     if (bUtil.getBusinessDayType(date) != BusinessDateUtil.BUSINESS_DAY)  // data는 yyyymmdd String 
     {
         // 구현 
     }
}
 
 
 
 질문은 댓글로 달아주세요.
 
 
Reply all
Reply to author
Forward
0 new messages