org.fourthline.cling.model.meta.Device.getEmbeddedDevices()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(8.2k)|赞(0)|评价(0)|浏览(156)

本文整理了Java中org.fourthline.cling.model.meta.Device.getEmbeddedDevices()方法的一些代码示例,展示了Device.getEmbeddedDevices()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Device.getEmbeddedDevices()方法的具体详情如下:
包路径:org.fourthline.cling.model.meta.Device
类名称:Device
方法名:getEmbeddedDevices

Device.getEmbeddedDevices介绍

暂无

代码示例

代码示例来源:origin: 4thline/cling

  1. public boolean hasEmbeddedDevices() {
  2. return getEmbeddedDevices() != null && getEmbeddedDevices().length > 0;
  3. }

代码示例来源:origin: 4thline/cling

  1. protected Collection<D> findEmbeddedDevices(D current) {
  2. Collection<D> devices = new HashSet<>();
  3. if (!current.isRoot() && current.getIdentity().getUdn() != null)
  4. devices.add(current);
  5. if (current.hasEmbeddedDevices()) {
  6. for (D embeddedDevice : (D[]) current.getEmbeddedDevices()) {
  7. devices.addAll(findEmbeddedDevices(embeddedDevice));
  8. }
  9. }
  10. return devices;
  11. }

代码示例来源:origin: 4thline/cling

  1. protected void generateDeviceList(Namespace namespace, Device deviceModel, Document descriptor, Element deviceElement, RemoteClientInfo info) {
  2. if (!deviceModel.hasEmbeddedDevices()) return;
  3. Element deviceListElement = appendNewElement(descriptor, deviceElement, ELEMENT.deviceList);
  4. for (Device device : deviceModel.getEmbeddedDevices()) {
  5. generateDevice(namespace, device, descriptor, deviceListElement, info);
  6. }
  7. }

代码示例来源:origin: 4thline/cling

  1. protected Collection<D> find(DeviceType deviceType, D current) {
  2. Collection<D> devices = new HashSet<>();
  3. // Type might be null if we just discovered the device and it hasn't yet been hydrated
  4. if (current.getType() != null && current.getType().implementsVersion(deviceType)) {
  5. devices.add(current);
  6. }
  7. if (current.hasEmbeddedDevices()) {
  8. for (D embeddedDevice : (D[]) current.getEmbeddedDevices()) {
  9. devices.addAll(find(deviceType, embeddedDevice));
  10. }
  11. }
  12. return devices;
  13. }

代码示例来源:origin: 4thline/cling

  1. public List<ValidationError> validate() {
  2. List<ValidationError> errors = new ArrayList<>();
  3. if (getType() != null) {
  4. // Only validate the graph if we have a device type - that means we validate only if there
  5. // actually is a fully hydrated graph, not just a discovered device of which we haven't even
  6. // retrieved the descriptor yet. This assumes that the descriptor will ALWAYS contain a device
  7. // type. Now that is a risky assumption...
  8. errors.addAll(getVersion().validate());
  9. if(getIdentity() != null) {
  10. errors.addAll(getIdentity().validate());
  11. }
  12. if (getDetails() != null) {
  13. errors.addAll(getDetails().validate());
  14. }
  15. if (hasServices()) {
  16. for (Service service : getServices()) {
  17. if (service != null)
  18. errors.addAll(service.validate());
  19. }
  20. }
  21. if (hasEmbeddedDevices()) {
  22. for (Device embeddedDevice : getEmbeddedDevices()) {
  23. if (embeddedDevice != null)
  24. errors.addAll(embeddedDevice.validate());
  25. }
  26. }
  27. }
  28. return errors;
  29. }

