Returns a String where references to DataObject values are replaced with actual values.
E.g. reference ${Firstname} will be replaced with property 'Firstname' value.
@param format
@return
770838
public String format(String format)
    {
        Matcher m = REF.matcher(format);
        StringBuffer sb = new StringBuffer();
        while (m.find())
        {
            Object ob = get(m.group(1));
            if (ob != null)
            {
                m.appendReplacement(sb, ob.toString());
            }
            else
            {
                m.appendReplacement(sb, m.group());
            }
        }
        m.appendTail(sb);
        return sb.toString();
    }
948290
public static boolean isSupportedFormat(String format) {
	for (int i=0;i<MSExcelWriter.VALID_FORMAT.length;i++) {
		if (VALID_FORMAT[i].equals(format)) {
			return true;
		}
	}
return false;
}
826092
public Optional<ConversionConfig> getConversionConfigForFormat(String format) {
    return Optional.fromNullable(this.destConversionConfigs.get(format));
  }
609456
public static String getIndexedFormat(int index, String format) {
		if (index < 1)
			throw new IllegalArgumentException();
		if (format == null)
			throw new NullPointerException();
		if (format.length() == 0)
			throw new IllegalArgumentException();
		return String.format(INDEXED_FORMAT, index, format);
	}
1308369
public final String formatFinish(Format format) {
        if (format != null) {
            Long minFinish = interval.getMinFinish();
            if (minFinish != null) {
                return format.format(minFinish);
            } else {
                return null;
            }
        } else {
            Long minFinish = interval.getMinFinish();
            if (minFinish != null) {
                return numberFormat.get().format(minFinish);
            } else {
                return null;
            }
        }
    }
1337226
function (source, data) {
                return source.replace(/\$\{([\w.]+)\}/g, function ($0, $1) {
                    var ref = $1.split('.');
                    var refObject = data;
                    var level;

                    while (refObject != null && (level = ref.shift())) {
                        refObject = refObject[level];
                    }

                    return refObject != null ?  refObject : '';
                });
            }
647263
private static String formatDate(Object dateObj, String format) {
		if (StrUtil.isNotBlank(format)) {
			final Date date = (dateObj instanceof Date) ? (Date)dateObj : ((Calendar)dateObj).getTime();
			//用户定义了日期格式
			return DateUtil.format(date, format);
		}
		
		//默认使用时间戳
		return String.valueOf((dateObj instanceof Date) ? ((Date)dateObj).getTime() : ((Calendar)dateObj).getTimeInMillis());
	}
130857
public static SimpleDateFormat newDateFormat(String format) {
		SimpleDateFormat sdf = new SimpleDateFormat(format, Locale.ROOT);
		sdf.setLenient(false);
		return sdf;
	}
631034
public static String generateStringExample(String format, List<String> enumValues) {
        if (enumValues == null || enumValues.isEmpty()) {
            if (format == null) {
                return "string";
            } else {
                switch (format) {
                    case "byte":
                        return "Ynl0ZQ==";
                    case "date":
                        return "1970-01-01";
                    case "date-time":
                        return "1970-01-01T00:00:00Z";
                    case "email":
                        return "email@example.com";
                    case "password":
                        return "secret";
                    case "uuid":
                        return "f81d4fae-7dec-11d0-a765-00a0c91e6bf6";
                    default:
                        return "string";
                }
            }
        } else {
            return enumValues.get(0);
        }
    }
1149927
public static String format(final Date date, final String format) {
		return format(date.getTime(), format);
	}
451898
public static String convert2String(long time, String format) {
        if (time > 0l) {
            if (StringUtil.isEmpty(format))
                format = dateTimeFormat;
            SimpleDateFormat sf = new SimpleDateFormat(format);
            Date date = new Date(time);
            return sf.format(date);
        }
        return "";
    }
846253
@MapMethod
    public String formatDate(Date d, String format){
        return Objects.formatDate(d, format);
    }
219578
private String formatDefaultValue(Object value) {
    if (value instanceof Boolean) {
      return ((Boolean) value) ? "true" : "false";
    }

    if (value instanceof Number) {
      return value.toString();
    }

    if (value instanceof Collection) {
      return formatCollectionValue((Collection) value);
    }

    String string = value.toString();

    if (string.startsWith("$")) {
      return string;
    }

    return SassString.escape(string);
  }
978304
public static Date fromString(String source, String format) {
        try {
            ObjectPool<DateFormat> pool = cachedDateFormat.get(format);
            try {
                DateFormat df = pool.borrowObject();
                try {
                    return df.parse(source);
                } finally {
                    pool.returnObject(df);
                }
            } catch (Exception e) {
                throw e instanceof RuntimeException ? (RuntimeException) e
                        : new RuntimeException(e);
            }
        } catch (ExecutionException e) {
            throw new RuntimeException(e);
        }
    }
1141854
public static String dateToStr(Date date, String format) {
        return new SimpleDateFormat(format).format(date);
    }
1182259
public Date getDate(String name, String format) {
        Object value = get(name);
        if (value instanceof Date) {
            return (Date)value;
        }
        
        if (value != null) {
            try {
                return new SimpleDateFormat(format).parse(value.toString());
            } catch (ParseException e) {
                // ignore
            }
        }
        return null;
    }
1177143
@MapMethod
    public Date parseDate(String d, String format){
        return Objects.parseDate(d,format);
    }