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

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

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

OMElement.getType介绍

暂无

代码示例

代码示例来源:origin: org.apache.axis2/axis2-saaj

/**
 * Returns the the value of the immediate child of this <code>Node</code> object if a child
 * exists and its value is text.
 *
 * @return a <code>String</code> with the text of the immediate child of this <code>Node</code>
 *         object if (1) there is a child and (2) the child is a <code>Text</code> object;
 *         <code>null</code> otherwise
 */
public String getValue() {
  if (omTarget.getType() == OMNode.TEXT_NODE) {
    return omTarget.getText();
  } else if (omTarget.getType() == OMNode.ELEMENT_NODE) {
    final OMNode firstOMChild = omTarget.getFirstOMChild();
    if (firstOMChild instanceof Text) {
      return ((Text)firstOMChild).getData();
    } else if (firstOMChild instanceof SOAPElementImpl) {
      return ((SOAPElement)firstOMChild).getValue();
    }
  }
  return null;
}

代码示例来源:origin: apache/axis2-java

/**
 * Returns the the value of the immediate child of this <code>Node</code> object if a child
 * exists and its value is text.
 *
 * @return a <code>String</code> with the text of the immediate child of this <code>Node</code>
 *         object if (1) there is a child and (2) the child is a <code>Text</code> object;
 *         <code>null</code> otherwise
 */
public String getValue() {
  if (omTarget.getType() == OMNode.TEXT_NODE) {
    return omTarget.getText();
  } else if (omTarget.getType() == OMNode.ELEMENT_NODE) {
    final OMNode firstOMChild = omTarget.getFirstOMChild();
    if (firstOMChild instanceof Text) {
      return ((Text)firstOMChild).getData();
    } else if (firstOMChild instanceof SOAPElementImpl) {
      return ((SOAPElement)firstOMChild).getValue();
    }
  }
  return null;
}

代码示例来源:origin: org.wso2.carbon/org.wso2.carbon.rulecep.adapters

int nodeType = result.getType();

相关文章

微信公众号

最新文章

更多