代码示例来源:origin: 4thline/cling

  1. protected D find(UDN udn, D current) {
  2. if (current.getIdentity() != null && current.getIdentity().getUdn() != null) {
  3. if (current.getIdentity().getUdn().equals(udn)) return current;
  4. }
  5. if (current.hasEmbeddedDevices()) {
  6. for (D embeddedDevice : (D[]) current.getEmbeddedDevices()) {
  7. D match;
  8. if ((match = find(udn, embeddedDevice)) != null) return match;
  9. }
  10. }
  11. return null;
  12. }

代码示例来源:origin: kingthy/TVRemoteIME

  1. public boolean hasEmbeddedDevices() {
  2. return getEmbeddedDevices() != null && getEmbeddedDevices().length > 0;
  3. }

代码示例来源:origin: kingthy/TVRemoteIME

  1. protected Collection<D> findEmbeddedDevices(D current) {
  2. Collection<D> devices = new HashSet();
  3. if (!current.isRoot()) {
  4. devices.add(current);
  5. }
  6. if (current.hasEmbeddedDevices()) {
  7. for (D embeddedDevice : (D[]) current.getEmbeddedDevices()) {
  8. devices.addAll(findEmbeddedDevices(embeddedDevice));
  9. }
  10. }
  11. return devices;
  12. }

