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

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

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

OMAbstractFactory.getMetaFactory介绍

[英]Get the meta factory instance for the default Axiom implementation. This method is equivalent to #getMetaFactory(String) with #FEATURE_DEFAULT as parameter.
[中]获取默认Axiom实现的元工厂实例。此方法相当于以#FEATURE_DEFAULT作为参数的#getMetaFactory(String)。

代码示例

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

/**
 * @deprecated Please use the {@link OMXMLBuilderFactory} API.
 */
public StAXSOAPModelBuilder(XMLStreamReader parser, String soapVersion) {
  this(OMAbstractFactory.getMetaFactory(), parser, soapVersion);
}

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

/**
 * Get the meta factory instance for the default Axiom implementation. This method is equivalent
 * to {@link #getMetaFactory(String)} with {@link #FEATURE_DEFAULT} as parameter.
 * 
 * @return the meta factory instance for the default Axiom implementation
 * @throws OMException
 *             if no Axiom implementation with {@link #FEATURE_DEFAULT} could be located
 */
public static OMMetaFactory getMetaFactory() {
  return getMetaFactory(FEATURE_DEFAULT);
}

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

/**
 * @deprecated Please use the {@link OMXMLBuilderFactory} API.
 */
public StAXSOAPModelBuilder(XMLStreamReader parser) {
  this(OMAbstractFactory.getMetaFactory(), parser);
}

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

/**
 * Get the default SOAP 1.1 OM factory instance. This method has the same effect as calling
 * {@link OMMetaFactory#getSOAP11Factory()} on the {@link OMMetaFactory} instance returned by
 * {@link #getMetaFactory()}.
 *
 * @return the default SOAP 1.1 OM factory instance
 * @throws OMException if the factory's implementation class can't be found
 *                     or if the class can't be instantiated
 */
public static SOAPFactory getSOAP11Factory() {
  return getMetaFactory().getSOAP11Factory();
}

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

/**
 * Create an object model builder for SOAP that reads a message from the provided {@link Source}.
 * The method will select the appropriate {@link SOAPFactory} based on the namespace URI of
 * the SOAP envelope.
 * 
 * @param source
 *            the source of the SOAP message
 * @return the builder
 */
public static SOAPModelBuilder createSOAPModelBuilder(Source source) {
  return createSOAPModelBuilder(OMAbstractFactory.getMetaFactory(), source);
}

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

/**
 * Get the default OM factory instance. This method has the same effect as calling
 * {@link OMMetaFactory#getOMFactory()} on the {@link OMMetaFactory} instance returned by
 * {@link #getMetaFactory()}.
 *
 * @return the default OM factory instance
 * @throws OMException if the factory's implementation class can't be found
 *                     or if the class can't be instantiated
 */
public static OMFactory getOMFactory() {
  return getMetaFactory().getOMFactory();
}

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

/**
 * Create an object model builder for SOAP that reads a message from the provided character
 * stream. The method will select the appropriate {@link SOAPFactory} based on the namespace URI
 * of the SOAP envelope. It will configure the underlying parser as specified by
 * {@link StAXParserConfiguration#SOAP}.
 * 
 * @param in
 *            the character stream containing the SOAP message
 * @return the builder
 */
public static SOAPModelBuilder createSOAPModelBuilder(Reader in) {
  return createSOAPModelBuilder(OMAbstractFactory.getMetaFactory(), in);
}

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

/**
   * Get the default SOAP 1.2 OM factory instance. This method has the same effect as calling
   * {@link OMMetaFactory#getSOAP12Factory()} on the {@link OMMetaFactory} instance returned by
   * {@link #getMetaFactory()}.
   *
   * @return the default SOAP 1.2 OM factory instance
   * @throws OMException if the factory's implementation class can't be found
   *                     or if the class can't be instantiated
   */
  public static SOAPFactory getSOAP12Factory() {
    return getMetaFactory().getSOAP12Factory();
  }
}

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

public Result getResult() {
  DOMMetaFactory domMetaFactory
      = ((DOMMetaFactory)OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM));
  try {
    document = domMetaFactory.newDocumentBuilderFactory().newDocumentBuilder().newDocument();
  } catch (ParserConfigurationException e) {
    handleException("Unable to create empty DOOM document", e);
  }
  return new DOMResult(document);
}

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

public Source getSource(OMElement node) {
  return new DOMSource(
      ((Element) ElementHelper.importOMElement(node, OMAbstractFactory.getMetaFactory(
          OMAbstractFactory.FEATURE_DOM).getOMFactory())).getOwnerDocument());
}

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

