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

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

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

OMElement.build介绍

暂无

代码示例

代码示例来源:origin: org.wso2.carbon.automationutils/org.wso2.carbon.integration.common.utils

private static OMElement buildResponse(OMElement omElement) {
    omElement.build();
    return omElement;
  }
}

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

/**
 * Creates OMElement for a given description document (axis2.xml ,
 * services.xml and module.xml).
 *
 * @return Returns <code>OMElement</code> .
 * @throws javax.xml.stream.XMLStreamException
 *
 */
public OMElement buildOM() throws XMLStreamException {
  OMElement element = (OMElement) XMLUtils.toOM(descriptionStream);
  element.build();
  return element;
}

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

/**
 * Creates OMElement for a given description document (axis2.xml ,
 * services.xml and module.xml).
 *
 * @return Returns <code>OMElement</code> .
 * @throws javax.xml.stream.XMLStreamException
 *
 */
public OMElement buildOM() throws XMLStreamException {
  OMElement element = (OMElement) XMLUtils.toOM(descriptionStream);
  element.build();
  return element;
}

代码示例来源:origin: org.wso2.carbon.governance/org.wso2.carbon.governance.lcm

public static OMElement buildOMElement(String payload) throws RegistryException {
  OMElement element;
  try {
    element = AXIOMUtil.stringToOM(payload);
    element.build();
  } catch (Exception e) {
    String message = "Unable to parse the XML configuration. Please validate the XML configuration";
    log.error(message,e);
    throw new RegistryException(message,e);
  }
  return element;
}

代码示例来源:origin: org.wso2.carbon.governance/org.wso2.carbon.governance.registry.extensions

public static OMElement getServiceOMElement(Resource newResource) {
  try {
    String content = getResourceContent(newResource);
    XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(
        new StringReader(content));
    StAXOMBuilder builder = new StAXOMBuilder(reader);
    OMElement serviceElement = builder.getDocumentElement();
    serviceElement.build();
    return serviceElement;
  } catch (Exception e) {
    log.error("Error in parsing the resource content");
  }
  return null;
}

代码示例来源:origin: holodeck-b2b/Holodeck-B2B

/**
   * Converts the DOM representation of an Element to the Axiom one.
   *
   * @param element   The DOM representation of the element
   * @return          The Axiom representation of the same element
   */
  public static OMElement convertDOMElementToAxiom(final Element element) {
    OMXMLParserWrapper parser = OMXMLBuilderFactory.createOMBuilder(element, false);
    OMElement omElement = parser.getDocumentElement();
    omElement.build();
    return omElement;
  }
}

代码示例来源:origin: deegree/deegree3

private void loadRecord( File recordFile ) throws IOException {
  FileInputStream recordStream = new FileInputStream( recordFile );
  OMElement document = new XMLAdapter( recordStream ).getRootElement();
  document.build();
  MetadataRecord record = MetadataRecordFactory.create( document );
  recordStream.close();
  if ( !( record instanceof ISORecord ) ) {
    LOG.debug( "Ignore record {}: is not a ISO19139 record.", recordFile.getName() );
    return;
  }
  addOrUpdateRecord( (ISORecord) record, recordFile );
}

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

/**
 * Convert servicexmlStream to OMElement
 *
 * @param servicexmlStream InputStream contain xml content
 * @return OMElement format of the xml content
 * @throws XMLStreamException
 */
public static OMElement convertToOMElement(InputStream servicexmlStream)
    throws XMLStreamException, OMException{
  OMElement element = null;
  element = OMXMLBuilderFactory.createOMBuilder(servicexmlStream).getDocumentElement();
  element.build();
  return element;
}

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

/**
 * Convert servicexmlStream to OMElement
 *
 * @param servicexmlStream InputStream contain xml content
 * @return OMElement format of the xml content
 * @throws XMLStreamException
 */
public static OMElement convertToOMElement(InputStream servicexmlStream)
    throws XMLStreamException, OMException{
  OMElement element = null;
  element = OMXMLBuilderFactory.createOMBuilder(servicexmlStream).getDocumentElement();
  element.build();
  return element;
}

代码示例来源:origin: wso2/carbon-identity-framework

public XmlConfiguration(InputStream xmlFile, String serverNamespace) throws CarbonException {
  if (serverNamespace != null) {
    this.serverNamespace = serverNamespace;
  }
  try {
    builder = new StAXOMBuilder(xmlFile);
    builder.getDocumentElement().build();
  } catch (Exception e) {
    String msg =
        "Error occurred while trying to instantiate StAXOMBuilder for XML file " +
            xmlFile;
    log.error(msg, e);
    throw new CarbonException(msg, e);
  }
}

代码示例来源:origin: org.wso2.carbon.identity.framework/org.wso2.carbon.security.mgt