代码示例来源:origin: 4thline/cling

  1. for (Device embedded : device.getEmbeddedDevices()) {
  2. createNodes(deviceNode, namespace, embedded);

代码示例来源:origin: kingthy/TVRemoteIME

  1. protected Collection<D> find(DeviceType deviceType, D current) {
  2. Collection<D> devices = new HashSet();
  3. // Type might be null if we just discovered the device and it hasn't yet been hydrated
  4. if (current.getType() != null && current.getType().implementsVersion(deviceType)) {
  5. devices.add(current);
  6. }
  7. if (current.hasEmbeddedDevices()) {
  8. for (D embeddedDevice : (D[]) current.getEmbeddedDevices()) {
  9. devices.addAll(find(deviceType, embeddedDevice));
  10. }
  11. }
  12. return devices;
  13. }

代码示例来源:origin: kingthy/TVRemoteIME

  1. protected void generateDeviceList(Namespace namespace, Device deviceModel, Document descriptor, Element deviceElement, RemoteClientInfo info) {
  2. if (!deviceModel.hasEmbeddedDevices()) return;
  3. Element deviceListElement = appendNewElement(descriptor, deviceElement, ELEMENT.deviceList);
  4. for (Device device : deviceModel.getEmbeddedDevices()) {
  5. generateDevice(namespace, device, descriptor, deviceListElement, info);
  6. }
  7. }

代码示例来源:origin: kingthy/TVRemoteIME

  1. protected D find(UDN udn, D current) {
  2. if (current.getIdentity().getUdn().equals(udn)) return current;
  3. if (current.hasEmbeddedDevices()) {
  4. for (D embeddedDevice : (D[]) current.getEmbeddedDevices()) {
  5. D match;
  6. if ((match = find(udn, embeddedDevice)) != null) return match;
  7. }
  8. }
  9. return null;
  10. }

代码示例来源:origin: kingthy/TVRemoteIME

  1. public List<ValidationError> validate() {
  2. List<ValidationError> errors = new ArrayList();
  3. if (getType() != null) {
  4. // Only validate the graph if we have a device type - that means we validate only if there
  5. // actually is a fully hydrated graph, not just a discovered device of which we haven't even
  6. // retrieved the descriptor yet. This assumes that the descriptor will ALWAYS contain a device
  7. // type. Now that is a risky assumption...
  8. errors.addAll(getVersion().validate());
  9. if (getDetails() != null) {
  10. errors.addAll(getDetails().validate());
  11. }
  12. if (hasServices()) {
  13. for (Service service : getServices()) {
  14. if (service != null)
  15. errors.addAll(service.validate());
  16. }
  17. }
  18. if (hasEmbeddedDevices()) {
  19. for (Device embeddedDevice : getEmbeddedDevices()) {
  20. if (embeddedDevice != null)
  21. errors.addAll(embeddedDevice.validate());
  22. }
  23. }
  24. }
  25. return errors;
  26. }

代码示例来源:origin: org.fourthline.cling/cling-core

  1. public boolean hasEmbeddedDevices() {
  2. return getEmbeddedDevices() != null && getEmbeddedDevices().length > 0;
  3. }

代码示例来源:origin: org.fourthline.cling/cling-core

  1. protected Collection<D> findEmbeddedDevices(D current) {
  2. Collection<D> devices = new HashSet<>();
  3. if (!current.isRoot() && current.getIdentity().getUdn() != null)
  4. devices.add(current);
  5. if (current.hasEmbeddedDevices()) {
  6. for (D embeddedDevice : (D[]) current.getEmbeddedDevices()) {
  7. devices.addAll(findEmbeddedDevices(embeddedDevice));
  8. }
  9. }
  10. return devices;
  11. }

代码示例来源:origin: org.fourthline.cling/cling-core

  1. protected Collection<D> find(DeviceType deviceType, D current) {
  2. Collection<D> devices = new HashSet<>();
  3. // Type might be null if we just discovered the device and it hasn't yet been hydrated
  4. if (current.getType() != null && current.getType().implementsVersion(deviceType)) {
  5. devices.add(current);
  6. }
  7. if (current.hasEmbeddedDevices()) {
  8. for (D embeddedDevice : (D[]) current.getEmbeddedDevices()) {
  9. devices.addAll(find(deviceType, embeddedDevice));
  10. }
  11. }
  12. return devices;
  13. }

代码示例来源:origin: org.fourthline.cling/cling-core

  1. protected void generateDeviceList(Namespace namespace, Device deviceModel, Document descriptor, Element deviceElement, RemoteClientInfo info) {
  2. if (!deviceModel.hasEmbeddedDevices()) return;
  3. Element deviceListElement = appendNewElement(descriptor, deviceElement, ELEMENT.deviceList);
  4. for (Device device : deviceModel.getEmbeddedDevices()) {
  5. generateDevice(namespace, device, descriptor, deviceListElement, info);
  6. }
  7. }

代码示例来源:origin: org.fourthline.cling/cling-core

  1. public List<ValidationError> validate() {
  2. List<ValidationError> errors = new ArrayList<>();
  3. if (getType() != null) {
  4. // Only validate the graph if we have a device type - that means we validate only if there
  5. // actually is a fully hydrated graph, not just a discovered device of which we haven't even
  6. // retrieved the descriptor yet. This assumes that the descriptor will ALWAYS contain a device
  7. // type. Now that is a risky assumption...
  8. errors.addAll(getVersion().validate());
  9. if(getIdentity() != null) {
  10. errors.addAll(getIdentity().validate());
  11. }
  12. if (getDetails() != null) {
  13. errors.addAll(getDetails().validate());
  14. }
  15. if (hasServices()) {
  16. for (Service service : getServices()) {
  17. if (service != null)
  18. errors.addAll(service.validate());
  19. }
  20. }
  21. if (hasEmbeddedDevices()) {
  22. for (Device embeddedDevice : getEmbeddedDevices()) {
  23. if (embeddedDevice != null)
  24. errors.addAll(embeddedDevice.validate());
  25. }
  26. }
  27. }
  28. return errors;
  29. }

代码示例来源:origin: org.fourthline.cling/cling-core

  1. protected D find(UDN udn, D current) {
  2. if (current.getIdentity() != null && current.getIdentity().getUdn() != null) {
  3. if (current.getIdentity().getUdn().equals(udn)) return current;
  4. }
  5. if (current.hasEmbeddedDevices()) {
  6. for (D embeddedDevice : (D[]) current.getEmbeddedDevices()) {
  7. D match;
  8. if ((match = find(udn, embeddedDevice)) != null) return match;
  9. }
  10. }
  11. return null;
  12. }

相关文章