kr.co.hit.live.web.mapper.element
Class Table

java.lang.Object
  extended by kr.co.hit.live.web.mapper.element.Table

public class Table
extends Object

Web Mapper 파일의 <Table> 엘리먼트 정보를 제공한다.

Since:
4.0
Author:
김형도

Field Summary
static String COLUMN_TYPE_BYTE
           
static String COLUMN_TYPE_CDATA
           
static String COLUMN_TYPE_CHAR
           
static String COLUMN_TYPE_DATE
           
static String COLUMN_TYPE_DEFAULT
           
static String COLUMN_TYPE_DOUBLE
           
static String COLUMN_TYPE_FLOAT
           
static String COLUMN_TYPE_INT
           
static String COLUMN_TYPE_LONG
           
static String COLUMN_TYPE_NUMBER
           
static String COLUMN_TYPE_STRING
           
 
Constructor Summary
Table(String id, int countValue, int minCount, List<String> type, String repeatRefs)
           
Table(String id, int cntval, String cntref, int mincnt, List<String> type, String repeatRefs, List<Column> cols)
           
Table(String id, String cntref, int mincnt, List<String> type, String repeatRefs)
           
 
Method Summary
 void addColumn(Column col)
          Column 객체를 추가하면서 Column 객체의 type 속성에 해당되는 TypeCaster를 지정한다.
 void addType(String type)
          테이블의 타입 속성을 하나 추가한다.
 void buildFormat(Map<String,Format> formatMap)
          <table> 내에 정의된 <column>들의 format 속성에 해당되는 Format 객체들을 생성하여 format 문자열을 키로하여 주어진 formatMap에 담아놓는다.
static boolean checkRepeatRef(String source)
          source 문자열 내에 ${repeat_ref} 패턴이 존재하는지 여부를 반환한다.
 int columnCount()
          Table 내에 정의된 Column 수를 반환한다.
 Collection<Table> getAllReplacedTables(Collection<String> refs)
          repeat_ref 대상 목록을 파라메터로 전달하면 Table 내의 ${repeat_ref}를 각 대상 이름으로 치환된 Table 객체들의 집합을 리턴한다.
 Column getColumn(int idx)
           
 List<Column> getColumns()
           
 String getCountRef()
           
 int getCountValue()
           
 String getId()
          테이블 ID 문자열을 그대로 리턴한다.
 String getId(String repeatRef)
          테이블 id 문자열에 ${repeat_ref} 패턴을 주어진 실제 repeatRef 문자로 대치하여 리턴한다.
 List<String> getIds()
          테이블 ID로 주어진 문자열을 "/" split하여 List로 리턴한다.
 String getLastId()
          테이블 ID로 주어진 문자열을 "/"로 split하였을 때 마지막 ID를 리턴한다.
 ColumnTypeCaster getTypeCaster()
          테이블의 ColumnTypeCaster 객체를 반환한다.
 boolean hasTypeOf(String type)
          테이블의 속성들 중에서 주어진 type을 가지고 있는지 여부를 반환한다.
 int makeCountValue(RequestDataMap reqMap)
          주어진 RequestData의 row 수를 사용하여 count value 값을 계산한다.
 int makeCountValue(ValueObjectAssembler voa)
          주어진 ValueObjectAssembler의 해당 VO의 row 수를 사용하여 count value 값을 계산한다.
 List<Column> replaceColumns(String repeatRef)
          Table 내의 Column들을 파싱하여 리스트 객체에 담아리턴한다.
static String replaceRepeatRef(String source, String repeatRef)
          source문자열 내의 ${repeat_ref} 패턴을 주어진 repeatRef 문자로 대치하여 리턴한다.
 Table replaceTable(String repeatRef)
          ${repeat_ref}를 주어진 repeatRef로 치환된 Table 객체를 생성하여 리턴한다.
 Collection<String> selectRepeatRefs(Collection<String> allRefs)
          참조 가능한 ref 이름들의 집합에서 실제로 repeat_ref 속성값으로 지정된 패턴에 해당되는 ref 이름들을 리턴한다.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COLUMN_TYPE_NUMBER

public static final String COLUMN_TYPE_NUMBER
See Also:
Constant Field Values

COLUMN_TYPE_INT

public static final String COLUMN_TYPE_INT
See Also:
Constant Field Values

COLUMN_TYPE_LONG

public static final String COLUMN_TYPE_LONG
See Also:
Constant Field Values

COLUMN_TYPE_DOUBLE

public static final String COLUMN_TYPE_DOUBLE
See Also:
Constant Field Values

COLUMN_TYPE_FLOAT

public static final String COLUMN_TYPE_FLOAT
See Also:
Constant Field Values

COLUMN_TYPE_STRING

public static final String COLUMN_TYPE_STRING
See Also:
Constant Field Values

COLUMN_TYPE_BYTE

public static final String COLUMN_TYPE_BYTE
See Also:
Constant Field Values

COLUMN_TYPE_CHAR

public static final String COLUMN_TYPE_CHAR
See Also:
Constant Field Values

COLUMN_TYPE_CDATA

public static final String COLUMN_TYPE_CDATA
See Also:
Constant Field Values

COLUMN_TYPE_DATE

public static final String COLUMN_TYPE_DATE
See Also:
Constant Field Values

COLUMN_TYPE_DEFAULT

