本文整理了Java中org.apache.abdera.factory.Factory.newCollection()
方法的一些代码示例,展示了Factory.newCollection()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Factory.newCollection()
方法的具体详情如下:
包路径:org.apache.abdera.factory.Factory
类名称:Factory
方法名:newCollection
[英]Create a new Collection element.
[中]创建一个新的集合元素。
代码示例来源:origin: org.apache.ws.commons.axiom/fom-testsuite
@Override
protected void runTest() throws Throwable {
Collection collection = abdera.getFactory().newCollection();
collection.setAccept("image/png", "image/jpeg");
List<Element> children = collection.getElements();
assertThat(children).hasSize(2);
assertThat(children.get(0).getQName()).isEqualTo(Constants.ACCEPT);
assertThat(children.get(0).getText()).isEqualTo("image/png");
assertThat(children.get(1).getQName()).isEqualTo(Constants.ACCEPT);
assertThat(children.get(1).getText()).isEqualTo("image/jpeg");
}
}
代码示例来源:origin: org.apache.ws.commons.axiom/fom-testsuite
@Override
protected void runTest() throws Throwable {
Collection collection = abdera.getFactory().newCollection();
collection.setAccept("image/png", "image/jpeg");
collection.setAccept();
assertThat(collection.getFirstChild()).isNull();
}
}
代码示例来源:origin: org.apache.abdera/abdera-server
public Collection asCollectionElement(RequestContext request) {
Collection collection = request.getAbdera().getFactory().newCollection();
collection.setHref(href);
collection.setTitle(title);
collection.setAccept(accepts);
for (CategoriesInfo catsinfo : this.catinfos) {
collection.addCategories(catsinfo.asCategoriesElement(request));
}
return collection;
}
}
代码示例来源:origin: org.xcmis/xcmis-restatom
/**
* Convert this to an instance of the FOM Collection interface.
*
* @param request request
* @param baseUri base URI. It will be used to provider href attribute in
* collection element
* @param segments additional path segments. It will be used in href
* attribute of collection element, e.g.
* <code>baseUri + relativeHref + segments</code>
* @return collection element
*/
public Collection asCollectionElement(RequestContext request, String baseUri, String... segments)
{
Collection collection = request.getAbdera().getFactory().newCollection();
collection.setHref(getHref(request, baseUri, segments));
collection.setTitle(getTitle(request));
collection.addSimpleExtension(AtomCMIS.COLLECTION_TYPE, collectionType);
return collection;
}
代码示例来源:origin: org.apache.abdera/abdera-server
public Collection asCollectionElement(RequestContext request) {
Collection collection = request.getAbdera().getFactory().newCollection();
collection.setHref(getHref(request));
collection.setTitle(getTitle(request));
collection.setAccept(getAccepts(request));
for (CategoriesInfo catsinfo : getCategoriesInfo(request)) {
collection.addCategories(catsinfo.asCategoriesElement(request));
}
return collection;
}
代码示例来源:origin: org.apache.abdera/abdera-server
public Collection asCollectionElement(RequestContext request) {
Collection collection = request.getAbdera().getFactory().newCollection();
collection.setHref(getHref(request));
collection.setTitle(getTitle(request));
collection.setAccept(getAccepts(request));
for (CategoriesInfo catsinfo : getCategoriesInfo(request)) {
collection.addCategories(catsinfo.asCategoriesElement(request));
}
return collection;
}
}
代码示例来源:origin: org.dataconservancy.deposit/dc-deposit-sword-server
public Collection asCollectionElement(RequestContext request) {
request.getAbdera().getFactory().newCollection();
String href = stripContext(request, getHref(request));
collection.setHref(getUrlBase(request) + href);
内容来源于网络,如有侵权,请联系作者删除!