Package org.kxml2.kdom

Examples of org.kxml2.kdom.Node


    /**
     * {@inheritDoc}
     */
    @Override
    protected XmlPullParser createParser() {
        return new KXmlParser();
    }
View Full Code Here


          }
        } else {
          in = url.openStream();
        }
        Reader reader = new InputStreamReader(in);
        XmlPullParser parser = new KXmlParser();
        parser.setInput(reader);
        parseRepository(parser);
      } catch( MalformedURLException e ) {
        System.out.println("Cannot create connection to url");
      }
    }
View Full Code Here

    private MappingDescriptor descriptors;
    boolean verified;
    private ClassDescriptor currentClassDescriptor;

    public ClassDescriptorReader() {
        this.parser = new KXmlParser();
        this.reset();
    }
View Full Code Here

    };

    private KXmlParser xmlParser;

    XmlReader() {
        this.xmlParser = new KXmlParser();
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    protected XmlPullParser createParser() {
        return new KXmlParser();
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    protected XmlPullParser createParser() {
        return new KXmlParser();
    }
View Full Code Here

    private MappingDescriptor descriptors;
    boolean verified;
    private ClassDescriptor currentClassDescriptor;

    public ClassDescriptorReader() {
        this.parser = new KXmlParser();
        this.reset();
    }
View Full Code Here

        }
    };
    private KXmlParser xmlParser;

    XmlReader() {
        this.xmlParser = new KXmlParser();
    }
View Full Code Here

     */
    public final void loadRegistry( InputStream inputStream )
        throws IOException, NPandayRepositoryException
    {

        KXmlParser parser = new KXmlParser();
        try
        {
            parser.setInput( inputStream, null );
        }
        catch ( XmlPullParserException e )
        {
            throw new IOException( e.toString() );
        }
        try
        {
            parser.nextTag();
            parser.require( XmlPullParser.START_TAG, null, "registry-config" );
            parser.nextTag();
            parser.require( XmlPullParser.START_TAG, null, "repositories" );

            while ( parser.nextTag() == XmlPullParser.START_TAG )
            {
                parser.require( XmlPullParser.START_TAG, null, "repository" );
                RepositoryObject rep = getRepositoryObject( parser );
                repositories.add( rep );               
            }
        }
        catch ( XmlPullParserException e )
View Full Code Here

    Node rootNode = null;
    Node currNode = null;
   
    try {
      InputStreamReader inReader = new InputStreamReader(inStream);
      KXmlParser xpp = new KXmlParser();
      xpp.setInput(inReader);
      int eventType = xpp.getEventType();
      while (eventType != org.xmlpull.v1.XmlPullParser.END_DOCUMENT) {
        switch (eventType) {
        case org.xmlpull.v1.XmlPullParser.START_TAG:
          {
            Node node = new Node();
            String nodeName = xpp.getName();
            node.setName(nodeName);
            int attrsLen = xpp.getAttributeCount();
            for (int n=0; n<attrsLen; n++) {
              String attrName = xpp.getAttributeName(n);
              String attrValue = xpp.getAttributeValue(n);
              node.setAttribute(attrName, attrValue);
            }
         
            if (currNode != null)
              currNode.addNode(node);
            currNode = node;
            if (rootNode == null)
              rootNode = node;
          }
          break;
        case org.xmlpull.v1.XmlPullParser.TEXT:
          {
            String value = xpp.getText();
            if (currNode != null)
              currNode.setValue(value);
          }
          break;
        case org.xmlpull.v1.XmlPullParser.END_TAG:
          {
            currNode = currNode.getParentNode();
          }
          break;
        }
        eventType = xpp.next();
      }
    }
    catch (Exception e) {
      throw new ParserException(e);
    }
View Full Code Here

TOP

Related Classes of org.kxml2.kdom.Node

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.