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


Java Person类代码示例

本文整理汇总了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;未经允许,请勿转载。