Package org.apache.axiom.om

Examples of org.apache.axiom.om.OMContainer


                        String value = StringFunction.evaluate(o, navigator);
                        IRI resolved = null;
                        IRI baseUri = null;
                        if (o instanceof OMNode) {
                            OMNode node = (OMNode)o;
                            OMContainer el = node.getParent();
                            if (el instanceof Document) {
                                Document<Element> doc = (Document<Element>)el;
                                baseUri = doc.getBaseUri();
                            } else if (el instanceof Element) {
                                Element element = (Element)el;
View Full Code Here


                String prefix = ns.getPrefix();
                String uri = ns.getNamespaceURI();
                if (!namespaces.containsKey(prefix))
                    namespaces.put(prefix, uri);
            }
            OMContainer parent = current.getParent();
            current = (OMElement)((parent != null && parent instanceof OMElement) ? parent : null);
        }
        return Collections.unmodifiableMap(namespaces);
    }
View Full Code Here

            String value = StringFunction.evaluate(o, navigator);
            IRI resolved = null;
            IRI baseUri = null;
            if (o instanceof OMNode) {
              OMNode node = (OMNode) o;
              OMContainer el = node.getParent();
              if (el instanceof Document) {
                Document<Element> doc = (Document<Element>) el;
                baseUri = doc.getBaseUri();
              } else if (el instanceof Element) {
                Element element = (Element) el;
View Full Code Here

      if (lastNode == null) {
          return null;
      } else if (!lastNode.isComplete()) {
          node = createOMText(value, (OMElement) lastNode, textType);
      } else {
          OMContainer parent = lastNode.getParent();
          if (!(parent instanceof OMDocument)) {
              node = createOMText(value, (OMElement) parent, textType);
          }
      }
      return node;
View Full Code Here

        String prefix = ns.getPrefix();
        String uri = ns.getNamespaceURI();
        if (!namespaces.containsKey(prefix))
          namespaces.put(prefix, uri);
      }
      OMContainer parent = current.getParent();
      current = (OMElement) ((parent != null && parent instanceof OMElement) ? parent : null);
    }
    return Collections.unmodifiableMap(namespaces);
  }
View Full Code Here

    protected void runTest() throws Throwable {
        OMXMLParserWrapper builder = metaFactory.createOMBuilder(metaFactory.getOMFactory(),
                TEST_PARSER_CONFIGURATION, new InputSource(file.getUrl().toString()));
        try {
            OMContainer container = containerFactory.getContainer(builder);
            // We need to clone the InputSource objects so that we can dump their contents
            // if the test fails
            InputSource control[] = duplicateInputSource(containerFactory.getControl(file.getAsStream()));
            InputSource actual[] = duplicateInputSource(serializationMethod.serialize(container));
            try {
                // Configure the InputSources such that external entities can be resolved
                String systemId = new URL(file.getUrl(), "dummy.xml").toString();
                control[0].setSystemId(systemId);
                actual[0].setSystemId(systemId);
                XMLAssert.assertXMLIdentical(XMLUnit.compareXML(control[0], actual[0]), true);
            } catch (Throwable ex) {
                System.out.println("Control:");
                dumpInputSource(control[1]);
                System.out.println("Actual:");
                dumpInputSource(actual[1]);
                throw ex;
            }
            if (serializationMethod.isCaching()) {
                assertTrue(container.isComplete());
            } else {
                // TODO: need to investigate why assertConsumed is not working here
                assertFalse(container.isComplete());
//                assertConsumed(element);
            }
        } finally {
            builder.close();
        }
View Full Code Here

                    }
                   
                }
               

                OMContainer o = om;
                while (o != null && o instanceof OMContainerEx) {
                    ((OMContainerEx)o).setComplete(true);
                    if ((o instanceof OMNode) &&
                            (((OMNode)o).getParent()) instanceof OMContainer) {
                        o = ((OMNode)o).getParent();
View Full Code Here

       
        if (log.isDebugEnabled()) {
            log.debug("Invoking CustomBuilder, " + customBuilder.toString() +
                      ", to the OMNode for {" + namespace + "}" + localPart);
        }
        OMContainer parent = null;
        if (lastNode != null) {
            if (lastNode.isComplete()) {
                parent = lastNode.getParent();
            } else {
                parent = (OMContainer)lastNode;
View Full Code Here

     *      java.lang.String, java.lang.String)
     */
    public void endElement(String arg0, String arg1, String arg2)
            throws SAXException {
        if (lastNode.isComplete()) {
            OMContainer parent = lastNode.getParent();
            ((OMNodeEx)parent).setComplete(true);
            lastNode = (OMNode) parent;
        } else {
            OMElement e = (OMElement) lastNode;
            ((OMNodeEx)e).setComplete(true);
View Full Code Here

          backtracked = true;
        } else {
          next = null;
        }
      } else {
        OMContainer parent = next.getParent();
        OMNode nextSibling = _getNextSibling(next);
        if (nextSibling != null) {
          next = nextSibling;
        } else if ((parent != null) && parent.isComplete() && !(parent instanceof OMDocument)) {
          next = (OMNodeImpl) parent;
          backtracked = true;
        } else {
          next = null;
        }
View Full Code Here

TOP

Related Classes of org.apache.axiom.om.OMContainer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.