@RequestMapping(method = RequestMethod.POST) public ResponseEntity<?> userLogout(@RequestBody final TextNode input) { System.out.println(input.asText()); return new ResponseEntity<>("OK", HttpStatus.OK); }
@Override public Icon deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { TreeNode jsonNode = p.getCodec().readTree(p); String cssClass = ((TextNode) jsonNode.get("cssClass")).asText(); return () -> cssClass; }
@Override public Icon deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { TreeNode jsonNode = p.getCodec().readTree(p); String cssClass = ((TextNode) jsonNode.get("cssClass")).asText(); return () -> cssClass; }
public static Matcher<JsonNode> jsonText(final TextNode value) { return jsonText(value.asText()); }
@Override public Icon deserialize(JsonParser p, DeserializationContext ctxt) throws IOException { TreeNode jsonNode = p.getCodec().readTree(p); String cssClass = ((TextNode) jsonNode.get("cssClass")).asText(); return () -> cssClass; }
public RefResponse refResponse(TextNode obj, String location, ParseResult result) { return new RefResponse(obj.asText()); }
@Override protected boolean matchesNode(TextNode node, Description mismatchDescription) { final String value = node.asText(); if (textMatcher.matches(value)) { return true; } else { mismatchDescription.appendText("was a text node with value that "); textMatcher.describeMismatch(value, mismatchDescription); return false; } }
@Override public MediaType deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException { TextNode node = jsonParser.getCodec().readTree(jsonParser); return MediaType.valueOf(node.asText()); } }
private List<String> toCommand(ArrayNode arrayCommandNode, DeserializationContext ctxt) throws JsonMappingException { List<String> commands = new ArrayList<>(); for (TreeNode treeNode : arrayCommandNode) { if (treeNode instanceof TextNode) { TextNode textNode = (TextNode) treeNode; commands.add(textNode.asText()); } else { throw ctxt.mappingException("Array 'command' contains not string element."); } } return commands; } }
private String value(TreeNode node) throws IOException, JsonParseException { TextNode value = (TextNode) node.get(QUOTA_ROOT_VALUE_FIELD); return value.asText(); }
public RefParameter refParameter(TextNode obj, String location, ParseResult result) { return new RefParameter(obj.asText()); }
public String getString(JsonNode node, String location, ParseResult result) { String output = null; if(!node.getNodeType().equals(JsonNodeType.STRING)) { result.invalidType(location, "", "string", node); } else { output = ((TextNode) node).asText(); } return output; }
/** * Parse command field from the compose yaml file to list command words. * * @param jsonParser json parser * @param ctxt deserialization context * @throws IOException in case I/O error. For example element to parsing contains invalid yaml * field type defined for this field by yaml document model. * @throws JsonProcessingException */ @Override public List<String> deserialize(JsonParser jsonParser, DeserializationContext ctxt) throws IOException { TreeNode tree = jsonParser.readValueAsTree(); if (tree.isArray()) { return toCommand((ArrayNode) tree, ctxt); } if (tree instanceof TextNode) { TextNode textNode = (TextNode) tree; return asList(textNode.asText().trim().split(SPLIT_COMMAND_REGEX)); } throw ctxt.mappingException( (format("Field '%s' must be simple text or string array.", jsonParser.getCurrentName()))); }
message = ((TextNode)json.get("message")).asText(); } catch (Exception e) {}
final String v = text.asText(""); return of(v);
final String v = text.asText(""); return of(v);