@Override public ChannelType build() { return new ChannelType(channelTypeUID, advanced, null, ChannelKind.TRIGGER, label, description, category, tags.isEmpty() ? null : tags, null, eventDescription, configDescriptionURI); }
@Override public ChannelType build() { return new ChannelType(channelTypeUID, advanced, itemType, ChannelKind.STATE, label, description, category, tags.isEmpty() ? null : tags, stateDescription, null, configDescriptionURI, autoUpdatePolicy); }
String pattern = format + " " + (unit != null ? unit : ""); return new ChannelType( new ChannelTypeUID(channelTypeUID.getAsString()), advanced, itemType, field.getName(), field.getInformativeText(), null, null,
private ChannelType createLocalizedChannelType(Bundle bundle, ChannelType channelType, Locale locale) { LocalizedChannelTypeKey localizedChannelTypeKey = getLocalizedChannelTypeKey(channelType.getUID(), locale); ChannelType cachedEntry = localizedChannelTypeCache.get(localizedChannelTypeKey); if (cachedEntry != null) { return cachedEntry; } if (this.thingTypeI18nUtil != null) { ChannelTypeUID channelTypeUID = channelType.getUID(); String label = this.thingTypeI18nUtil.getChannelLabel(bundle, channelTypeUID, channelType.getLabel(), locale); String description = this.thingTypeI18nUtil.getChannelDescription(bundle, channelTypeUID, channelType.getDescription(), locale); StateDescription state = createLocalizedChannelState(bundle, channelType, channelTypeUID, locale); ChannelType localizedChannelType = new ChannelType(channelTypeUID, channelType.isAdvanced(), channelType.getItemType(), label, description, channelType.getCategory(), channelType.getTags(), state, channelType.getConfigDescriptionURI()); localizedChannelTypeCache.put(localizedChannelTypeKey, localizedChannelType); return localizedChannelType; } return channelType; }
@Override protected ChannelTypeXmlResult unmarshalType(HierarchicalStreamReader reader, UnmarshallingContext context, Map<String, String> attributes, NodeIterator nodeIterator) throws ConversionException { boolean advanced = readBoolean(attributes, "advanced", false); boolean system = readBoolean(attributes, "system", false); String uid = system ? XmlHelper.getSystemUID(super.getID(attributes)) : super.getUID(attributes, context); ChannelTypeUID channelTypeUID = new ChannelTypeUID(uid); String itemType = readItemType(nodeIterator); String label = super.readLabel(nodeIterator); String description = super.readDescription(nodeIterator); String category = readCategory(nodeIterator); Set<String> tags = readTags(nodeIterator); StateDescription stateDescription = readStateDescription(nodeIterator); Object[] configDescriptionObjects = super.getConfigDescriptionObjects(nodeIterator); ChannelType channelType = new ChannelType(channelTypeUID, advanced, itemType, label, description, category, tags, stateDescription, (URI) configDescriptionObjects[0]); ChannelTypeXmlResult channelTypeXmlResult = new ChannelTypeXmlResult(channelType, (ConfigDescription) configDescriptionObjects[1], system); return channelTypeXmlResult; }
return new ChannelType(channelTypeUID, channelType.isAdvanced(), channelType.getItemType(), channelType.getKind(), label == null ? defaultLabel : label, description, channelType.getCategory(), channelType.getTags(), channelType.getState(),