コード例 #1
0
 @Override
 public void setValue(Console console) {
   String value = console.readLine("%s", getPrompt().getText()); // $NON-NLS-1$
   if ((value != null) && !StringUtils.EMPTY.equals(value)) {
     getHolder().setValue(value);
   }
 }
コード例 #2
0
 @Override
 public Date deserialize(JsonParser jsonParser, DeserializationContext deserializationContext)
     throws IOException, JsonProcessingException {
   String dateFormat = "yyyy-MM-dd";
   dateFormat =
       PropertiesUtil.getPropertyValue(WalkthroughPropertiesKeyConstants.WALKTHROUGH_DATE_FORMAT);
   SimpleDateFormat simpleDateFormat = new SimpleDateFormat(dateFormat);
   String content = jsonParser.getText();
   Date date = null;
   if (content != null && !StringUtils.EMPTY.equals(content)) {
     try {
       date = simpleDateFormat.parse(content);
     } catch (ParseException e) {
       e.printStackTrace();
       throw new RuntimeException(e);
     }
   }
   return date;
 }