本文整理了Java中org.apache.abdera.model.Element.clone()
方法的一些代码示例,展示了Element.clone()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.clone()
方法的具体详情如下:
包路径:org.apache.abdera.model.Element
类名称:Element
方法名:clone
暂无
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.abdera
public Object clone() {
try {
ElementWrapper wrapper = (ElementWrapper) super.clone();
wrapper.internal = (Element) internal.clone();
return wrapper;
} catch (CloneNotSupportedException e) {
// won't happen
return null;
}
}
代码示例来源:origin: org.apache.abdera/abdera-core
public Object clone() {
try {
ElementWrapper wrapper = (ElementWrapper)super.clone();
wrapper.internal = (Element)internal.clone();
return wrapper;
} catch (CloneNotSupportedException e) {
// won't happen
return null;
}
}
代码示例来源:origin: org.apache.abdera/abdera-parser
public Object clone() {
Document<T> doc = ((FOMFactory)factory).newDocument();
OMDocument omdoc = (OMDocument)doc;
for (Iterator i = getChildren(); i.hasNext();) {
OMNode node = (OMNode)i.next();
switch (node.getType()) {
case OMNode.COMMENT_NODE:
OMComment comment = (OMComment)node;
factory.createOMComment(omdoc, comment.getValue());
break;
// TODO: Decide what to do with this code; it will no longer work in Axiom 1.2.14 (because of AXIOM-437).
// On the other hand, since we filter out DTDs, this code is never triggered.
// case OMNode.DTD_NODE:
// OMDocType doctype = (OMDocType)node;
// factory.createOMDocType(omdoc, doctype.getValue());
// break;
case OMNode.ELEMENT_NODE:
Element el = (Element)node;
omdoc.addChild((OMNode)el.clone());
break;
case OMNode.PI_NODE:
OMProcessingInstruction pi = (OMProcessingInstruction)node;
factory.createOMProcessingInstruction(omdoc, pi.getTarget(), pi.getValue());
break;
}
}
return doc;
}
代码示例来源:origin: org.apache.abdera/abdera-filesystem
public ResponseContext postEntry(RequestContext request) {
if (request.isAtom()) {
try {
Entry entry = (Entry)request.getDocument().getRoot().clone();
String key = createKey(request);
setEditDetail(request, entry, key);
File file = getFile(key);
FileOutputStream out = new FileOutputStream(file);
entry.writeTo(out);
String edit = entry.getEditLinkResolvedHref().toString();
return ProviderHelper.returnBase(entry.getDocument(), 201, null).setLocation(edit);
} catch (Exception e) {
return ProviderHelper.badrequest(request);
}
} else {
return ProviderHelper.notsupported(request);
}
}
代码示例来源:origin: org.apache.abdera/abdera-filesystem
public ResponseContext putEntry(RequestContext request) {
if (request.isAtom()) {
try {
Entry entry = (Entry)request.getDocument().getRoot().clone();
String key = request.getTarget().getParameter("entry");
setEditDetail(request, entry, key);
File file = getFile(key, false);
FileOutputStream out = new FileOutputStream(file);
entry.writeTo(out);
String edit = entry.getEditLinkResolvedHref().toString();
return ProviderHelper.returnBase(entry.getDocument(), 200, null).setLocation(edit);
} catch (Exception e) {
return ProviderHelper.badrequest(request);
}
} else {
return ProviderHelper.notsupported(request);
}
}
代码示例来源:origin: net.sf.taverna.t2.activities/interaction-activity
@Override
public ResponseContext postEntry(final RequestContext request) {
if (request.isAtom()) {
try {
final Entry entry = (Entry) request.getDocument().getRoot()
.clone();
final String key = this.createKey(request);
this.setEditDetail(request, entry, key);
final File file = this.getFile(key);
final FileOutputStream out = new FileOutputStream(file);
entry.writeTo(out);
final String edit = entry.getEditLinkResolvedHref().toString();
return ProviderHelper
.returnBase(entry.getDocument(), 201, null)
.setLocation(edit);
} catch (final Exception e) {
return ProviderHelper.badrequest(request);
}
} else {
return ProviderHelper.notsupported(request);
}
}
代码示例来源:origin: net.sf.taverna.t2.activities/interaction-activity
@Override
public ResponseContext putEntry(final RequestContext request) {
if (request.isAtom()) {
try {
final Entry entry = (Entry) request.getDocument().getRoot()
.clone();
final String key = request.getTarget().getParameter("entry");
this.setEditDetail(request, entry, key);
final File file = this.getFile(key, false);
final FileOutputStream out = new FileOutputStream(file);
entry.writeTo(out);
final String edit = entry.getEditLinkResolvedHref().toString();
return ProviderHelper
.returnBase(entry.getDocument(), 200, null)
.setLocation(edit);
} catch (final Exception e) {
return ProviderHelper.badrequest(request);
}
} else {
return ProviderHelper.notsupported(request);
}
}
代码示例来源:origin: org.apache.abdera/abdera-security
@SuppressWarnings("unchecked")
private <T extends Element> T _sign(T element, SignatureOptions options) throws XMLSecurityException {
element.setBaseUri(element.getResolvedBaseUri());
org.w3c.dom.Element dom = fomToDom((Element)element.clone(), options);
org.w3c.dom.Document domdoc = dom.getOwnerDocument();
PrivateKey signingKey = options.getSigningKey();
内容来源于网络,如有侵权,请联系作者删除!