use of com.github.dreamhead.moco.parser.model.FileContainer in project moco by dreamhead.
the class FileContainerDeserializer method deserialize.
@Override
public FileContainer deserialize(final JsonParser jp, final DeserializationContext ctxt) throws IOException {
JsonToken currentToken = jp.getCurrentToken();
if (currentToken == JsonToken.VALUE_STRING) {
return asFileContainer(helper.text(jp));
}
if (currentToken == JsonToken.START_OBJECT) {
jp.nextToken();
String target = jp.getText().trim();
if (isForFileContainer(target)) {
return toFileContainer(jp);
}
return asFileContainer(helper.textContainer(jp, ctxt));
}
return (FileContainer) ctxt.handleUnexpectedToken(FileContainer.class, jp);
}
Aggregations