private String niceDefault(ConfigurationMetadataProperty property) { if (property.getDefaultValue() == null) { return "<none>"; } else if ("".equals(property.getDefaultValue())) { return "<empty string>"; } else { return stringify(property.getDefaultValue()); } }
/** * Escapes some special values so that they don't disturb console rendering and are easier * to read. * * @param o the configurationMetadataProperty to pretty print * @return the pretty printed value */ protected String prettyPrintDefaultValue(ConfigurationMetadataProperty o) { if (o.getDefaultValue() == null) { return "<none>"; } return o.getDefaultValue().toString().replace("\n", "\\n").replace("\t", "\\t").replace("\f", "\\f"); }
/** * Escapes some special values so that they don't disturb console rendering and are easier * to read. * * @param o the configurationMetadataProperty to pretty print * @return the pretty printed value */ protected String prettyPrintDefaultValue(ConfigurationMetadataProperty o) { if (o.getDefaultValue() == null) { return "<none>"; } return o.getDefaultValue().toString().replace("\n", "\\n").replace("\t", "\\t").replace("\f", "\\f"); }
final Object defaultValue = configurationMeta.getDefaultValue(); if (null != defaultValue) { sb.append("<br/><br/><i>Default:</i> ");
public ConfigurationMetadataSearchResult(final ConfigurationMetadataProperty prop, final CasConfigurationMetadataRepository repository) { try { setDefaultValue(prop.getDefaultValue()); setDeprecation(prop.getDeprecation()); setDescription(cleanUpDescription(prop.getDescription())); setShortDescription(cleanUpDescription(prop.getShortDescription())); setId(prop.getId()); setName(prop.getName()); setType(prop.getType()); setGroup(CasConfigurationMetadataRepository.getPropertyGroupId(prop)); setOrder(CasConfigurationMetadataRepository.isCasProperty(prop) ? Ordered.HIGHEST_PRECEDENCE : Ordered.LOWEST_PRECEDENCE); val valueHints = prop.getHints().getValueHints(); valueHints.forEach(hint -> { val values = CollectionUtils.toCollection(hint.getValue()); if (values.contains(RequiresModule.class.getName())) { setRequiredModule(hint.getDescription()); setRequiredModuleAutomated(values.contains(Boolean.TRUE)); } if (values.contains(RequiredProperty.class.getName())) { setRequiredProperty(true); } }); } catch (final Exception e) { LOGGER.error(e.getMessage(), e); } }