本文整理汇总了Java中org.jboss.resteasy.plugins.providers.atom.Link类的典型用法代码示例。如果您正苦于以下问题:Java Link类的具体用法?Java Link怎么用?Java Link使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Link类属于org.jboss.resteasy.plugins.providers.atom包,在下文中一共展示了Link类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getFeed
import org.jboss.resteasy.plugins.providers.atom.Link; //导入依赖的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
示例2: queryFullArtifacts
import org.jboss.resteasy.plugins.providers.atom.Link; //导入依赖的package包/类
@Override
public List<BaseArtifactType> queryFullArtifacts(String query) throws Exception {
String path = "/s-ramp?query=" + query;
List<BaseArtifactType> artifacts = new ArrayList<BaseArtifactType>();
Feed feed = getFeed(path, 200);
for (Entry entry : feed.getEntries()) {
for (Link link : entry.getLinks()) {
// TODO: Safe assumption for all impls?
if ("self".equals(link.getRel())) {
artifacts.add(SrampAtomUtils.unwrapSrampArtifact(getArtifact(link.getHref().toString(), 200)));
}
}
}
return artifacts;
}
开发者ID:ArtificerRepo,项目名称:s-ramp-tck,代码行数:16,代码来源:AtomBinding.java
示例3: test_2_3_2
import org.jboss.resteasy.plugins.providers.atom.Link; //导入依赖的package包/类
@Test
public void test_2_3_2() throws Exception {
XmlDocument artifact1 = XmlDocument();
artifact1.setName("PO 1");
Entry entry1 = binding.uploadReturnEntry(artifact1, "/PO.xml");
artifact1 = (XmlDocument) SrampAtomUtils.unwrapSrampArtifact(entry1);
XmlDocument artifact2 = XmlDocument();
artifact2.setName("PO 2");
Target target = new Target();
target.setValue(artifact1.getUuid());
Relationship relationship = new Relationship();
relationship.setRelationshipType("fooRelationship");
relationship.getRelationshipTarget().add(target);
artifact2.getRelationship().add(relationship);
Entry entry2 = binding.uploadReturnEntry(artifact2, "/PO.xml");
artifact2 = (XmlDocument) SrampAtomUtils.unwrapSrampArtifact(entry2);
// TODO: Improve the assertions. Simply looking for the UUID is probably overly-simple.
Link link = entry2.getLinkByRel("self");
assertNotNull(link);
assertTrue(link.getHref().toString().contains(artifact2.getUuid()));
link = entry2.getLinkByRel("edit-media");
assertNotNull(link);
assertTrue(link.getHref().toString().contains(artifact2.getUuid()));
link = entry2.getLinkByRel("edit");
assertNotNull(link);
assertTrue(link.getHref().toString().contains(artifact2.getUuid()));
}
开发者ID:ArtificerRepo,项目名称:s-ramp-tck,代码行数:30,代码来源:Test_2_3.java
示例4: generateLinks
import org.jboss.resteasy.plugins.providers.atom.Link; //导入依赖的package包/类
private List<Link> generateLinks(Integer page) {
ArrayList<Link> links = newArrayList();
links.add(new Link("self", baseURL() + page));
links.add(new Link("first", baseURL() + "0"));
links.add(new Link("last", baseURL() + lastPage()));
if (page < lastPage())
links.add(new Link("next", baseURL() + (page + 1)));
if (page > 0)
links.add(new Link("previous", baseURL() + (page - 1)));
return links;
}
开发者ID:nordinh,项目名称:atom-feed,代码行数:12,代码来源:AtomFeedProducer.java
示例5: getFeed
import org.jboss.resteasy.plugins.providers.atom.Link; //导入依赖的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
注:本文中的org.jboss.resteasy.plugins.providers.atom.Link类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论