|
|
@ -2,6 +2,7 @@ package cokr.xit.foundation.data;
|
|
|
|
|
|
|
|
|
|
|
|
import java.io.InputStream;
|
|
|
|
import java.io.InputStream;
|
|
|
|
import java.util.Set;
|
|
|
|
import java.util.Set;
|
|
|
|
|
|
|
|
import java.util.function.UnaryOperator;
|
|
|
|
|
|
|
|
|
|
|
|
import com.fasterxml.jackson.core.JsonParser.Feature;
|
|
|
|
import com.fasterxml.jackson.core.JsonParser.Feature;
|
|
|
|
import com.fasterxml.jackson.core.type.TypeReference;
|
|
|
|
import com.fasterxml.jackson.core.type.TypeReference;
|
|
|
@ -205,15 +206,26 @@ public class JSON extends AbstractComponent {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**대문자 이름으로 된 프로퍼티를 읽고 쓸 때 사용
|
|
|
|
/**프로퍼티 이름 커스터마이져
|
|
|
|
* @author mjkhan
|
|
|
|
* @author mjkhan
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public static class PropertiesInUpperCase extends PropertyNamingStrategy.PropertyNamingStrategyBase {
|
|
|
|
public static class CustomPropertyNames extends PropertyNamingStrategy.PropertyNamingStrategyBase {
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private UnaryOperator<String> customizer;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**프로퍼티 이름을 반환하는 커스터마이져를 설정한다.
|
|
|
|
|
|
|
|
* @param customizer 프로퍼티 이름을 반환하는 커스터마이져
|
|
|
|
|
|
|
|
* @return 현재 CustomPropertyNames
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
public CustomPropertyNames customize(UnaryOperator<String> customizer) {
|
|
|
|
|
|
|
|
this.customizer = customizer;
|
|
|
|
|
|
|
|
return this;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public String translate(String propertyName) {
|
|
|
|
public String translate(String propertyName) {
|
|
|
|
return propertyName.toUpperCase();
|
|
|
|
return customizer != null ? customizer.apply(propertyName) : propertyName;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|