本文整理汇总了Java中org.fourthline.cling.support.model.item.Item.getId方法的典型用法代码示例。如果您正苦于以下问题:Java Item.getId方法的具体用法?Java Item.getId怎么用?Java Item.getId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.fourthline.cling.support.model.item.Item
的用法示例。
在下文中一共展示了Item.getId方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ContentItem
import org.fourthline.cling.support.model.item.Item; //导入方法依赖的package包/类
@SuppressWarnings("rawtypes")
public ContentItem(Item item, Service<Device, Service> service) {
mObject = item;
mService = service;
if (item != null)
mId = item.getId();
mIsContainer = false;
}
示例2: ContentItem
import org.fourthline.cling.support.model.item.Item; //导入方法依赖的package包/类
public ContentItem(Item item, Service service) {
// TODO Auto-generated constructor stub
this.service = service;
this.content = item;
this.id = item.getId();
this.isContainer = false;
}
示例3: isAudioItem
import org.fourthline.cling.support.model.item.Item; //导入方法依赖的package包/类
public static boolean isAudioItem(Item item) {
// TODO zxt need check?
String objectClass = item.getId();
if (objectClass != null && objectClass.contains(DLNA_OBJECTCLASS_MUSICID)) {
return true;
}
return false;
}
示例4: isVideoItem
import org.fourthline.cling.support.model.item.Item; //导入方法依赖的package包/类
public static boolean isVideoItem(Item item) {
// TODO zxt need check?
String objectClass = item.getId();
if (objectClass != null && objectClass.contains(DLNA_OBJECTCLASS_VIDEOID)) {
return true;
}
return false;
}
示例5: isPictureItem
import org.fourthline.cling.support.model.item.Item; //导入方法依赖的package包/类
public static boolean isPictureItem(Item item) {
// TODO zxt need check?
String objectClass = item.getId();
if (objectClass != null && objectClass.contains(DLNA_OBJECTCLASS_PHOTOID)) {
return true;
}
return false;
}
示例6: generateItem
import org.fourthline.cling.support.model.item.Item; //导入方法依赖的package包/类
protected void generateItem(Item item, Document descriptor, Element parent) {
if (item.getClazz() == null) {
throw new RuntimeException("Missing 'upnp:class' element for item: " + item.getId());
}
Element itemElement = appendNewElement(descriptor, parent, "item");
if (item.getId() == null)
throw new NullPointerException("Missing id on item: " + item);
itemElement.setAttribute("id", item.getId());
if (item.getParentID() == null)
throw new NullPointerException("Missing parent id on item: " + item);
itemElement.setAttribute("parentID", item.getParentID());
if (item.getRefID() != null)
itemElement.setAttribute("refID", item.getRefID());
itemElement.setAttribute("restricted", booleanToInt(item.isRestricted()));
String title = item.getTitle();
if (title == null) {
log.warning("Missing 'dc:title' element for item: " + item.getId());
title = UNKNOWN_TITLE;
}
appendNewElementIfNotNull(
descriptor,
itemElement,
"dc:title",
title,
DIDLObject.Property.DC.NAMESPACE.URI
);
appendNewElementIfNotNull(
descriptor,
itemElement,
"dc:creator",
item.getCreator(),
DIDLObject.Property.DC.NAMESPACE.URI
);
appendNewElementIfNotNull(
descriptor,
itemElement,
"upnp:writeStatus",
item.getWriteStatus(),
DIDLObject.Property.UPNP.NAMESPACE.URI
);
appendClass(descriptor, itemElement, item.getClazz(), "upnp:class", false);
appendProperties(descriptor, itemElement, item, "upnp", DIDLObject.Property.UPNP.NAMESPACE.class, DIDLObject.Property.UPNP.NAMESPACE.URI);
appendProperties(descriptor, itemElement, item, "dc", DIDLObject.Property.DC.NAMESPACE.class, DIDLObject.Property.DC.NAMESPACE.URI);
appendProperties(descriptor, itemElement, item, "sec", DIDLObject.Property.SEC.NAMESPACE.class, DIDLObject.Property.SEC.NAMESPACE.URI);
for (Res resource : item.getResources()) {
if (resource == null) continue;
generateResource(resource, descriptor, itemElement);
}
for (DescMeta descMeta : item.getDescMetadata()) {
if (descMeta == null) continue;
generateDescMetadata(descMeta, descriptor, itemElement);
}
}
示例7: generateItem
import org.fourthline.cling.support.model.item.Item; //导入方法依赖的package包/类
protected void generateItem(Item item, Document descriptor, Element parent) {
if (item.getClazz() == null) {
throw new RuntimeException(
"Missing 'upnp:class' element for item: " + item.getId());
}
Element itemElement = appendNewElement(descriptor, parent, "item");
if (item.getId() == null)
throw new NullPointerException("Missing id on item: " + item);
itemElement.setAttribute("id", item.getId());
if (item.getParentID() == null)
throw new NullPointerException("Missing parent id on item: " + item);
itemElement.setAttribute("parentID", item.getParentID());
if (item.getRefID() != null)
itemElement.setAttribute("refID", item.getRefID());
itemElement.setAttribute("restricted",
booleanToInt(item.isRestricted()));
String title = item.getTitle();
if (title == null) {
log.warning("Missing 'dc:title' element for item: " + item.getId());
title = UNKNOWN_TITLE;
}
appendNewElementIfNotNull(descriptor, itemElement, "dc:title", title,
DIDLObject.Property.DC.NAMESPACE.URI);
appendNewElementIfNotNull(descriptor, itemElement, "dc:creator",
item.getCreator(), DIDLObject.Property.DC.NAMESPACE.URI);
appendNewElementIfNotNull(descriptor, itemElement, "upnp:writeStatus",
item.getWriteStatus(), DIDLObject.Property.UPNP.NAMESPACE.URI);
appendClass(descriptor, itemElement, item.getClazz(), "upnp:class",
false);
appendProperties(descriptor, itemElement, item, "upnp",
DIDLObject.Property.UPNP.NAMESPACE.class,
DIDLObject.Property.UPNP.NAMESPACE.URI);
appendProperties(descriptor, itemElement, item, "dc",
DIDLObject.Property.DC.NAMESPACE.class,
DIDLObject.Property.DC.NAMESPACE.URI);
appendProperties(descriptor, itemElement, item, "sec",
DIDLObject.Property.SEC.NAMESPACE.class,
DIDLObject.Property.SEC.NAMESPACE.URI);
for (Res resource : item.getResources()) {
if (resource == null)
continue;
generateResource(resource, descriptor, itemElement);
}
for (DescMeta descMeta : item.getDescMetadata()) {
if (descMeta == null)
continue;
generateDescMetadata(descMeta, descriptor, itemElement);
}
}
示例8: launchItem
import org.fourthline.cling.support.model.item.Item; //导入方法依赖的package包/类
@Override
public void launchItem(final IDIDLItem item)
{
if (getAVTransportService() == null)
return;
DIDLObject obj = ((ClingDIDLItem) item).getObject();
if (!(obj instanceof Item))
return;
Item upnpItem = (Item) obj;
String type = "";
if (upnpItem instanceof AudioItem)
type = "audioItem";
else if (upnpItem instanceof VideoItem)
type = "videoItem";
else if (upnpItem instanceof ImageItem)
type = "imageItem";
else if (upnpItem instanceof PlaylistItem)
type = "playlistItem";
else if (upnpItem instanceof TextItem)
type = "textItem";
// TODO genre && artURI
final TrackMetadata trackMetadata = new TrackMetadata(upnpItem.getId(), upnpItem.getTitle(),
upnpItem.getCreator(), "", "", upnpItem.getFirstResource().getValue(),
"object.item." + type);
Log.i(TAG, "TrackMetadata : "+trackMetadata.toString());
// Stop playback before setting URI
controlPoint.execute(new Stop(getAVTransportService()) {
@Override
public void success(ActionInvocation invocation)
{
Log.v(TAG, "Success stopping ! ");
callback();
}
@Override
public void failure(ActionInvocation arg0, UpnpResponse arg1, String arg2)
{
Log.w(TAG, "Fail to stop ! " + arg2);
callback();
}
public void callback()
{
setURI(item.getURI(), trackMetadata);
}
});
}