org.apache.axiom.om.OMFactory.createOMComment()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(4.9k)|赞(0)|评价(0)|浏览(70)

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

OMFactory.createOMComment介绍

[英]Creates a comment.
[中]创建一条评论。

代码示例

代码示例来源:origin: org.apache.ws.commons.axiom/om-aspects

protected void createOMComment(OMContainer parent, String content) {
  factory.createOMComment(parent, content);
}

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

public <T extends Base> T addComment(String value) {
  factory.createOMComment(this, value);
  return (T)this;
}

代码示例来源:origin: org.apache.ws.commons.axiom/axiom-impl

protected void createOMComment(OMContainer parent, String content) {
  factory.createOMComment(parent, content);
}

代码示例来源:origin: org.springframework.ws/org.springframework.ws

public void comment(char ch[], int start, int length) throws SAXException {
  String content = new String(ch, start, length);
  OMContainer parent = getParent();
  factory.createOMComment(parent, content);
}

代码示例来源:origin: wso2/wso2-synapse

/**
   * Serialze comment String into a OMComment node and add to the parent OMElement
   *
   * @param parent  OMElement of parent
   * @param comment String comment to be serialized
   * @return Serialized OMComment node
   */
  public static OMComment serializeComment(OMElement parent, String comment) {
    OMComment omComment = fac.createOMComment(null, comment);
    if (parent != null) {
      parent.addChild(omComment);
    }

    return omComment;
  }
}

代码示例来源:origin: wso2/wso2-synapse

/**
 * Serialize String Comment entries from a List
 *
 * @param parent      OMElement to be updated
 * @param commentList List of comment entries to be serialized
 */
protected void serializeComments(OMElement parent, List<String> commentList) {
  for (String comment : commentList) {
    OMComment commendNode = fac.createOMComment(parent, "comment");
    commendNode.setValue(comment);
    parent.addChild(commendNode);
  }
}

代码示例来源:origin: org.ballerinalang/ballerina-core

/**
 * Create a comment type BXML.
 *
 * @param content Comment content
 * @return BXML Comment type BXML
 */
public static BXML<?> createXMLComment(String content) {
  OMComment omComment = OM_FACTORY.createOMComment(OM_FACTORY.createOMDocument(), content);
  return new BXMLItem(omComment);
}

代码示例来源:origin: wso2/wso2-synapse

/**
 * Serialize given comment text list to OMComment Nodes and add to the definition
 *
 * @param definitions  OMElement Structure for the configuration
 * @param commentsList List of Comment Texts
 */
private static void serializeComments(OMElement definitions,
                   List<String> commentsList) {
  for (String comment : commentsList) {
    OMComment commentNode = fac.createOMComment(definitions, "comment");
    commentNode.setValue(comment);
    definitions.addChild(commentNode);
  }
}

代码示例来源:origin: wso2/wso2-synapse

/**
   * Serialize String  Comment entries from a List
   *
   * @param parent OMElement to be updated
   * @param m      Comment mediator instance which contains comment information
   */
  protected OMElement serializeComments(OMElement parent, Mediator m) {
    OMComment commendNode = fac.createOMComment(parent, "comment");
    commendNode.setValue(((CommentMediator) m).getCommentText());
    parent.addChild(commendNode);
    return parent;
  }
}

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

public <X extends Base> X addComment(String value) {
  OMComment comment = this.factory.createOMComment(null, value);
  if (this.getOMDocumentElement() != null) {
    this.getOMDocumentElement().insertSiblingBefore(comment);
  } else {
    this.addChild(comment);
  }
  return (X)this;
}

代码示例来源: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: usnistgov/iheos-toolkit2

MetadataSupport.om_factory.createOMComment(site_ele, "Patient ID allocation service to use with this site");
OMElement pida_ele = MetadataSupport.om_factory.createOMElement("PidAllocateEndpoint", null);
pida_ele.setText(s.pidAllocateURI);

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

} else if (node.getType() == OMNode.COMMENT_NODE) {
  OMComment comment = (OMComment)node;
  factory.createOMComment(dest, comment.getValue());
} else if (node.getType() == OMNode.PI_NODE) {
  OMProcessingInstruction pi = (OMProcessingInstruction)node;

代码示例来源:origin: org.bluestemsoftware.open.eoa.ext/open-eoa-aspect-axiom

OMComment newComment = this.factory.createOMComment(this,
                          importedComment.getValue());
DocumentImpl doc;

相关文章