Package org.htmlparser.util

Examples of org.htmlparser.util.NodeList


                    PROP_CONNECTION_PROPERTY, conn, mParser.getConnection ());
                setNodes ();
            }
            catch (ParserException pe)
            {
                updateNodes (new NodeList ());
            }
        }
    }
View Full Code Here


                    PROP_CONNECTION_PROPERTY, conn, mParser.getConnection ());
                setNodes ();
            }
            catch (ParserException pe)
            {
                updateNodes (new NodeList ());
            }
        }
    }
View Full Code Here

     * @return The textual contents of the nodes that pass through the filter set,
     * as collected by the StringBean.
     */
    public String getText ()
    {
        NodeList list;
        StringBean sb;
        String ret;

        list = getNodes ();
        if (0 != list.size ())
        {
            sb = new StringBean ();
            for (int i = 0; i < list.size (); i++)
                list.elementAt (i).accept (sb);
            ret = sb.getStrings ();
        }
        else
            ret = "";
       
View Full Code Here

     * <code>false</code> otherwise.
     */
    public boolean accept (Node node)
    {
        CompositeTag tag;
        NodeList children;
        boolean ret;

        ret = false;
        if (node instanceof CompositeTag)
        {
            tag = (CompositeTag)node;
            children = tag.getChildren ();
            if (null != children)
            {
                for (int i = 0; !ret && i < children.size (); i++)
                    if (getChildFilter ().accept (children.elementAt (i)))
                        ret = true;
                // do recursion after all children are checked
                // to get breadth first traversal
                if (!ret && getRecursive ())
                    for (int i = 0; !ret && i < children.size (); i++)
                        if (accept (children.elementAt (i)))
                            ret = true;
            }
        }

        return (ret);
View Full Code Here

            mContentHandler.startElement (
                mParts[0], // uri
                mParts[1], // local
                mParts[2], // raw
                new Attributes (tag, mSupport, mParts));
            NodeList children = tag.getChildren ();
            if (null != children)
                for (int i = 0; i < children.size (); i++)
                    doSAX (children.elementAt (i));
            end = tag.getEndTag ();
            if (null != end)
            {
                if (mNameSpaces)
                    mSupport.processName (end.getTagName (), mParts, false);
View Full Code Here

        public boolean accept (Node n)
        {
            if (n.getParent () != null)
            {
                NodeList l = n.getParent ().getChildren ();
                for (int i = 0; i < l.size (); i++)
                    if (l.elementAt (i) == n && i > 0)
                        return (sibtest.accept (l.elementAt (i - 1)));
            }
            return (false);
        }
View Full Code Here

     * <code>false</code> otherwise.
     */
    public boolean accept (Node node)
    {
        Node parent;
        NodeList siblings;
        int count;
        boolean ret;

        ret = false;
        if (!(node instanceof Tag) || !((Tag)node).isEndTag ())
        {
            parent = node.getParent ();
            if (null != parent)
            {
                siblings = parent.getChildren ();
                if (null != siblings)
                {
                    count = siblings.size ();
                    for (int i = 0; !ret && (i < count); i++)
                        if (getSiblingFilter ().accept (siblings.elementAt (i)))
                            ret = true;
                }
            }
        }

View Full Code Here

    }

    public ObjectFindingVisitor(Class classTypeToFind,boolean recurse) {
        super(recurse, true);
        this.classTypeToFind = classTypeToFind;
        this.tags = new NodeList();
    }
View Full Code Here

    private NodeList tables;

    public HtmlPage(Parser parser) {
        super(true);
        title = "";
        nodesInBody = new NodeList();
        tables = new NodeList();
    }
View Full Code Here

     * Extract the object <code>PARAM</code> tags from the child list.
     * @return The list of object parameters (keys and values are String objects).
     */
    public Hashtable createObjectParamsTable ()
    {
        NodeList kids;
        Node node;
        Tag tag;
        String paramName;
        String paramValue;
        Hashtable ret;

        ret = new Hashtable ();
        kids = getChildren ();
        if (null != kids)
            for (int i = 0; i < kids.size (); i++)
            {
                node = children.elementAt(i);
                if (node instanceof Tag)
                {
                    tag = (Tag)node;
View Full Code Here

TOP

Related Classes of org.htmlparser.util.NodeList

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.