/**
 * Create an object model builder that reads a plain XML document from the provided
 * {@link Source}. When used with a {@link DOMSource} or {@link SAXSource}, entities are
 * expanded, i.e. the method has the same behavior as {@link #createOMBuilder(Node, boolean)}
 * and {@link #createOMBuilder(SAXSource, boolean)} with {@code expandEntityReferences} set to
 * {@code true}.
 * 
 * @param source
 *            the source of the XML document
 * @return the builder
 */
public static OMXMLParserWrapper createOMBuilder(Source source) {
  OMMetaFactory metaFactory = OMAbstractFactory.getMetaFactory();
  return metaFactory.createOMBuilder(metaFactory.getOMFactory(), source);
}

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

public TextImplEx(String data) {
  this(OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM).getOMFactory().createOMText(data));
}

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

public static Element getElementFromAssertion(XMLObject xmlObj) throws TrustException {
  try {
    
    MarshallerFactory marshallerFactory = org.opensaml.xml.Configuration.getMarshallerFactory();
    Marshaller marshaller = marshallerFactory.getMarshaller(xmlObj);
    Element assertionElement = marshaller.marshall(xmlObj,
        ((DOMMetaFactory)OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM)).newDocumentBuilderFactory().newDocumentBuilder().newDocument());
    log.debug("DOM element is created successfully from the OpenSAML2 XMLObject");
    return assertionElement;
  } catch (Exception e) {
    throw new TrustException("Error creating DOM object from the assertion", e);
  }
}

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

/**
 * Create a DOM Document using the org.apache.axiom.soap.SOAPEnvelope
 *
 * @param env An org.apache.axiom.soap.SOAPEnvelope instance
 * @return the org.apache.axis2.soap.impl.dom.SOAPEnvelopeImpl of the given SOAP Envelope
 */
public static Element toDOOMSOAPEnvelope(org.apache.axiom.soap.SOAPEnvelope env) {
  return (Element)OMXMLBuilderFactory.createStAXSOAPModelBuilder(
      OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM),
      env.getXMLStreamReader()).getSOAPEnvelope();
}

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

/**
 * @param unattachedReference The unattachedReference to set.
 */
public void setUnattachedReference(OMElement unattachedReference) {
  if (unattachedReference != null) {
    OMMetaFactory metaFactory = OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM);
    this.unattachedReference =
      OMXMLBuilderFactory.createStAXOMBuilder(metaFactory.getOMFactory(),
          unattachedReference.getXMLStreamReader()).getDocumentElement();
  }
}

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

/**
 * @param presivousToken The presivousToken to set.
 */
public void setPreviousToken(OMElement presivousToken) {
  OMMetaFactory metaFactory = OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM);
  this.previousToken = OMXMLBuilderFactory.createStAXOMBuilder(metaFactory.getOMFactory(),
      presivousToken.getXMLStreamReader()).getDocumentElement();
}

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

/**
 * @param attachedReference The attachedReference to set.
 */
public void setAttachedReference(OMElement attachedReference) {
  if (attachedReference != null) {
    OMMetaFactory metaFactory = OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM);
    this.attachedReference =
      OMXMLBuilderFactory.createStAXOMBuilder(metaFactory.getOMFactory(),
          attachedReference.getXMLStreamReader()).getDocumentElement();
  }
}

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

public Token(String id, OMElement tokenElem, Date created, Date expires)
  throws TrustException {
  this.id = id;
  OMMetaFactory metaFactory = OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM);
  OMXMLStreamReaderConfiguration configuration = new OMXMLStreamReaderConfiguration();
  configuration.setNamespaceURIInterning(true);
  this.token = OMXMLBuilderFactory.createStAXOMBuilder(metaFactory.getOMFactory(),
      tokenElem.getXMLStreamReader(true, configuration)).getDocumentElement();
  this.created = created;
  this.expires = expires;
}

代码示例来源:origin: org.apache.neethi/neethi

public Element convert(OMElement s) {
  
  try {
    return (Element) OMXMLBuilderFactory.createStAXOMBuilder(
        OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM).getOMFactory(),
        s.getXMLStreamReader()).getDocumentElement();
  } catch (OMException err) {
    // likely no DOOM
    return new StaxToDOMConverter().convert(s.getXMLStreamReader());
  }
}

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

public Token(String id, OMElement tokenElem, OMElement lifetimeElem)
  throws TrustException {
  this.id = id;
  OMMetaFactory metaFactory = OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM);
  OMXMLStreamReaderConfiguration configuration = new OMXMLStreamReaderConfiguration();
  configuration.setNamespaceURIInterning(true);
  this.token = OMXMLBuilderFactory.createStAXOMBuilder(metaFactory.getOMFactory(),
      tokenElem.getXMLStreamReader(true, configuration)).getDocumentElement();
  this.processLifeTime(lifetimeElem);
}

相关文章