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

java.lang.Object
  extended by kr.co.hit.live.web.mapper.element.Entity
Direct Known Subclasses:
Attribute, Column, Value

public abstract class Entity
extends Object

Web Mapper 파일의 Column, Attribute, Value의 공통 속성을 나타내는 클래스이다.

Since:
4.0
Author:
김형도

Field Summary
protected  String defValue
           
protected  String description
           
protected  boolean hasCountPattern
          ${count} 패턴의 존재여부 플래그이다.
protected  boolean hasRepeatRefPattern
          ${repeat_ref} 패턴의 존재여부 플래그이다.
protected  boolean hasValuePattern
          ${value} 패턴의 존재여부 플래그이다.
protected  String name
           
protected static Pattern patternCount
          예약어 ${count}의 패턴객체이다.
protected static Pattern patternValue
          예약어 ${value}의 패턴객체이다.
protected  String ref1
           
protected  String ref2
           
protected  String value
           
 
Constructor Summary
Entity(String nm, String ref, String val, String desc)
          생성자이다.
Entity(String nm, String r1, String r2, String val, String desc)
          생성자이다.
 
Method Summary
 String getDescription()
          desc 속성값을 반환한다.
 String getName()
          치환되지 않는 name 값 그대로를 반환한다.
 String getName(int idx, Map<String,Object> map)
          name에 있는 ${value}와 ${count} 예약어를 치환한 후 그 결과를 최종 name으로 반환한다.
 String getName(int idx, ValueObjectAssembler voa)
          name에 있는 ${value}와 ${count} 예약어를 치환한 후 그 결과를 최종 name으로 반환한다.
protected  Object getOutputValue(int idx, Map<String,Object> map, StringBuilder sb)
          <output> 매핑에서 Map의 내용을 출력하기 위하여 사용되는 기능이다.
protected  Object getOutputValue(int idx, ValueObjectAssembler voa, StringBuilder sb)
          <output> 매핑에서 ValueObjectAssembler의 내용을 출력하기 위하여 사용되는 기능이다.
 String getRef()
           
 String getValueDef()
           
 boolean hasRepeatRef()
          ${repeat_ref} 존재여부를 반환한다.
protected  boolean isEmpty(Object source)
          source 가 null 이거나 또는 String 객체이고 "" 이면 true를 리턴한다.
 void markRepeatRef()
          ${repeat_ref}가 존재하는 것으로 마킹한다.
 String replaceName(Object value, int count)
          name에서 ${value}와 ${count} 예약어를 주어진 값으로 치환후 반환한다.
abstract  Entity replaceRepeatRef(String repeatRef)
          Entity의 name, ref1, ref2, value 내에 존재하는 ${repeat_ref} 문자를 repeatRef로 치환하여 Entity 객체를 생성하여 반환한다.
protected  String replaceValue(int count)
          value에서 ${count} 예약어를 실제 값으로 치환후 반환한다.
 void setDefaultValue(String def)
          default 속성 값을 설정한다.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

patternValue

protected static final Pattern patternValue
예약어 ${value}의 패턴객체이다.


patternCount

protected static final Pattern patternCount
예약어 ${count}의 패턴객체이다.


name

protected String name

ref1

protected String ref1

ref2

protected String ref2

value

protected String value

defValue

protected String defValue

description

protected String description

hasValuePattern

protected boolean hasValuePattern
${value} 패턴의 존재여부 플래그이다.


hasCountPattern

protected boolean hasCountPattern
${count} 패턴의 존재여부 플래그이다.


hasRepeatRefPattern

protected boolean hasRepeatRefPattern
${repeat_ref} 패턴의 존재여부 플래그이다.

Constructor Detail

Entity

public Entity(String nm,
              String ref,
              String val,
              String desc)
생성자이다. MapParser에서 parsing 중에 사용된다.

Parameters:
nm - Entity 이름
ref -
val -
desc -

Entity

