/** * For internal use only. */ public StAXSOAPModelBuilder(OMMetaFactory metaFactory, XMLStreamReader parser, Detachable detachable, Closeable closeable) { super(metaFactory.getOMFactory(), parser, detachable, closeable); this.metaFactory = metaFactory; }
OMMetaFactory omMetaFactory = OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM); OMFactory omFac = omMetaFactory.getOMFactory(); OMXMLParserWrapper wrapper = OMXMLBuilderFactory.createOMBuilder(omFac, new FileInputStream("resources/test.xml")) ; Document doc = (Document) wrapper.getDocument();
/** * @deprecated Please use the {@link OMXMLBuilderFactory} API. */ public StAXSOAPModelBuilder(OMMetaFactory metaFactory, XMLStreamReader parser, String soapVersion) { super(metaFactory.getOMFactory(), parser); this.metaFactory = metaFactory; identifySOAPVersion(soapVersion); }
/** * 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(); }
public Source getSource(OMElement node) { return new DOMSource( ((Element) ElementHelper.importOMElement(node, OMAbstractFactory.getMetaFactory( OMAbstractFactory.FEATURE_DOM).getOMFactory())).getOwnerDocument()); }
/** * Create an object model builder that reads a plain XML document from the provided input stream * with a given parser configuration. * * @param configuration * the parser configuration to use * @param in * the input stream representing the XML document * @param encoding * the charset encoding of the XML document or <code>null</code> if the parser should * determine the charset encoding * @return the builder */ public static OMXMLParserWrapper createOMBuilder(StAXParserConfiguration configuration, InputStream in, String encoding) { OMMetaFactory metaFactory = OMAbstractFactory.getMetaFactory(); InputSource is = new InputSource(in); is.setEncoding(encoding); return metaFactory.createOMBuilder(metaFactory.getOMFactory(), configuration, is); }
/** * Create an object model builder that reads a plain XML document from the provided character * stream with a given parser configuration. * * @param configuration * the parser configuration to use * @param in * the character stream representing the XML document * @return the builder */ public static OMXMLParserWrapper createOMBuilder(StAXParserConfiguration configuration, Reader in) { OMMetaFactory metaFactory = OMAbstractFactory.getMetaFactory(); return metaFactory.createOMBuilder(metaFactory.getOMFactory(), configuration, new InputSource(in)); }
/** * 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); }
public TextImplEx(String data) { this(OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM).getOMFactory().createOMText(data)); }
public TextImplEx(String data) { this(OMAbstractFactory.getMetaFactory(OMAbstractFactory.FEATURE_DOM).getOMFactory().createOMText(data)); }
/** * Create an XOP aware model builder from the provided {@link Attachments} object and with a * given parser configuration. * * @param configuration * the parser configuration to use * @param attachments * an {@link Attachments} object that must have been created from an input stream * @return the builder * @throws OMException * if an error occurs while processing the content type information from the * {@link Attachments} object */ public static OMXMLParserWrapper createOMBuilder(StAXParserConfiguration configuration, Attachments attachments) { return createOMBuilder(OMAbstractFactory.getMetaFactory().getOMFactory(), configuration, attachments); }
/** * Create an object model builder that reads a plain XML document from the provided DOM tree. * * @param node * the DOM node; must be a {@link Node#DOCUMENT_NODE} or {@link Node#ELEMENT_NODE} * @param expandEntityReferences * Determines how {@link EntityReference} nodes are handled: * <ul> * <li>If the parameter is <code>false</code> then a single {@link OMEntityReference} * will be created for each {@link EntityReference}. The child nodes of * {@link EntityReference} nodes are not taken into account. * <li>If the parameter is <code>true</code> then no {@link OMEntityReference} nodes * are created and the children of {@link EntityReference} nodes are converted and * inserted into the Axiom tree. * </ul> * @return the builder */ public static OMXMLParserWrapper createOMBuilder(Node node, boolean expandEntityReferences) { OMMetaFactory metaFactory = OMAbstractFactory.getMetaFactory(); return metaFactory.createOMBuilder(metaFactory.getOMFactory(), node, expandEntityReferences); }
/** * @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(); }
/** * @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(); } }
/** * @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(); } }
/** * Gets the DOOM implementation of org.w3c.dom.Document * * @param omElement the OMelement * @return the DOOM document */ public static OMDocument convertOMtoDOM(OMContainer omElement) { // use an Axiom meta factory with feature "dom" to get org.w3c.dom.Document OMFactory doomFactory = OMAbstractFactory.getMetaFactory( OMAbstractFactory.FEATURE_DOM).getOMFactory(); OMXMLParserWrapper doomBuilder = OMXMLBuilderFactory.createStAXOMBuilder(doomFactory, omElement.getXMLStreamReader()); OMDocument domElement = doomBuilder.getDocument(); return domElement; }
/** * Gets the DOOM implementation of org.w3c.dom.Document * * @param omElement the OMelement * @return the DOOM document */ public static OMDocument convertOMtoDOM(OMContainer omElement) { // use an Axiom meta factory with feature "dom" to get org.w3c.dom.Document OMFactory doomFactory = OMAbstractFactory.getMetaFactory( OMAbstractFactory.FEATURE_DOM).getOMFactory(); OMXMLParserWrapper doomBuilder = OMXMLBuilderFactory.createStAXOMBuilder(doomFactory, omElement.getXMLStreamReader()); OMDocument domElement = doomBuilder.getDocument(); return domElement; }
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; }
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()); } }
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); }