0
나는 간단한 YAML 문서가 있습니다. 예 :YAML 사용자 정의 개체
public class CustomObject {
private String value;
public CustomObject(String value) {
....
}
getValue ...
setValue ...
}
여기서 value는 속성 연결 결과 a, b, c가 마스크 (결과 1 : 2/3)의 결과입니까? 당신은 다음과 같이 사용할 수 있습니다
class CustomObjectConstructor extends Constructor {
public CustomObjectConstructor() {
this.yamlConstructors.put(new Tag("!customObject"), new ConstructCustomObject());
}
private class ConstructCustomObject extends AbstractConstruct {
public Object construct(Node node) {
final Map<Object, Object> values = constructMapping(node);
final String a = (String) values.get("a");
final String b = (String) values.get("b");
final String c = (String) values.get("c");
return new CustomObject(a + ":" + b + "/" + c);
}
}
}
: