kr.co.hit.live.web.mapper.output.impl
Class TrustFormDelimeterResponseWriter

java.lang.Object
  extended by kr.co.hit.live.web.mapper.output.impl.AbstractResponseWriter
      extended by kr.co.hit.live.web.mapper.output.impl.DelimeterResponseWriter
          extended by kr.co.hit.live.web.mapper.output.impl.TrustFormDelimeterResponseWriter
All Implemented Interfaces:
ResponseWriter

public class TrustFormDelimeterResponseWriter
extends DelimeterResponseWriter

TrustForm 4.0 의 LightGrid 방식이 요구하는 형태의 Delimeter로 데이터를 뿌려주는 ResponseWriter 구현 클래스

Since:
4.0
Author:
kimhd

Field Summary
protected static String COL_SEPERATOR
           
protected static String DELIMETER_STRING
           
protected static String ROW_SEPERATOR
           
 
Fields inherited from class kr.co.hit.live.web.mapper.output.impl.DelimeterResponseWriter
DEFAULT_ENCODING, HEADER_DESC_TYPE, HEADER_TYPE
 
Fields inherited from class kr.co.hit.live.web.mapper.output.impl.AbstractResponseWriter
DEFAULT_CLIENT_MESSAGE_KEY, LINE_SEPARATOR
 
Constructor Summary
TrustFormDelimeterResponseWriter(Output output)
           
 
Method Summary
protected  String escapeDelimeter(String data)
          delimeter 문자들을 \ 로 escaping 처리한다.
protected  void writeException(Throwable tr, javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          오류를 출력한다.
protected  void writeMessage(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          메시지를 출력한다.
protected  void writeRow(List<Column> columns, ValueObjectAssembler voa, Writer out, int idx, String rowSep, String colSep, Map<String,Format> formatMap, StringBuilder sb)
          주어진 Column 리스트에 정의된 매핑 내용대로 idx 번째 열을 delimiter로 구분하여 출력한다.
protected  void writeRow(String[] columnNames, ValueObject writeVO, Writer out, int idx, String rowSep, String colSep, ColumnTypeCaster tc)
          동적 컬럼 확장에서 사용하는 출력 메소드이다.
protected  void writeRowHeader(List<Column> columns, Writer out, int rowCount, String rowSep, String colSep, boolean noheader)
          주어진 Column 리스트에 정의된 내용대로 TrustForm의 LightGrid 방식에 맞도록 헤더를 출력한다.
protected  void writeRowHeader(String[] columnNames, Writer out, int rowCount, String rowSep, String colSep, boolean noheader)
          동적 컬럼 확장에서 사용된다.
 
Methods inherited from class kr.co.hit.live.web.mapper.output.impl.DelimeterResponseWriter
getForwardPath, writeBody, writeHead, writeReplacedTable, writeRowHeader, writeTable, writeTail
 
Methods inherited from class kr.co.hit.live.web.mapper.output.impl.AbstractResponseWriter
getOutput, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DELIMETER_STRING

protected static final String DELIMETER_STRING
See Also:
Constant Field Values

ROW_SEPERATOR

protected static final String ROW_SEPERATOR
See Also:
Constant Field Values

COL_SEPERATOR

protected static final String COL_SEPERATOR
See Also:
Constant Field Values
Constructor Detail

TrustFormDelimeterResponseWriter

public TrustFormDelimeterResponseWriter(Output output)
Method Detail

writeException

protected void writeException(Throwable tr,
                              javax.servlet.http.HttpServletRequest req,
                              javax.servlet.http.HttpServletResponse res)
                       throws IOException
오류를 출력한다.

Overrides:
writeException in class DelimeterResponseWriter
Throws:
IOException

writeMessage

protected void writeMessage(javax.servlet.http.HttpServletRequest req,
                            javax.servlet.http.HttpServletResponse res)
                     throws IOException
메시지를 출력한다.

Overrides:
writeMessage in class DelimeterResponseWriter
Throws:
IOException

writeRowHeader

protected void writeRowHeader(List<Column> columns,
                              Writer out,
                              int rowCount,
                              String rowSep,
                              String colSep,
                              boolean noheader)
                       throws IOException
주어진 Column 리스트에 정의된 내용대로 TrustForm의 LightGrid 방식에 맞도록 헤더를 출력한다.

Parameters:
columns - 출력할 Column 들의 리스트
out - 출력할 PrintWriter
rowSep - 열 구분자, 무시되며 항상 "|" 가 사용된다.
colSep - 행 구분자, 무시되며 항상 "^" 가 사용된다.
noheader - 사용되지 않는다.
Throws:
IOException

writeRowHeader

protected void writeRowHeader(String[] columnNames,
                              Writer out,
                              int rowCount,
                              String rowSep,
                              String colSep,
                              boolean noheader)
                       throws IOException
동적 컬럼 확장에서 사용된다. 주어진 Column 명 배열의 내용대로 TrustForm의 LightGrid 방식에 맞도록 헤더를 출력한다.

Overrides:
writeRowHeader in class DelimeterResponseWriter
Parameters:
columns - 출력할 Column 들의 리스트
out - 출력할 PrintWriter
rowSep - 열 구분자, 무시되며 "|" 가 사용된다.
colSep - 행 구분자, 무시되며 "^" 가 사용된다.
noheader - 사용되지 않는다.
Throws:
IOException

writeRow

protected void writeRow(List<Column> columns,
                        ValueObjectAssembler voa,
                        Writer out,
                        int idx,
                        String rowSep,
                        String colSep,
                        Map<String,Format> formatMap,
                        StringBuilder sb)
                 throws IOException
주어진 Column 리스트에 정의된 매핑 내용대로 idx 번째 열을 delimiter로 구분하여 출력한다. TrustForm의 LightGrid에서 사용하는 ^와 | 를 각각 행과 열 구분자로 사용한다.

Overrides:
writeRow in class DelimeterResponseWriter
Parameters:
columns - 출력할 Column 들의 리스트
voa - 출력할 값이 있는 ValueObjectAssemlber
out - 출력할 PrintWriter
idx - 출력할 열의 인덱스
rowSep - 열 구분자
colSep - 행 구분자
formatMap - format될 컬럼에서 사용할 format 객체들
sb - 디폴트 값을 사용한 컬럼명을 담아오기 위한 StringBuffer
Throws:
IOException

writeRow

protected void writeRow(String[] columnNames,
                        ValueObject writeVO,
                        Writer out,
                        int idx,
                        String rowSep,
                        String colSep,
                        ColumnTypeCaster tc)
                 throws IOException
동적 컬럼 확장에서 사용하는 출력 메소드이다. 출력 대상 ValueObject와 출력 컬럼 목록을 받아서 이를 delimeter 방식으로 출력한다.

Overrides:
writeRow in class DelimeterResponseWriter
Parameters:
columnNames - 출력 대상 컬럼
writeVO - 출력할 값이 있는 ValueObject
out - 출력할 PrintWriter
idx - 출력할 열의 인덱스
rowSep - 열 구분자, 무시되며 항상 "|" 가 사용된다.
colSep - 행 구분자, 무시되며 항상 "^" 가 사용된다.
tc - 타입 변환을 위한 ColumnTypeCaster이다. 전체 컬럼이 동일하게 적용된다.
Throws:
IOException

escapeDelimeter

protected String escapeDelimeter(String data)
delimeter 문자들을 \ 로 escaping 처리한다.

Overrides:
escapeDelimeter in class DelimeterResponseWriter
Parameters:
data -
Delimeters -
Returns:


Copyright © 2014. All Rights Reserved.