public static final String COLUMN_TYPE_DEFAULT
See Also:
Constant Field Values
Constructor Detail

Table

public Table(String id,
             String cntref,
             int mincnt,
             List<String> type,
             String repeatRefs)

Table

public Table(String id,
             int countValue,
             int minCount,
             List<String> type,
             String repeatRefs)

Table

public Table(String id,
             int cntval,
             String cntref,
             int mincnt,
             List<String> type,
             String repeatRefs,
             List<Column> cols)
Method Detail

addType

public void addType(String type)
테이블의 타입 속성을 하나 추가한다.

Parameters:
type -

toString

public String toString()
Overrides:
toString in class Object

getCountValue

public int getCountValue()

getCountRef

public String getCountRef()

getAllReplacedTables

public Collection<Table> getAllReplacedTables(Collection<String> refs)
repeat_ref 대상 목록을 파라메터로 전달하면 Table 내의 ${repeat_ref}를 각 대상 이름으로 치환된 Table 객체들의 집합을 리턴한다. 또한 각 Table 객체들의 count 값도 주어진 voa에서 참조하는 VO의 실제 row 수를 사용하여 countValue로 설정되어진다.

Parameters:
voa -
Returns:

replaceTable

public Table replaceTable(String repeatRef)
${repeat_ref}를 주어진 repeatRef로 치환된 Table 객체를 생성하여 리턴한다. replaceFlag 가 false이면 치환작업이 필요없으므로 자기 자신을 그대로 반환한다.

Parameters:
repeatRef -
voa -
Returns:

makeCountValue

public int makeCountValue(ValueObjectAssembler voa)
주어진 ValueObjectAssembler의 해당 VO의 row 수를 사용하여 count value 값을 계산한다.

Parameters:
voa -
Returns:

makeCountValue

public int makeCountValue(RequestDataMap reqMap)
주어진 RequestData의 row 수를 사용하여 count value 값을 계산한다.

Parameters:
voa -
Returns:

selectRepeatRefs

public Collection<String> selectRepeatRefs(Collection<String> allRefs)
참조 가능한 ref 이름들의 집합에서 실제로 repeat_ref 속성값으로 지정된 패턴에 해당되는 ref 이름들을 리턴한다.

Parameters:
allRefs - 참조 가능한 모든 ref 들
Returns:
repeat_ref 속성값으로 지정된 패턴에 매치되는 ref 집합

getId

public String getId()
테이블 ID 문자열을 그대로 리턴한다.

Returns:

getIds

public List<String> getIds()
테이블 ID로 주어진 문자열을 "/" split하여 List로 리턴한다.

Returns:

getLastId

public String getLastId()
테이블 ID로 주어진 문자열을 "/"로 split하였을 때 마지막 ID를 리턴한다.

Returns:

getId

public String getId(String repeatRef)
테이블 id 문자열에 ${repeat_ref} 패턴을 주어진 실제 repeatRef 문자로 대치하여 리턴한다.

Parameters:
repeatRef - ${repreat_ref}를 치환할 문자
Returns:
${repeat_ref}가 모두 치환된 테이블 ID

hasTypeOf

public boolean hasTypeOf(String type)
테이블의 속성들 중에서 주어진 type을 가지고 있는지 여부를 반환한다.

Parameters:
type -
Returns:

getTypeCaster

public ColumnTypeCaster getTypeCaster()
테이블의 ColumnTypeCaster 객체를 반환한다. 이 객체는 테이블이 가지고 있는 type 속성들 중에서 컬럼 타입 속성 값과 매치되는 첫번째 type 속성값을 사용하여 생성한다.

Returns:

getColumn

public Column getColumn(int idx)

getColumns

public List<Column> getColumns()

replaceColumns

public List<Column> replaceColumns(String repeatRef)
Table 내의 Column들을 파싱하여 리스트 객체에 담아리턴한다. Column을 파싱하는 작업은 Column내의 id, ref1, ref2, value 등의 속성값에서 ${repeat_ref}로 표현된 부분을 실제 repeatRef 값으로 치환하는 작업이다.

Parameters:
table -
repeatRef -
Returns:

columnCount

public int columnCount()
Table 내에 정의된 Column 수를 반환한다.

Returns:

addColumn

public void addColumn(Column col)
Column 객체를 추가하면서 Column 객체의 type 속성에 해당되는 TypeCaster를 지정한다.

Parameters:
col -

buildFormat

public void buildFormat(Map<String,Format> formatMap)
<table> 내에 정의된 <column>들의 format 속성에 해당되는 Format 객체들을 생성하여 format 문자열을 키로하여 주어진 formatMap에 담아놓는다.

Parameters:
formatMap -

replaceRepeatRef

public static String replaceRepeatRef(String source,
                                      String repeatRef)
source문자열 내의 ${repeat_ref} 패턴을 주어진 repeatRef 문자로 대치하여 리턴한다.

Parameters:
source - 치환대상 문자열
repeatRef - ${repreat_ref}를 치환할 문자
Returns:
${repeat_ref}가 모두 치환된 결과

checkRepeatRef

public static boolean checkRepeatRef(String source)
source 문자열 내에 ${repeat_ref} 패턴이 존재하는지 여부를 반환한다.

Parameters:
source -
Returns:


Copyright © 2014. All Rights Reserved.