org.apache.abdera.model.Element.clone()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(4.6k)|赞(0)|评价(0)|浏览(280)

本文整理了Java中org.apache.abdera.model.Element.clone()方法的一些代码示例,展示了Element.clone()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Element.clone()方法的具体详情如下:
包路径:org.apache.abdera.model.Element
类名称:Element
方法名:clone

Element.clone介绍

暂无

代码示例

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.abdera

  1. public Object clone() {
  2. try {
  3. ElementWrapper wrapper = (ElementWrapper) super.clone();
  4. wrapper.internal = (Element) internal.clone();
  5. return wrapper;
  6. } catch (CloneNotSupportedException e) {
  7. // won't happen
  8. return null;
  9. }
  10. }

代码示例来源:origin: org.apache.abdera/abdera-core

  1. public Object clone() {
  2. try {
  3. ElementWrapper wrapper = (ElementWrapper)super.clone();
  4. wrapper.internal = (Element)internal.clone();
  5. return wrapper;
  6. } catch (CloneNotSupportedException e) {
  7. // won't happen
  8. return null;
  9. }
  10. }

代码示例来源:origin: org.apache.abdera/abdera-parser

  1. public Object clone() {
  2. Document<T> doc = ((FOMFactory)factory).newDocument();
  3. OMDocument omdoc = (OMDocument)doc;
  4. for (Iterator i = getChildren(); i.hasNext();) {
  5. OMNode node = (OMNode)i.next();
  6. switch (node.getType()) {
  7. case OMNode.COMMENT_NODE:
  8. OMComment comment = (OMComment)node;
  9. factory.createOMComment(omdoc, comment.getValue());
  10. break;
  11. // TODO: Decide what to do with this code; it will no longer work in Axiom 1.2.14 (because of AXIOM-437).
  12. // On the other hand, since we filter out DTDs, this code is never triggered.
  13. // case OMNode.DTD_NODE:
  14. // OMDocType doctype = (OMDocType)node;
  15. // factory.createOMDocType(omdoc, doctype.getValue());
  16. // break;
  17. case OMNode.ELEMENT_NODE:
  18. Element el = (Element)node;
  19. omdoc.addChild((OMNode)el.clone());
  20. break;
  21. case OMNode.PI_NODE:
  22. OMProcessingInstruction pi = (OMProcessingInstruction)node;
  23. factory.createOMProcessingInstruction(omdoc, pi.getTarget(), pi.getValue());
  24. break;
  25. }
  26. }
  27. return doc;
  28. }

代码示例来源:origin: org.apache.abdera/abdera-filesystem

  1. public ResponseContext postEntry(RequestContext request) {
  2. if (request.isAtom()) {
  3. try {
  4. Entry entry = (Entry)request.getDocument().getRoot().clone();
  5. String key = createKey(request);
  6. setEditDetail(request, entry, key);
  7. File file = getFile(key);
  8. FileOutputStream out = new FileOutputStream(file);
  9. entry.writeTo(out);
  10. String edit = entry.getEditLinkResolvedHref().toString();
  11. return ProviderHelper.returnBase(entry.getDocument(), 201, null).setLocation(edit);
  12. } catch (Exception e) {
  13. return ProviderHelper.badrequest(request);
  14. }
  15. } else {
  16. return ProviderHelper.notsupported(request);
  17. }
  18. }

代码示例来源:origin: org.apache.abdera/abdera-filesystem

  1. public ResponseContext putEntry(RequestContext request) {
  2. if (request.isAtom()) {
  3. try {
  4. Entry entry = (Entry)request.getDocument().getRoot().clone();
  5. String key = request.getTarget().getParameter("entry");
  6. setEditDetail(request, entry, key);
  7. File file = getFile(key, false);
  8. FileOutputStream out = new FileOutputStream(file);
  9. entry.writeTo(out);
  10. String edit = entry.getEditLinkResolvedHref().toString();
  11. return ProviderHelper.returnBase(entry.getDocument(), 200, null).setLocation(edit);
  12. } catch (Exception e) {
  13. return ProviderHelper.badrequest(request);
  14. }
  15. } else {
  16. return ProviderHelper.notsupported(request);
  17. }
  18. }

代码示例来源:origin: net.sf.taverna.t2.activities/interaction-activity

  1. @Override
  2. public ResponseContext postEntry(final RequestContext request) {
  3. if (request.isAtom()) {
  4. try {
  5. final Entry entry = (Entry) request.getDocument().getRoot()
  6. .clone();
  7. final String key = this.createKey(request);
  8. this.setEditDetail(request, entry, key);
  9. final File file = this.getFile(key);
  10. final FileOutputStream out = new FileOutputStream(file);
  11. entry.writeTo(out);
  12. final String edit = entry.getEditLinkResolvedHref().toString();
  13. return ProviderHelper
  14. .returnBase(entry.getDocument(), 201, null)
  15. .setLocation(edit);
  16. } catch (final Exception e) {
  17. return ProviderHelper.badrequest(request);
  18. }
  19. } else {
  20. return ProviderHelper.notsupported(request);
  21. }
  22. }

代码示例来源:origin: net.sf.taverna.t2.activities/interaction-activity

  1. @Override
  2. public ResponseContext putEntry(final RequestContext request) {
  3. if (request.isAtom()) {
  4. try {
  5. final Entry entry = (Entry) request.getDocument().getRoot()
  6. .clone();
  7. final String key = request.getTarget().getParameter("entry");
  8. this.setEditDetail(request, entry, key);
  9. final File file = this.getFile(key, false);
  10. final FileOutputStream out = new FileOutputStream(file);
  11. entry.writeTo(out);
  12. final String edit = entry.getEditLinkResolvedHref().toString();
  13. return ProviderHelper
  14. .returnBase(entry.getDocument(), 200, null)
  15. .setLocation(edit);
  16. } catch (final Exception e) {
  17. return ProviderHelper.badrequest(request);
  18. }
  19. } else {
  20. return ProviderHelper.notsupported(request);
  21. }
  22. }

代码示例来源:origin: org.apache.abdera/abdera-security

  1. @SuppressWarnings("unchecked")
  2. private <T extends Element> T _sign(T element, SignatureOptions options) throws XMLSecurityException {
  3. element.setBaseUri(element.getResolvedBaseUri());
  4. org.w3c.dom.Element dom = fomToDom((Element)element.clone(), options);
  5. org.w3c.dom.Document domdoc = dom.getOwnerDocument();
  6. PrivateKey signingKey = options.getSigningKey();

相关文章