private ConfigDescription resolve(URI configDescriptionURI, Locale locale) { if (configDescriptionURI == null) { return null; } return configDescriptionRegistry != null ? configDescriptionRegistry.getConfigDescription(configDescriptionURI, locale) : null; }
/** * Returns all config descriptions. * * @return all config descriptions or an empty collection if no config * description exists */ public Collection<ConfigDescription> getConfigDescriptions() { return getConfigDescriptions(null); }
/** * This method is used for setting the configuration of the {@link ModuleImpl}. * * @param configuration new configuration values. */ public void setConfiguration(Configuration configuration) { this.configuration = new Configuration(configuration); } }
/** * Returns the path to the root of the transformation folder */ protected String getSourcePath() { return ConfigConstants.getConfigFolder() + File.separator + TransformationService.TRANSFORM_FOLDER_NAME + File.separator; }
private List<ConfigDescriptionParameter> getConfigDescParams(ThingType thingType) { if (thingType != null && thingType.getConfigDescriptionURI() != null) { URI descURI = thingType.getConfigDescriptionURI(); ConfigDescription desc = configDescRegistry.getConfigDescription(descURI); if (desc != null) { return desc.getParameters(); } } return Collections.emptyList(); }
public ZigBeeNetworkStateSerializerImpl(String networkId) { this.networkId = networkId; networkStateFilePath = ConfigConstants.getUserDataFolder() + "/" + ZigBeeBindingConstants.BINDING_ID; }
private boolean fillFromProviders(URI uri, Locale locale, List<ConfigDescriptionParameter> parameters, List<ConfigDescriptionParameterGroup> parameterGroups) { boolean found = false; for (ConfigDescriptionProvider configDescriptionProvider : this.configDescriptionProviders) { ConfigDescription config = configDescriptionProvider.getConfigDescription(uri, locale); if (config != null) { found = true; // Simply merge the groups and parameters parameters.addAll(config.getParameters()); parameterGroups.addAll(config.getParameterGroups()); } } return found; }
/** * Normalizes the type of the parameter to the one allowed for configurations. * * The conversion is performed 'best-effort' (e.g. "3" will always end up being a BigDecimal, never a String). * Use {@link #normalizeType(Object, ConfigDescriptionParameter)} to make sure your field type ends up as intended. * * @param value the value to return as normalized type * @return corresponding value as a valid type */ public static Object normalizeType(Object value) { return normalizeType(value, null); }
/** * Builds a result with the settings of this builder. * * @return the desired result */ public ConfigDescriptionParameter build() throws IllegalArgumentException { return new ConfigDescriptionParameter(name, type, min, max, step, pattern, required, readOnly, multiple, context, defaultValue, label, description, options, filterCriteria, groupName, advanced, limitToOptions, multipleLimit, unit, unitLabel, verify); }
/** * Creates a parameter builder * * @param name configuration parameter name * @param type configuration parameter type * @return parameter builder */ public static ConfigDescriptionParameterBuilder create(String name, Type type) { return new ConfigDescriptionParameterBuilder(name, type); }
public AbstractFileProvider(String root) { this.rootSubdirectory = root; configurationRoots = new String[] { ConfigConstants.getConfigFolder() + File.separator + "automation" }; }
/** * Default constructor in package scope only. Will allow to instantiate this * class by reflection. Not intended to be used for normal instantiation. */ ItemChannelLink() { super(); this.channelUID = null; this.configuration = new Configuration(); }
public FolderObserver() { super(ConfigConstants.getConfigFolder()); }
public ItemChannelLink(String itemName, ChannelUID channelUID) { this(itemName, channelUID, new Configuration()); }
public FolderObserver() { super(ConfigConstants.getConfigFolder()); }
public ScriptFileWatcher() { super(ConfigConstants.getConfigFolder() + File.separator + FILE_DIRECTORY); }