public void setOnElement(Element element) { element.setTextContent(toString()); for (Property<DIDLAttribute> attr : attributes) { element.setAttributeNS( attr.getValue().getNamespaceURI(), attr.getValue().getPrefix() + ':' + attr.getDescriptorName(), attr.getValue().getValue()); } }
for (int i = 0; i < albumArtURIAttributes.getLength(); i++) { if ("profileID".equals(albumArtURIAttributes.getLocalName(i))) { albumArtURI.addAttribute( new DIDLObject.Property.DLNA.PROFILE_ID( new DIDLAttribute(
public void removeAttribute(String descriptorName) { for (Property<DIDLAttribute> attr : attributes) { if (attr.getDescriptorName().equals(descriptorName)) { this.removeAttribute(attr); break; } } }
for (int i = 0; i < albumArtURIAttributes.getLength(); i++) { if ("profileID".equals(albumArtURIAttributes.getLocalName(i))) { albumArtURI.addAttribute( new DIDLObject.Property.DLNA.PROFILE_ID( new DIDLAttribute(
private ArrayList<DIDLObjectDisplay> buildContentList(String parent, DIDLContent didl) { ArrayList<DIDLObjectDisplay> list = new ArrayList<DIDLObjectDisplay>(); if (parent != null) list.add(new DIDLObjectDisplay(new ClingDIDLParentContainer(parent))); for (Container item : didl.getContainers()) { list.add(new DIDLObjectDisplay(new ClingDIDLContainer(item))); Log.v(TAG, "Add container : " + item.getTitle()); } for (Item item : didl.getItems()) { ClingDIDLItem clingItem = null; if(item instanceof VideoItem) clingItem = new ClingVideoItem((VideoItem)item); else if(item instanceof AudioItem) clingItem = new ClingAudioItem((AudioItem)item); else if(item instanceof ImageItem) clingItem = new ClingImageItem((ImageItem)item); else clingItem = new ClingDIDLItem(item); list.add(new DIDLObjectDisplay(clingItem)); Log.v(TAG, "Add item : " + item.getTitle()); for (DIDLObject.Property p : item.getProperties()) Log.v(TAG, p.getDescriptorName() + " " + p.toString()); } return list; }
public <V> V getFirstPropertyValue(java.lang.Class<? extends Property<V>> propertyClass) { Property<V> prop = getFirstProperty(propertyClass); return prop == null ? null : prop.getValue(); }
public void removeAttribute(String descriptorName) { for (Property<DIDLAttribute> attr : attributes) { if (attr.getDescriptorName().equals(descriptorName)) { this.removeAttribute(attr); break; } } }
public <V> List<V> getPropertyValues(java.lang.Class<? extends Property<V>> propertyClass) { List<V> list = new ArrayList<>(); for (Property property : getProperties(propertyClass)) { list.add((V) property.getValue()); } return list; }
public Property<DIDLAttribute> getAttribute(String descriptorName) { for (Property<DIDLAttribute> attr : attributes) { if (attr.getDescriptorName().equals(descriptorName)) { return attr; } } return null; }
public void setOnElement(Element element) { element.setTextContent(toString()); for (Property<DIDLAttribute> attr : attributes) { element.setAttributeNS( attr.getValue().getNamespaceURI(), attr.getValue().getPrefix() + ':' + attr.getDescriptorName(), attr.getValue().getValue()); } }
protected void appendProperties(Document descriptor, Element parent, DIDLObject object, String prefix, Class<? extends DIDLObject.Property.NAMESPACE> namespace, String namespaceURI) { for (DIDLObject.Property<Object> property : object.getPropertiesByNamespace(namespace)) { Element el = descriptor.createElementNS(namespaceURI, prefix + ":" + property.getDescriptorName()); parent.appendChild(el); property.setOnElement(el); } }
for (int i = 0; i < albumArtURIAttributes.getLength(); i++) { if ("profileID".equals(albumArtURIAttributes.getLocalName(i))) { albumArtURI.addAttribute( new DIDLObject.Property.DLNA.PROFILE_ID( new DIDLAttribute(
public <V> V getFirstPropertyValue(java.lang.Class<? extends Property<V>> propertyClass) { Property<V> prop = getFirstProperty(propertyClass); return prop == null ? null : prop.getValue(); }
public void removeAttribute(String descriptorName) { for (Property<DIDLAttribute> attr : attributes) { if (attr.getDescriptorName().equals(descriptorName)) { this.removeAttribute(attr); break; } } }
protected void appendProperties(Document descriptor, Element parent, DIDLObject object, String prefix, Class<? extends DIDLObject.Property.NAMESPACE> namespace, String namespaceURI) { for (DIDLObject.Property<Object> property : object.getPropertiesByNamespace(namespace)) { Element el = descriptor.createElementNS(namespaceURI, prefix + ":" + property.getDescriptorName()); parent.appendChild(el); property.setOnElement(el); } }
public Property<DIDLAttribute> getAttribute(String descriptorName) { for (Property<DIDLAttribute> attr : attributes) { if (attr.getDescriptorName().equals(descriptorName)) { return attr; } } return null; }
public void setOnElement(Element element) { element.setTextContent(toString()); for (Property<DIDLAttribute> attr : attributes) { element.setAttributeNS( attr.getValue().getNamespaceURI(), attr.getValue().getPrefix() + ':' + attr.getDescriptorName(), attr.getValue().getValue()); } }
public <V> List<V> getPropertyValues(java.lang.Class<? extends Property<V>> propertyClass) { List<V> list = new ArrayList(); for (Property property : getProperties(propertyClass)) { list.add((V) property.getValue()); } return list; }