void addPropertiesProposals(String text, String startsWith, AppRegistration appRegistration, Set<String> alreadyPresentOptions, List<CompletionProposal> collector, int detailLevel){ Resource metadataResource = appRegistry.getAppMetadataResource(appRegistration); // For whitelisted properties, use their simple name if (metadataResource != null) { CompletionProposal.Factory proposals = CompletionProposal.expanding(text); for (ConfigurationMetadataProperty property : metadataResolver.listProperties(metadataResource)) { String name = property.getName(); if (!alreadyPresentOptions.contains(name) && name.startsWith(startsWith)) { collector.add(proposals .withSeparateTokens("--" + property.getName() + "=", property.getShortDescription())); } } // For other properties (including WL'ed in full form), use their id if (detailLevel > 1) { for (ConfigurationMetadataProperty property : metadataResolver.listProperties(metadataResource, true)) { String id = property.getId(); if (!alreadyPresentOptions.contains(id) && id.startsWith(startsWith)) { collector.add(proposals .withSeparateTokens("--" + property.getId() + "=", property.getShortDescription())); } } } } }
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); } }