public Property<DIDLAttribute> getAttribute(String descriptorName) { for (Property<DIDLAttribute> attr : attributes) { if (attr.getDescriptorName().equals(descriptorName)) { return attr; } } return null; }
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 void removeAttribute(String descriptorName) { for (Property<DIDLAttribute> attr : attributes) { if (attr.getDescriptorName().equals(descriptorName)) { this.removeAttribute(attr); break; } } }
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 void removeAttribute(String descriptorName) { for (Property<DIDLAttribute> attr : attributes) { if (attr.getDescriptorName().equals(descriptorName)) { this.removeAttribute(attr); break; } } }
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 Property<DIDLAttribute> getAttribute(String descriptorName) { for (Property<DIDLAttribute> attr : attributes) { if (attr.getDescriptorName().equals(descriptorName)) { return attr; } } return null; }
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 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 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()); } }