• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Person类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.jboss.resteasy.plugins.providers.atom.Person的典型用法代码示例。如果您正苦于以下问题:Java Person类的具体用法?Java Person怎么用?Java Person使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Person类属于org.jboss.resteasy.plugins.providers.atom包,在下文中一共展示了Person类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: wrapSrampArtifact

import org.jboss.resteasy.plugins.providers.atom.Person; //导入依赖的package包/类
/**
 * Wraps the given s-ramp artifact in an Atom {@link Entry}.
 * @param artifact
 * @throws URISyntaxException
 * @throws InvocationTargetException
 * @throws IllegalAccessException
 * @throws IllegalArgumentException
 * @throws NoSuchMethodException
 * @throws SecurityException
 */
public static Entry wrapSrampArtifact(BaseArtifactType artifact) throws URISyntaxException,
		IllegalArgumentException, IllegalAccessException, InvocationTargetException, SecurityException,
		NoSuchMethodException {
	// TODO leverage the artifact->entry visitors here
	Entry entry = new Entry();
	if (artifact.getUuid() != null)
		entry.setId(new URI(artifact.getUuid()));
	if (artifact.getLastModifiedTimestamp() != null)
		entry.setUpdated(artifact.getLastModifiedTimestamp().toGregorianCalendar().getTime());
	if (artifact.getName() != null)
		entry.setTitle(artifact.getName());
	if (artifact.getCreatedTimestamp() != null)
		entry.setPublished(artifact.getCreatedTimestamp().toGregorianCalendar().getTime());
	if (artifact.getCreatedBy() != null)
		entry.getAuthors().add(new Person(artifact.getCreatedBy()));
	if (artifact.getDescription() != null)
		entry.setSummary(artifact.getDescription());

	Artifact srampArty = new Artifact();
	Method method = Artifact.class.getMethod("set" + artifact.getClass().getSimpleName(), artifact.getClass()); //$NON-NLS-1$
	method.invoke(srampArty, artifact);
	entry.setAnyOtherJAXBObject(srampArty);

	return entry;
}
 
开发者ID:ArtificerRepo,项目名称:s-ramp-tck,代码行数:36,代码来源:SrampAtomUtils.java


示例2: getFeed

import org.jboss.resteasy.plugins.providers.atom.Person; //导入依赖的package包/类
@GET
@Produces("application/atom+xml")
public Feed getFeed() throws URISyntaxException {
    Feed feed = new Feed();
    feed.setId(new URI("http://test.com/1"));
    feed.setTitle("WildFly Camel Test Feed");
    feed.setUpdated(new Date());

    Link link = new Link();
    link.setHref(new URI("http://localhost"));
    link.setRel("edit");
    feed.getLinks().add(link);
    feed.getAuthors().add(new Person("WildFly Camel"));

    Entry entry = new Entry();
    entry.setTitle("Hello Kermit");

    Content content = new Content();
    content.setType(MediaType.TEXT_HTML_TYPE);
    content.setText("Greeting Kermit");
    entry.setContent(content);

    feed.getEntries().add(entry);
    return feed;
}
 
开发者ID:wildfly-extras,项目名称:wildfly-camel,代码行数:26,代码来源:AtomFeed.java


示例3: getFeed

import org.jboss.resteasy.plugins.providers.atom.Person; //导入依赖的package包/类
@GET
@Path("/feed")
@Produces("application/atom+xml")
public Feed getFeed() throws URISyntaxException
{
    Feed feed = new Feed();
    feed.setId(new URI("http://example.com/42"));
    feed.setTitle("Veterinarians");
    feed.setUpdated(new Date());
    Link link = new Link();
    link.setHref(new URI("http://localhost"));
    link.setRel("edit");
    feed.getLinks().add(link);
    feed.getAuthors().add(new Person("Thomas Woehlke"));
    for(Vet vet:vetDao.getAll()){
        Entry entry = new Entry();
        entry.setTitle("Vet: "+vet.getFirstName()+" "+vet.getLastName());
        Content content = new Content();
        content.setType(MediaType.TEXT_HTML_TYPE);
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append("[");
        Iterator<Specialty> i = vet.getSpecialties().iterator();
        while(i.hasNext() ){
            stringBuilder.append(i.next().getName());
            if(i.hasNext()){
                stringBuilder.append(", ");
            }
        }
        stringBuilder.append("]");
        content.setText(stringBuilder.toString());
        entry.setContent(content);
        feed.getEntries().add(entry);
    }
    return feed;
}
 
开发者ID:phasenraum2010,项目名称:javaee7-petclinic,代码行数:36,代码来源:VetWebservice.java


示例4: getAuthors

import org.jboss.resteasy.plugins.providers.atom.Person; //导入依赖的package包/类
@Override
protected ArrayList<Person> getAuthors() {
	return newArrayList(new Person("Nordin Haouari"));
}
 
开发者ID:nordinh,项目名称:atom-feed,代码行数:5,代码来源:NotificationFeedProducer.java


示例5: getAuthors

import org.jboss.resteasy.plugins.providers.atom.Person; //导入依赖的package包/类
protected abstract ArrayList<Person> getAuthors(); 
开发者ID:nordinh,项目名称:atom-feed,代码行数:2,代码来源:AtomFeedProducer.java



注:本文中的org.jboss.resteasy.plugins.providers.atom.Person类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ElementValuePair类代码示例发布时间:2022-05-22
下一篇:
Java PluginExecutorService类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap