本文整理了Java中org.apache.abdera.factory.Factory.newElement()
方法的一些代码示例,展示了Factory.newElement()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Factory.newElement()
方法的具体详情如下:
包路径:org.apache.abdera.factory.Factory
类名称:Factory
方法名:newElement
[英]Create a new Element with the given QName.
[中]使用给定的QName创建新元素。
代码示例来源:origin: org.apache.abdera/abdera-core
protected ElementWrapper(Factory factory, QName qname) {
Element el = factory.newElement(qname);
internal = (el instanceof ElementWrapper) ? ((ElementWrapper)el).getInternal() : el;
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.abdera
protected ElementWrapper(Factory factory, QName qname) {
Element el = factory.newElement(qname);
internal = (el instanceof ElementWrapper) ?
((ElementWrapper)el).getInternal() : el;
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.abdera
public StreamBuilder startElement(String name, String namespace, String prefix) {
current = abdera.getFactory().newElement(getQName(name, namespace, prefix),current);
if (root == null) root = current;
return this;
}
代码示例来源:origin: org.apache.abdera/abdera-core
public StreamBuilder startElement(String name, String namespace, String prefix) {
current = abdera.getFactory().newElement(getQName(name, namespace, prefix), current);
if (root == null)
root = current;
return this;
}
代码示例来源:origin: org.apache.ws.commons.axiom/fom-testsuite
@Override
protected void runTest() throws Throwable {
Element element = abdera.getFactory().newElement(new QName("test"));
element.setAttributeValue(qname, "value");
assertThat(element.getAttributeValue(qname)).isEqualTo("value");
List<QName> attrs = element.getAttributes();
assertThat(attrs).hasSize(1);
QName actualQName = attrs.get(0);
assertThat(actualQName).isEqualTo(qname);
assertThat(actualQName.getPrefix()).isEqualTo(qname.getPrefix());
}
}
代码示例来源:origin: org.apache.ws.commons.axiom/fom-testsuite
@Override
protected void runTest() throws Throwable {
Element element = abdera.getFactory().newElement(new QName("test"));
QName qname = new QName("urn:test", "attr", "p");
element.setAttributeValue(qname, "value");
assertThat(element.getAttributes()).containsExactly(qname);
element.setAttributeValue(qname, null);
assertThat(element.getAttributes()).isEmpty();
}
}
代码示例来源:origin: org.apache.ws.commons.axiom/fom-testsuite
@Override
protected void runTest() throws Throwable {
Factory factory = abdera.getFactory();
Element element = factory.newElement(new QName("test"));
element.setAttributeValue("attr", "value");
Object xpathResult = abdera.getXPath().selectSingleNode("./@attr", element);
assertThat(xpathResult).isInstanceOf(Attribute.class);
assertThat(((Attribute)xpathResult).getFactory()).isSameAs(factory);
}
}
代码示例来源:origin: org.apache.ws.commons.axiom/fom-testsuite
@Override
protected void runTest() throws Throwable {
Factory factory = abdera.getFactory();
Control control = factory.newControl();
factory.newElement(Constants.DRAFT, control).setText("yes");
assertThat(control.isDraft()).isTrue();
}
}
代码示例来源:origin: org.xcmis/xcmis-restatom
List<AccessControlEntry> list = connection.getACL(objectId, onlyBasicPermissions);
FOMExtensibleElement accessControlListTypeElement =
AbderaFactory.getInstance().getFactory().newElement(AtomCMIS.ACL);
for (AccessControlEntry accessControlEntry : list)
代码示例来源:origin: org.xcmis/xcmis-restatom
AllowableActionsElement el = AbderaFactory.getInstance().getFactory().newElement(AtomCMIS.ALLOWABLE_ACTIONS);
el.build(result);
return Response.ok(el).header(HttpHeaders.CACHE_CONTROL, "no-cache").build();
代码示例来源:origin: org.apache.abdera/abdera-core
public static Error create(Abdera abdera, int code, String message, Throwable t) {
Document<Error> doc = abdera.getFactory().newDocument();
Error error = abdera.getFactory().newElement(ERROR, doc);
error.setCode(code).setMessage(message);
return error;
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.abdera
public static Error create(Abdera abdera, int code, String message, Throwable t) {
Document<Error> doc = abdera.getFactory().newDocument();
Error error = abdera.getFactory().newElement(ERROR,doc);
error.setCode(code)
.setMessage(message);
return error;
}
代码示例来源:origin: org.xcmis/xcmis-restatom
List<AccessControlEntry> list = connection.getACL(objectId, false);
FOMExtensibleElement accessControlListTypeElement =
AbderaFactory.getInstance().getFactory().newElement(AtomCMIS.ACL);
for (AccessControlEntry accessControlEntry : list)
代码示例来源:origin: org.apache.abdera/abdera-parser
public <T extends Element> T addExtension(QName qname, QName before) {
complete();
OMElement el = getFirstChildWithName(before);
T element = (T)getFactory().newElement(qname);
if (el == null) {
addExtension(element);
} else {
el.insertSiblingBefore((OMElement)getInternal(element));
}
return (T)element;
}
}
代码示例来源:origin: org.xcmis/xcmis-restatom
Element numItems = request.getAbdera().getFactory().newElement(AtomCMIS.NUM_ITEMS, childrenElement);
numItems.setText(Integer.toString(children.size()));
代码示例来源:origin: org.xcmis/xcmis-restatom
Element numItems = request.getAbdera().getFactory().newElement(AtomCMIS.NUM_ITEMS, childrenElement);
numItems.setText(Integer.toString(children.size()));
for (ItemsTree<CmisObject> oifContainer : children)
内容来源于网络,如有侵权,请联系作者删除!