当前位置: 首页>>代码示例>>Java>>正文


Java Item.getId方法代码示例

本文整理汇总了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;
}
 
开发者ID:sky24987,项目名称:UPlayer,代码行数:9,代码来源:ContentItem.java

示例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;
}
 
开发者ID:offbye,项目名称:DroidDLNA,代码行数:8,代码来源:ContentItem.java

示例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;
}
 
开发者ID:offbye,项目名称:DroidDLNA,代码行数:9,代码来源:UpnpUtil.java

示例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;
}
 
开发者ID:offbye,项目名称:DroidDLNA,代码行数:9,代码来源:UpnpUtil.java

示例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;
}
 
开发者ID:offbye,项目名称:DroidDLNA,代码行数:9,代码来源:UpnpUtil.java

示例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);
        }
    }
 
开发者ID:offbye,项目名称:DroidDLNA,代码行数:67,代码来源:DIDLParser.java

示例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);
		}
	}
 
开发者ID:offbye,项目名称:DroidDLNA,代码行数:63,代码来源:GenerateXml.java

示例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);
		}
	});

}
 
开发者ID:trishika,项目名称:DroidUPnP,代码行数:55,代码来源:RendererCommand.java


注:本文中的org.fourthline.cling.support.model.item.Item.getId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。