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

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

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

OMNode.build介绍

[英]Builds itself with the OMText binary content. AXIOM supports two levels of deffered building. First is deffered building of AXIOM using StAX. Second level is the deffered building of attachments. AXIOM reads in the attachements from the stream only when user asks by calling getDataHandler(). build() method builds the OM without the attachments. buildAll() builds the OM together with attachement data. This becomes handy when user wants to free the input stream.
[中]使用OMText二进制内容构建自身。AXIOM支持两层不同的建筑。首先是使用StAX对AXIOM进行不同的构建。第二个层次是附件的不同构建。AXIOM仅当用户通过调用getDataHandler()请求时才从流中读取附件。build()方法生成不带附件的OM。buildAll()将OM与附加数据一起构建。当用户想要释放输入流时,这变得很方便。

代码示例

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

/**
 * {@inheritDoc}
 */
@Override
public void build() {
  this.omNode.build();
}

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

public String getDocumentation() {
  if (documentation != null) {
    if (documentation instanceof OMText) {
      return ((OMText)documentation).getText();
    } else if (documentation instanceof OMElement) {
      StringWriter writer = new StringWriter();
      documentation.build();
      try {
        ((OMElement)documentation).serialize(writer);
      } catch (XMLStreamException e) {
        log.error(e);
      }
      writer.flush();
      return writer.toString();
    }
  }
  return null;
}

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

public String getDocumentation() {
  if (documentation != null) {
    if (documentation instanceof OMText) {
      return ((OMText)documentation).getText();
    } else if (documentation instanceof OMElement) {
      StringWriter writer = new StringWriter();
      documentation.build();
      try {
        ((OMElement)documentation).serialize(writer);
      } catch (XMLStreamException e) {
        log.error(e);
      }
      writer.flush();
      return writer.toString();
    }
  }
  return null;
}

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

/**
 * Converts a given inputstream to an OMNode
 * The reurned OMNode is fully built if buildAll is true.
 * If buildAll is false, the caller is responsible for closing the parser.
 *
 * @param inputStream
 * @param buildAll
 * @return OMNode
 * @throws javax.xml.stream.XMLStreamException
 *
 */
public static OMNode toOM(InputStream inputStream, boolean buildAll) throws XMLStreamException {
  OMXMLParserWrapper builder = OMXMLBuilderFactory.createOMBuilder(inputStream);
  OMNode omNode = builder.getDocumentElement();
  
  if (buildAll) {
    omNode.build();
    builder.close();
  }
  
  return omNode;
}

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

/**
   * Converts a given Reader to an OMNode.
   * The reurned OMNode is fully built if buildAll is true.
   * If buildAll is false, the caller is responsible for closing the parser.
   *
   * @param reader
   * @param buildAll
   * @return OMNode
   * @throws XMLStreamException
   */
  public static OMNode toOM(Reader reader, boolean buildAll) throws XMLStreamException {
    OMXMLParserWrapper builder = OMXMLBuilderFactory.createOMBuilder(reader);
    OMNode omNode = builder.getDocumentElement();
    
    if (buildAll) {
      omNode.build();
      builder.close();
    }
    
    return omNode;
  }
}

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

/**
   * Converts a given Reader to an OMNode.
   * The reurned OMNode is fully built if buildAll is true.
   * If buildAll is false, the caller is responsible for closing the parser.
   *
   * @param reader
   * @param buildAll
   * @return OMNode
   * @throws XMLStreamException
   */
  public static OMNode toOM(Reader reader, boolean buildAll) throws XMLStreamException {
    OMXMLParserWrapper builder = OMXMLBuilderFactory.createOMBuilder(reader);
    OMNode omNode = builder.getDocumentElement();
    
    if (buildAll) {
      omNode.build();
      builder.close();
    }
    
    return omNode;
  }
}

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

/**
 * Converts a given inputstream to an OMNode
 * The reurned OMNode is fully built if buildAll is true.
 * If buildAll is false, the caller is responsible for closing the parser.
 *
 * @param inputStream
 * @param buildAll
 * @return OMNode
 * @throws javax.xml.stream.XMLStreamException
 *
 */
public static OMNode toOM(InputStream inputStream, boolean buildAll) throws XMLStreamException {
  OMXMLParserWrapper builder = OMXMLBuilderFactory.createOMBuilder(inputStream);
  OMNode omNode = builder.getDocumentElement();
  
  if (buildAll) {
    omNode.build();
    builder.close();
  }
  
  return omNode;
}

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

((OMNode)pa).build();

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

public static void removeChildren(IContainer that) {
    boolean updateState;
    if (that.getState() == IParentNode.INCOMPLETE && that.getBuilder() != null) {
      OMNode lastKnownChild = that.getLastKnownOMChild();
      if (lastKnownChild != null) {
        lastKnownChild.build();
      }
      ((StAXOMBuilder)that.getBuilder()).discard(that);
      updateState = true;
    } else {
      updateState = false;
    }
    IChildNode child = (IChildNode)that.getFirstOMChildIfAvailable();
    while (child != null) {
      IChildNode nextSibling = (IChildNode)child.getNextOMSiblingIfAvailable();
      child.setPreviousOMSibling(null);
      child.setNextOMSibling(null);
      child.setParent(null);
      child = nextSibling;
    }
    that.setFirstChild(null);
    that.setLastChild(null);
    if (updateState) {
      that.setComplete(true);
    }
  }
}

相关文章