public Entity(String nm,
              String r1,
              String r2,
              String val,
              String desc)
생성자이다. 동적확장시 패턴문자들이 실제 문자로 치환되어 객체가 생성될 때 사용된다.

Parameters:
nm -
r1 -
r2 -
val -
desc -
Method Detail

getName

public String getName()
치환되지 않는 name 값 그대로를 반환한다.

Returns:

getRef

public String getRef()

getValueDef

public String getValueDef()

replaceName

public String replaceName(Object value,
                          int count)
name에서 ${value}와 ${count} 예약어를 주어진 값으로 치환후 반환한다.

Parameters:
value -
count -
Returns:

getName

public String getName(int idx,
                      ValueObjectAssembler voa)
name에 있는 ${value}와 ${count} 예약어를 치환한 후 그 결과를 최종 name으로 반환한다. 주어진 voa에서 ${value}를 치환할 출력 대상 값을 찾고, 주어진 idx 값을 사용하여 ${count}를 치환한다.

Parameters:
idx -
voa -
count -
Returns:

getName

public String getName(int idx,
                      Map<String,Object> map)
name에 있는 ${value}와 ${count} 예약어를 치환한 후 그 결과를 최종 name으로 반환한다. 주어진 map에서 ${valuu}를 치환할 출력 대상 값을 찾고, 주어진 idx 값을 사용하여 ${count}를 치환한다.

Parameters:
idx -
voa -
count -
Returns:

getDescription

public String getDescription()
desc 속성값을 반환한다.

Returns:

setDefaultValue

public void setDefaultValue(String def)
default 속성 값을 설정한다.

Parameters:
def -

replaceRepeatRef

public abstract Entity replaceRepeatRef(String repeatRef)
Entity의 name, ref1, ref2, value 내에 존재하는 ${repeat_ref} 문자를 repeatRef로 치환하여 Entity 객체를 생성하여 반환한다.

Parameters:
repeatRef -
Returns:
Entity

hasRepeatRef

public boolean hasRepeatRef()
${repeat_ref} 존재여부를 반환한다.

Returns:

markRepeatRef

public void markRepeatRef()
${repeat_ref}가 존재하는 것으로 마킹한다.


getOutputValue

protected Object getOutputValue(int idx,
                                ValueObjectAssembler voa,
                                StringBuilder sb)
<output> 매핑에서 ValueObjectAssembler의 내용을 출력하기 위하여 사용되는 기능이다. ValueObjectAssembler에서 값을 찾아서 리턴한다. idx가 범위를 벗어났거나 참조되는 ValueObjectAssembler에 값이 존재하지 않거나 "" 문자열인 경우에는 default로 설정된 값을 사용한다.

Parameters:
idx -
voa -
sb - 디폴트 값을 사용한 컬럼의 경우 그 명칭을 담아서 로그로 출력하기 위하여 사용한다.

getOutputValue

protected Object getOutputValue(int idx,
                                Map<String,Object> map,
                                StringBuilder sb)
<output> 매핑에서 Map의 내용을 출력하기 위하여 사용되는 기능이다. Map에서 값을 찾아서 리턴한다. idx가 범위를 벗어났거나 참조되는 Map에 값이 존재하지 않거나 "" 문자열인 경우에는 default로 설정된 값을 사용한다.

Parameters:
idx -
voa -
sb - 디폴트 값을 사용한 컬럼의 경우 그 명칭을 담아서 로그로 출력하기 위하여 사용한다.

replaceValue

protected String replaceValue(int count)
value에서 ${count} 예약어를 실제 값으로 치환후 반환한다.

Parameters:
count -
Returns:

isEmpty

protected boolean isEmpty(Object source)
source 가 null 이거나 또는 String 객체이고 "" 이면 true를 리턴한다. source 가 String이 아닌 다른 타입의 객체라면 false를 리턴한다.

Parameters:
source -
Returns:


Copyright © 2014. All Rights Reserved.