Package org.jdom

Examples of org.jdom.Content


    assertEquals("Tilden <b>Hike</b>", item.getTitle());
    assertEquals("A hike in Tilden Park...", item.getDescription());
  }

  public void testTrimContents() {
    Content whitespace = new Text(" \n\t\t");
    Content cdata = new CDATA("Test");
    List<Content> content;
    List newList;

    // Empty content list
    content = new ArrayList<Content>();
View Full Code Here


    }


    private Element getVariable(String name, Element env) {
        for (Iterator it = env.getContent().iterator(); it.hasNext();) {
            Content o = (Content) it.next();
            if (o instanceof Element && Utils.getAttributeValue("name", (Element) o).equals(name))
                return (Element) o;
        }
        return null;
    }
View Full Code Here

    public void fillTable(Table table) {
        table.removeAll();
        Element env = _process.getChild("environment", _dom.getNamespace());
        if (env != null) {
            for (Iterator it = env.getContent().iterator(); it.hasNext();) {
                Content o = (Content) it.next();
                if (o instanceof Element) {
                    Element var = (Element) o;
                    TableItem item = new TableItem(table, SWT.NONE);
                    item.setText(0, Utils.getAttributeValue("name", var));
                    item.setText(1, Utils.getAttributeValue("value", var));
View Full Code Here

            else {
              throw new NoSuchElementException("Somehow we lost our iterator");
            }
        }

        Content child = (Content) iterator.next();
        if (child instanceof Element) {
            nextIterator = ((Element)child).getContent().iterator();
        }
        return child;
    }
View Full Code Here

        if ( !shouldExist && ( element != null ) )
        {
            int index = parent.indexOf( element );
            if ( index > 0 )
            {
                Content previous = parent.getContent( index - 1 );
                if ( previous instanceof Text )
                {
                    Text txt = (Text) previous;
                    if ( txt.getTextTrim().length() == 0 )
                    {
View Full Code Here

public class StaxSerializer {
    public void writeDocument(Document doc, XMLStreamWriter writer) throws XMLStreamException {
        writer.writeStartDocument("1.0");

        for (Iterator itr = doc.getContent().iterator(); itr.hasNext();) {
            Content content = (Content)itr.next();

            if (content instanceof Element) {
                writeElement((Element)content, writer);
            }
        }
View Full Code Here

                writer.writeNamespace(elPrefix, elUri);
            }
        }

        for (Iterator itr = e.getContent().iterator(); itr.hasNext();) {
            Content n = (Content)itr.next();
            if (n instanceof CDATA) {
                writer.writeCData(n.getValue());
            } else if (n instanceof Text) {
                writer.writeCharacters(((Text)n).getText());
            } else if (n instanceof Element) {
                writeElement((Element)n, writer);
            } else if (n instanceof Comment) {
                writer.writeComment(n.getValue());
            } else if (n instanceof EntityRef) {
                // EntityRef ref = (EntityRef) n;
                // writer.writeEntityRef(ref.)
            }
        }
View Full Code Here

            event = r.next();
        }

        while (true) {
            boolean noadd = false;
            Content child = null;

            switch (event) {
            case XMLStreamConstants.CDATA:
                child = f.cdata(r.getText());
                break;
View Full Code Here

        //
        //  Go through the children
        //
        for( Iterator i = ce.getContent().iterator(); i.hasNext(); )
        {
            Content c = (Content)i.next();
           
            if( c instanceof PluginContent )
            {
                PluginContent pc = (PluginContent)c;
               
View Full Code Here

        if ( !shouldExist && element != null )
        {
            int index = parent.indexOf( element );
            if ( index > 0 )
            {
                Content previous = parent.getContent( index - 1 );
                if ( previous instanceof Text )
                {
                    Text txt = (Text) previous;
                    if ( txt.getTextTrim().length() == 0 )
                    {
View Full Code Here

TOP

Related Classes of org.jdom.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.