@Override public List<ValueHint> generateValueHints(ConfigurationMetadataProperty property, ClassLoader classLoader) { return "java.lang.Boolean".equals(property.getType()) ? BOOLEANS : Collections.<ValueHint>emptyList(); }
@Override public List<ValueHint> generateValueHints(ConfigurationMetadataProperty property, ClassLoader classLoader) { return "java.lang.Boolean".equals(property.getType()) ? BOOLEANS : Collections.<ValueHint>emptyList(); }
private String niceType(ConfigurationMetadataProperty property) { String type = property.getType(); if (type == null) { return "<unknown>"; } int lastDot = type.lastIndexOf('.'); int lastDollar = type.lastIndexOf('$'); boolean hasGenerics = type.contains("<"); return hasGenerics ? type : type.substring(Math.max(lastDot, lastDollar) + 1); }
public CfgPropCompletionItem(ConfigurationMetadataProperty configurationMeta, SpringBootService bootService, int propStartOffset, int caretOffset, boolean sortDeprLast) { this.overwrite = false; this.configurationMeta = configurationMeta; if (configurationMeta.getType() != null) { type = simpleHtmlEscape(shortenJavaType(configurationMeta.getType())); } else { type = null; } this.bootService = bootService; this.propStartOffset = propStartOffset; this.caretOffset = caretOffset; this.sortDeprLast = sortDeprLast; }
@Override public List<ValueHint> generateValueHints(ConfigurationMetadataProperty property, ClassLoader classLoader) { List<ValueHint> result = new ArrayList<>(); if (ClassUtils.isPresent(property.getType(), classLoader)) { Class<?> clazz = ClassUtils.resolveClassName(property.getType(), classLoader); if (clazz.isEnum()) { for (Object o : clazz.getEnumConstants()) { ValueHint hint = new ValueHint(); hint.setValue(o); result.add(hint); } } } return result; }
private CharSequence maybeHints(ConfigurationMetadataProperty property, ClassLoader classLoader) { String type = property.getType().replace('$', '.'); if (ClassUtils.isPresent(type, classLoader)) { Class<?> clazz = ClassUtils.resolveClassName(type, classLoader); if (clazz.isEnum()) { return ", possible values: `" + StringUtils.arrayToDelimitedString(clazz.getEnumConstants(), "`,`") + "`"; } } return ""; }
@Override public List<ValueHint> generateValueHints(ConfigurationMetadataProperty property, ClassLoader classLoader) { List<ValueHint> result = new ArrayList<>(); if (ClassUtils.isPresent(property.getType(), classLoader)) { Class<?> clazz = ClassUtils.resolveClassName(property.getType(), classLoader); if (clazz.isEnum()) { for (Object o : clazz.getEnumConstants()) { ValueHint hint = new ValueHint(); hint.setValue(o); result.add(hint); } } } return result; }
sb.append("<tt>").append(simpleHtmlEscape(shortenJavaType(cfgMeta.getType()))).append("</tt>"); return sb.toString();
sb.append("<br/>").append(simpleHtmlEscape(configurationMeta.getType()));
final String type = entry.getValue().getType(); if (type != null) { final String key = entry.getKey();
if (cfgMeta != null) { try { final String type = cfgMeta.getType(); if (type.contains("<")) {
private void processNestedEnumProperties(final Set<ConfigurationMetadataProperty> properties, final Set<ConfigurationMetadataProperty> groups) { val propertiesToProcess = properties.stream() .filter(e -> { val matcher = NESTED_CLASS_PATTERN.matcher(e.getType()); return matcher.matches(); }) val matcher = NESTED_CLASS_PATTERN.matcher(e.getType()); matcher.matches();
final String dataType = configurationMeta.getType(); StringBuilder sb = new StringBuilder(getText()); if (dataType.contains("Map")) {
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); } }