public static OMFactory getOMFactory() { return new OMDOMFactory(); }
public ElementImpl(OMFactory factory) { super(factory); this.ownerNode = ((OMDOMFactory) factory).getDocument(); }
/** * Serialize the given node to a String. * * @param node Node to be serialized. * @return The serialized node as a java.lang.String instance. */ public static String nodeToString(Node node) { if (importerDoc == null) { OMDOMFactory fac = new OMDOMFactory(); importerDoc = (Document) fac.createOMDocument(); } // Import the node as an AXIOM-DOOM node and use toSting() Node axiomNode = importerDoc.importNode(node, true); return axiomNode.toString(); }
public void applyPolicy(AxisDescription axisDescription, Element policy) { try { OMElement policyElement = (OMElement) new OMDOMFactory().getDocument().importNode(policy, true); axisDescription.applyPolicy(PolicyEngine.getPolicy(policyElement)); } catch (Exception e) { // TODO Handle exception properly throw new AssertionError(e); } }
public Document createDocument(String namespaceURI, String qualifiedName, DocumentType doctype) throws DOMException { // TODO Handle docType stuff OMDOMFactory fac = new OMDOMFactory(); DocumentImpl doc = new DocumentImpl(fac); fac.setDocument(doc); new ElementImpl(doc, DOMUtil.getLocalName(qualifiedName), new NamespaceImpl(namespaceURI, DOMUtil .getPrefix(qualifiedName)), fac); return doc; }
public DocumentImpl getDocument() { return (DocumentImpl) this.createOMDocument(); }
/** @param ownerDocument */ public DocumentImpl(DocumentImpl ownerDocument, OMFactory factory) { super(ownerDocument, factory); ((OMDOMFactory) factory).setDocument(this); this.done = true; }
/** * Create an OMElement with the given QName * <p/> * If the QName contains a prefix, we will ensure that an OMNamespace is created mapping the * given namespace to the given prefix. If no prefix is passed, we'll create a generated one. * * @param qname * @return the new OMElement. */ public OMElement createOMElement(QName qname) throws OMException { return createOMElement(qname, null); }
public OMText createOMText(OMContainer parent, String text, int type) { OMText textNode = createOMText(parent, text); ((OMNodeEx) textNode).setType(type); return textNode; }
OMElement receivedKeyInfoElem = (OMElement) new OMDOMFactory().getDocument().importNode(keyInfo, true);
public OMElement createOMElement(String localName, OMNamespace ns) { return new ElementImpl((DocumentImpl) this.createOMDocument(), localName, (NamespaceImpl) ns, this); }
public DocumentImpl(OMFactory factory) { super(factory); ((OMDOMFactory) factory).setDocument(this); this.done = true; }
/** * Creates an OMElement. * * @see org.apache.axiom.om.OMFactory#createOMElement(String, String, * String) */ public OMElement createOMElement(String localName, String namespaceURI, String namespacePrefix) { NamespaceImpl ns = new NamespaceImpl(namespaceURI, namespacePrefix); return this.createOMElement(localName, ns); }
OMElement receivedKeyInfoElem = (OMElement) new OMDOMFactory().getDocument().importNode(keyInfo, true);
/** * Returns a new document impl. * * @see javax.xml.parsers.DocumentBuilder#newDocument() */ public Document newDocument() { OMDOMFactory factory = new OMDOMFactory(); DocumentImpl documentImpl = new DocumentImpl(factory); documentImpl.setComplete(true); return documentImpl; }
public SOAPHeaderBlockImpl(String localName, OMNamespace ns, SOAPFactory factory) throws SOAPProcessingException { super(((OMDOMFactory) factory).getDocument(), localName, (NamespaceImpl) ns, factory); this.setNamespace(ns); }
public OMElement createOMElement(String localName, OMNamespace ns, OMContainer parent) throws OMDOMException { if (parent == null) { return new ElementImpl((DocumentImpl) this.createOMDocument(), localName, (NamespaceImpl) ns, this); } switch (((ParentNode) parent).getNodeType()) { case Node.ELEMENT_NODE: // We are adding a new child to an elem ElementImpl parentElem = (ElementImpl) parent; ElementImpl elem = new ElementImpl((DocumentImpl) parentElem .getOwnerDocument(), localName, (NamespaceImpl) ns, this); parentElem.appendChild(elem); return elem; case Node.DOCUMENT_NODE: DocumentImpl docImpl = (DocumentImpl) parent; return new ElementImpl(docImpl, localName, (NamespaceImpl) ns, this); case Node.DOCUMENT_FRAGMENT_NODE: DocumentFragmentImpl docFragImpl = (DocumentFragmentImpl) parent; return new ElementImpl((DocumentImpl) docFragImpl .getOwnerDocument(), localName, (NamespaceImpl) ns, this); default: throw new OMDOMException( "The parent container can only be an ELEMENT, DOCUMENT " + "or a DOCUMENT FRAGMENT"); } }
public DocumentImpl(OMXMLParserWrapper parserWrapper, OMFactory factory) { super(factory); this.builder = parserWrapper; ((OMDOMFactory) factory).setDocument(this); }
/** * Creates a new OMDOM Element node and adds it to the given parent. * * @see #createOMElement(String, OMNamespace, OMContainer) * @see org.apache.axiom.om.OMFactory#createOMElement( javax.xml.namespace.QName, * org.apache.axiom.om.OMContainer) */ public OMElement createOMElement(QName qname, OMContainer parent) throws OMException { NamespaceImpl ns; if (qname.getPrefix() != null) { ns = new NamespaceImpl(qname.getNamespaceURI(), qname.getPrefix()); } else { ns = new NamespaceImpl(qname.getNamespaceURI()); } return createOMElement(qname.getLocalPart(), ns, parent); }
rsaKey = val.getRSAKeyValue(); elem = rsaKey.getDOM(); omElem = (OMElement) new OMDOMFactory().getDocument().importNode(elem, true); modElem = (Element) omElem.getFirstChildWithName(Modulus.DEFAULT_ELEMENT_NAME); expElem = (Element) omElem.getFirstChildWithName(Exponent.DEFAULT_ELEMENT_NAME);