public XmlConfiguration(String xmlFile, String serverNamespace) throws CarbonException {
  if (serverNamespace != null) {
    this.serverNamespace = serverNamespace;
  }
  try {
    builder = new StAXOMBuilder(xmlFile);
    builder.getDocumentElement().build();
  } catch (Exception e) {
    String msg =
        "Error occurred while trying to instantiate StAXOMBuilder for XML file " +
            xmlFile;
    log.error(msg, e);
    throw new CarbonException(msg, e);
  }
}

代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.security.mgt

public XmlConfiguration(String xmlFile, String serverNamespace) throws CarbonException {
  if (serverNamespace != null) {
    this.serverNamespace = serverNamespace;
  }
  try {
    builder = new StAXOMBuilder(xmlFile);
    builder.getDocumentElement().build();
  } catch (Exception e) {
    String msg =
        "Error occurred while trying to instantiate StAXOMBuilder for XML file " +
            xmlFile;
    log.error(msg, e);
    throw new CarbonException(msg, e);
  }
}

代码示例来源:origin: org.wso2.carbon.identity.framework/org.wso2.carbon.security.mgt

public XmlConfiguration(InputStream xmlFile, String serverNamespace) throws CarbonException {
  if (serverNamespace != null) {
    this.serverNamespace = serverNamespace;
  }
  try {
    builder = new StAXOMBuilder(xmlFile);
    builder.getDocumentElement().build();
  } catch (Exception e) {
    String msg =
        "Error occurred while trying to instantiate StAXOMBuilder for XML file " +
            xmlFile;
    log.error(msg, e);
    throw new CarbonException(msg, e);
  }
}

代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.security.mgt

public XmlConfiguration(InputStream xmlFile, String serverNamespace) throws CarbonException {
  if (serverNamespace != null) {
    this.serverNamespace = serverNamespace;
  }
  try {
    builder = new StAXOMBuilder(xmlFile);
    builder.getDocumentElement().build();
  } catch (Exception e) {
    String msg =
        "Error occurred while trying to instantiate StAXOMBuilder for XML file " +
            xmlFile;
    log.error(msg, e);
    throw new CarbonException(msg, e);
  }
}

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

/**
 * This will build a DOOM Element that is of the same <code>Document</code>
 * @param factory
 * @param element
 * @return
 */
public static OMElement toDOOM(OMFactory factory, OMElement element){
  StAXOMBuilder builder = new StAXOMBuilder(factory, element.getXMLStreamReader());
  OMElement elem = builder.getDocumentElement();
  elem.build();
  return elem;
}

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

public static SynapseConfiguration getConfiguration(InputStream is, Properties properties)
      throws XMLStreamException {

    log.info("Generating the Synapse configuration model by parsing the XML configuration");
    
    OMElement definitions = OMXMLBuilderFactory.createOMBuilder(is).getDocumentElement();
    definitions.build();

    return ConfigurationFactoryAndSerializerFinder.getInstance()
        .getConfiguration(definitions, properties);
    
  }
}

代码示例来源:origin: org.wso2.carbon.data/org.wso2.carbon.dataservices.core

/**
 * Creates a new OMElement from the given element and build it and return.
 *
 * @param result The object to be cloned and built
 * @return The new cloned and built OMElement
 */
public static OMElement cloneAndReturnBuiltElement(OMElement result) {
  StAXOMBuilder builder = new StAXOMBuilder(result.getXMLStreamReaderWithoutCaching());
  result = builder.getDocumentElement();
  result.build();
  return result;
}

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

public static SynapseConfiguration getConfiguration(InputStream is, Properties properties)
      throws XMLStreamException {

    log.info("Generating the Synapse configuration model by parsing the XML configuration");
    
    OMElement definitions = new StAXOMBuilder(is).getDocumentElement();
    definitions.build();

    return ConfigurationFactoryAndSerializerFinder.getInstance()
        .getConfiguration(definitions, properties);
    
  }
}

代码示例来源:origin: org.wso2.xkms/xkms

/**
 * Gets an llom element and returns a doom element
 * 
 * @param body
 * @return OMElement
 */
public static DOOMElementMetadata getDOOMElement(OMElement body) {
  body.build();
  XMLStreamReader xmlStreamReader = body.getXMLStreamReader();
  OMFactory fac = DOOMAbstractFactory.getOMFactory();
  StAXOMBuilder builder = new StAXOMBuilder(fac, xmlStreamReader);
  return new DOOMElementMetadata(builder.getDocumentElement(),
      (OMDOMFactory) fac);
}

代码示例来源:origin: org.apache.airavata/messenger-client

public Iterator<OMElement> execute() throws AxisFault {
  OMElement message = createMessageEl(this.msgBoxId);
  ServiceClient serviceClient = createServiceClient(message);
  OMElement responseMessage = null;
  try {
    responseMessage = serviceClient.sendReceive(message);
    if (responseMessage == null) {
      throw AxisFault.makeFault(new RuntimeException("no response recieved for subscription message"));
    }
    responseMessage.build(); // free the input stream.
  } finally {
    serviceClient.cleanupTransport();
  }
  return (Iterator<OMElement>) responseMessage.getFirstElement().getChildren();
}

相关文章

微信公众号

最新文章

更多