Package juzu

Examples of juzu.Response$Content


    public static String textValueOf(Element htmlElement) {
        List<Content> htmlContent = htmlElement.getContent();
        if(htmlContent.isEmpty()) {
            return null;
        }
        Content content = htmlContent.get(0);
        if(!(content instanceof Text)) {
            return null;
        }
        Text htmlText = (Text) content;
        return normalized(htmlText.getValue());
View Full Code Here


            //
            //  In many cases these are the same.  [linktext|linkref].
            //
            if( VariableManager.isVariableLink( linktext ) )
            {
                Content el = new VariableContent(linktext);

                addElement( el );
            }
            else if( isExternalLink( linkref ) )
            {
View Full Code Here

            int idxOfFirstContent = 0;
            int count = 0;

            for( Iterator i = kids.iterator(); i.hasNext(); count++ )
            {
                Content c = (Content) i.next();
                if( c instanceof Element )
                {
                    String name = ((Element)c).getName();
                    if( isBlockLevel(name) ) break;
                }

                if( !(c instanceof ProcessingInstruction) )
                {
                    ls.add( c );
                    if( idxOfFirstContent == 0 ) idxOfFirstContent = count;
                }
            }

            //
            //  If there were any elements, then add a new <p> (unless it would
            //  be an empty one)
            //
            if( ls.size() > 0 )
            {
                Element newel = new Element("p");

                for( Iterator i = ls.iterator(); i.hasNext(); )
                {
                    Content c = (Content) i.next();

                    c.detach();
                    newel.addContent(c);
                }

                //
                // Make sure there are no empty <p/> tags added.
View Full Code Here

    public static String textValueOf(Element htmlElement) {
        List<Content> htmlContent = htmlElement.getContent();
        if(htmlContent.isEmpty()) {
            return null;
        }
        Content content = htmlContent.get(0);
        if(!(content instanceof Text)) {
            return null;
        }
        Text htmlText = (Text) content;
        return normalized(htmlText.getValue());
View Full Code Here

TOP

Related Classes of juzu.Response$Content

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.