|
|
|
@ -26,6 +26,8 @@ import java.util.stream.Collectors; |
|
|
|
import org.yaml.snakeyaml.Yaml; |
|
|
|
import org.yaml.snakeyaml.Yaml; |
|
|
|
import org.yaml.snakeyaml.constructor.Constructor; |
|
|
|
import org.yaml.snakeyaml.constructor.Constructor; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.springframework.util.Assert; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Thin wrapper to adapt Snake {@link Yaml} to {@link JsonParser}. |
|
|
|
* Thin wrapper to adapt Snake {@link Yaml} to {@link JsonParser}. |
|
|
|
* |
|
|
|
* |
|
|
|
@ -63,7 +65,9 @@ public class YamlJsonParser extends AbstractJsonParser { |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected Class<?> getClassForName(String name) throws ClassNotFoundException { |
|
|
|
protected Class<?> getClassForName(String name) throws ClassNotFoundException { |
|
|
|
return (SUPPORTED_TYPES.contains(name)) ? super.getClassForName(name) : null; |
|
|
|
Assert.state(SUPPORTED_TYPES.contains(name), |
|
|
|
|
|
|
|
() -> "Unsupported '" + name + "' type encountered in YAML document"); |
|
|
|
|
|
|
|
return super.getClassForName(name); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|