Example usage for org.jdom2 Element getNamespace

List of usage examples for org.jdom2 Element getNamespace

Introduction

In this page you can find the example usage for org.jdom2 Element getNamespace.

Prototype

public Namespace getNamespace() 

Source Link

Document

Returns the element's Namespace .

Usage

From source file:org.apache.maven.model.io.jdom.MavenJDOMWriter.java

License:Apache License

/**
 * Method iterateMailingList.//from  w w  w.  j  a v  a2  s  .c  o m
 * 
 * @param counter
 * @param childTag
 * @param parentTag
 * @param list
 * @param parent
 */
protected void iterateMailingList(final IndentationCounter counter, final Element parent,
        final java.util.Collection list, final java.lang.String parentTag, final java.lang.String childTag) {
    final boolean shouldExist = (list != null) && (list.size() > 0);
    final Element element = updateElement(counter, parent, parentTag, shouldExist);
    if (shouldExist) {
        final Iterator it = list.iterator();
        Iterator elIt = element.getChildren(childTag, element.getNamespace()).iterator();
        if (!elIt.hasNext()) {
            elIt = null;
        }
        final IndentationCounter innerCount = new IndentationCounter(counter.getDepth() + 1);
        while (it.hasNext()) {
            final MailingList value = (MailingList) it.next();
            Element el;
            if (elIt != null && elIt.hasNext()) {
                el = (Element) elIt.next();
                if (!elIt.hasNext()) {
                    elIt = null;
                }
            } else {
                el = factory.element(childTag, element.getNamespace());
                insertAtPreferredLocation(element, el, innerCount);
            }
            updateMailingList(value, childTag, innerCount, el);
            innerCount.increaseCount();
        }
        if (elIt != null) {
            while (elIt.hasNext()) {
                elIt.next();
                elIt.remove();
            }
        }
    }
}

From source file:org.apache.maven.model.io.jdom.MavenJDOMWriter.java

License:Apache License

/**
 * Method iterateNotifier./*  w w w . j av  a2s .c  o m*/
 * 
 * @param counter
 * @param childTag
 * @param parentTag
 * @param list
 * @param parent
 */
protected void iterateNotifier(final IndentationCounter counter, final Element parent,
        final java.util.Collection list, final java.lang.String parentTag, final java.lang.String childTag) {
    final boolean shouldExist = (list != null) && (list.size() > 0);
    final Element element = updateElement(counter, parent, parentTag, shouldExist);
    if (shouldExist) {
        final Iterator it = list.iterator();
        Iterator elIt = element.getChildren(childTag, element.getNamespace()).iterator();
        if (!elIt.hasNext()) {
            elIt = null;
        }
        final IndentationCounter innerCount = new IndentationCounter(counter.getDepth() + 1);
        while (it.hasNext()) {
            final Notifier value = (Notifier) it.next();
            Element el;
            if (elIt != null && elIt.hasNext()) {
                el = (Element) elIt.next();
                if (!elIt.hasNext()) {
                    elIt = null;
                }
            } else {
                el = factory.element(childTag, element.getNamespace());
                insertAtPreferredLocation(element, el, innerCount);
            }
            updateNotifier(value, childTag, innerCount, el);
            innerCount.increaseCount();
        }
        if (elIt != null) {
            while (elIt.hasNext()) {
                elIt.next();
                elIt.remove();
            }
        }
    }
}

From source file:org.apache.maven.model.io.jdom.MavenJDOMWriter.java

License:Apache License

/**
 * Method iteratePluginExecution.//from w  w w  .j a v a  2  s.co m
 * 
 * @param counter
 * @param childTag
 * @param parentTag
 * @param list
 * @param parent
 */
protected void iteratePluginExecution(final IndentationCounter counter, final Element parent,
        final java.util.Collection list, final java.lang.String parentTag, final java.lang.String childTag) {
    final boolean shouldExist = (list != null) && (list.size() > 0);
    final Element element = updateElement(counter, parent, parentTag, shouldExist);
    if (shouldExist) {
        final Iterator it = list.iterator();
        Iterator elIt = element.getChildren(childTag, element.getNamespace()).iterator();
        if (!elIt.hasNext()) {
            elIt = null;
        }
        final IndentationCounter innerCount = new IndentationCounter(counter.getDepth() + 1);
        while (it.hasNext()) {
            final PluginExecution value = (PluginExecution) it.next();
            Element el;
            if (elIt != null && elIt.hasNext()) {
                el = (Element) elIt.next();
                if (!elIt.hasNext()) {
                    elIt = null;
                }
            } else {
                el = factory.element(childTag, element.getNamespace());
                insertAtPreferredLocation(element, el, innerCount);
            }
            updatePluginExecution(value, childTag, innerCount, el);
            innerCount.increaseCount();
        }
        if (elIt != null) {
            while (elIt.hasNext()) {
                elIt.next();
                elIt.remove();
            }
        }
    }
}

From source file:org.apache.maven.model.io.jdom.MavenJDOMWriter.java

License:Apache License

/**
 * Method iterateProfile./*from  www .  ja  va2 s .c  o  m*/
 * 
 * @param counter
 * @param childTag
 * @param parentTag
 * @param list
 * @param parent
 */
protected void iterateProfile(final IndentationCounter counter, final Element parent,
        final java.util.Collection list, final java.lang.String parentTag, final java.lang.String childTag) {
    final boolean shouldExist = (list != null) && (list.size() > 0);
    final Element element = updateElement(counter, parent, parentTag, shouldExist);
    if (shouldExist) {
        final Iterator it = list.iterator();
        Iterator elIt = element.getChildren(childTag, element.getNamespace()).iterator();
        if (!elIt.hasNext()) {
            elIt = null;
        }
        final IndentationCounter innerCount = new IndentationCounter(counter.getDepth() + 1);
        while (it.hasNext()) {
            final Profile value = (Profile) it.next();
            Element el;
            if (elIt != null && elIt.hasNext()) {
                el = (Element) elIt.next();
                if (!elIt.hasNext()) {
                    elIt = null;
                }
            } else {
                el = factory.element(childTag, element.getNamespace());
                insertAtPreferredLocation(element, el, innerCount);
            }
            updateProfile(value, childTag, innerCount, el);
            innerCount.increaseCount();
        }
        if (elIt != null) {
            while (elIt.hasNext()) {
                elIt.next();
                elIt.remove();
            }
        }
    }
}

From source file:org.apache.maven.model.io.jdom.MavenJDOMWriter.java

License:Apache License

/**
 * Method iterateReportPlugin.//from   w ww.  jav a 2  s . c o m
 * 
 * @param counter
 * @param childTag
 * @param parentTag
 * @param list
 * @param parent
 */
protected void iterateReportPlugin(final IndentationCounter counter, final Element parent,
        final java.util.Collection list, final java.lang.String parentTag, final java.lang.String childTag) {
    final boolean shouldExist = (list != null) && (list.size() > 0);
    final Element element = updateElement(counter, parent, parentTag, shouldExist);
    if (shouldExist) {
        final Iterator it = list.iterator();
        Iterator elIt = element.getChildren(childTag, element.getNamespace()).iterator();
        if (!elIt.hasNext()) {
            elIt = null;
        }
        final IndentationCounter innerCount = new IndentationCounter(counter.getDepth() + 1);
        while (it.hasNext()) {
            final ReportPlugin value = (ReportPlugin) it.next();
            Element el;
            if (elIt != null && elIt.hasNext()) {
                el = (Element) elIt.next();
                if (!elIt.hasNext()) {
                    elIt = null;
                }
            } else {
                el = factory.element(childTag, element.getNamespace());
                insertAtPreferredLocation(element, el, innerCount);
            }
            updateReportPlugin(value, childTag, innerCount, el);
            innerCount.increaseCount();
        }
        if (elIt != null) {
            while (elIt.hasNext()) {
                elIt.next();
                elIt.remove();
            }
        }
    }
}

From source file:org.apache.maven.model.io.jdom.MavenJDOMWriter.java

License:Apache License

/**
 * Method iterateReportSet.// w w w  .  j  av a  2 s.com
 * 
 * @param counter
 * @param childTag
 * @param parentTag
 * @param list
 * @param parent
 */
protected void iterateReportSet(final IndentationCounter counter, final Element parent,
        final java.util.Collection list, final java.lang.String parentTag, final java.lang.String childTag) {
    final boolean shouldExist = (list != null) && (list.size() > 0);
    final Element element = updateElement(counter, parent, parentTag, shouldExist);
    if (shouldExist) {
        final Iterator it = list.iterator();
        Iterator elIt = element.getChildren(childTag, element.getNamespace()).iterator();
        if (!elIt.hasNext()) {
            elIt = null;
        }
        final IndentationCounter innerCount = new IndentationCounter(counter.getDepth() + 1);
        while (it.hasNext()) {
            final ReportSet value = (ReportSet) it.next();
            Element el;
            if (elIt != null && elIt.hasNext()) {
                el = (Element) elIt.next();
                if (!elIt.hasNext()) {
                    elIt = null;
                }
            } else {
                el = factory.element(childTag, element.getNamespace());
                insertAtPreferredLocation(element, el, innerCount);
            }
            updateReportSet(value, childTag, innerCount, el);
            innerCount.increaseCount();
        }
        if (elIt != null) {
            while (elIt.hasNext()) {
                elIt.next();
                elIt.remove();
            }
        }
    }
}

From source file:org.apache.maven.model.io.jdom.MavenJDOMWriter.java

License:Apache License

/**
 * Method iterateRepository.// w w w.  j  a v a2s.  c o  m
 * 
 * @param counter
 * @param childTag
 * @param parentTag
 * @param list
 * @param parent
 */
protected void iterateRepository(final IndentationCounter counter, final Element parent,
        final java.util.Collection list, final java.lang.String parentTag, final java.lang.String childTag) {
    final boolean shouldExist = (list != null) && (list.size() > 0);
    final Element element = updateElement(counter, parent, parentTag, shouldExist);
    if (shouldExist) {
        final Iterator it = list.iterator();
        Iterator elIt = element.getChildren(childTag, element.getNamespace()).iterator();
        if (!elIt.hasNext()) {
            elIt = null;
        }
        final IndentationCounter innerCount = new IndentationCounter(counter.getDepth() + 1);
        while (it.hasNext()) {
            final Repository value = (Repository) it.next();
            Element el;
            if (elIt != null && elIt.hasNext()) {
                el = (Element) elIt.next();
                if (!elIt.hasNext()) {
                    elIt = null;
                }
            } else {
                el = factory.element(childTag, element.getNamespace());
                insertAtPreferredLocation(element, el, innerCount);
            }
            updateRepository(value, childTag, innerCount, el);
            innerCount.increaseCount();
        }
        if (elIt != null) {
            while (elIt.hasNext()) {
                elIt.next();
                elIt.remove();
            }
        }
    }
}

From source file:org.apache.maven.model.io.jdom.MavenJDOMWriter.java

License:Apache License

/**
 * Method iterateResource.//from ww w.ja  v a2s . co m
 * 
 * @param counter
 * @param childTag
 * @param parentTag
 * @param list
 * @param parent
 */
protected void iterateResource(final IndentationCounter counter, final Element parent,
        final java.util.Collection list, final java.lang.String parentTag, final java.lang.String childTag) {
    final boolean shouldExist = (list != null) && (list.size() > 0);
    final Element element = updateElement(counter, parent, parentTag, shouldExist);
    if (shouldExist) {
        final Iterator it = list.iterator();
        Iterator elIt = element.getChildren(childTag, element.getNamespace()).iterator();
        if (!elIt.hasNext()) {
            elIt = null;
        }
        final IndentationCounter innerCount = new IndentationCounter(counter.getDepth() + 1);
        while (it.hasNext()) {
            final Resource value = (Resource) it.next();
            Element el;
            if (elIt != null && elIt.hasNext()) {
                el = (Element) elIt.next();
                if (!elIt.hasNext()) {
                    elIt = null;
                }
            } else {
                el = factory.element(childTag, element.getNamespace());
                insertAtPreferredLocation(element, el, innerCount);
            }
            updateResource(value, childTag, innerCount, el);
            innerCount.increaseCount();
        }
        if (elIt != null) {
            while (elIt.hasNext()) {
                elIt.next();
                elIt.remove();
            }
        }
    }
}

From source file:org.apache.maven.settings.io.jdom.SettingsJDOMWriter.java

License:Apache License

/**
 * Method iterateMirror./*from  w  w  w  .j a v a2  s .  c o  m*/
 * 
 * @param counter
 * @param childTag
 * @param parentTag
 * @param list
 * @param parent
 */
protected void iterateMirror(final IndentationCounter counter, final Element parent,
        final java.util.Collection list, final java.lang.String parentTag, final java.lang.String childTag) {
    final boolean shouldExist = (list != null) && (list.size() > 0);
    final Element element = updateElement(counter, parent, parentTag, shouldExist);
    if (shouldExist) {
        final Iterator it = list.iterator();
        Iterator elIt = element.getChildren(childTag, element.getNamespace()).iterator();
        if (!elIt.hasNext()) {
            elIt = null;
        }
        final IndentationCounter innerCount = new IndentationCounter(counter.getDepth() + 1);
        while (it.hasNext()) {
            final Mirror value = (Mirror) it.next();
            Element el;
            if (elIt != null && elIt.hasNext()) {
                el = (Element) elIt.next();
                if (!elIt.hasNext()) {
                    elIt = null;
                }
            } else {
                el = factory.element(childTag, element.getNamespace());
                insertAtPreferredLocation(element, el, innerCount);
            }
            updateMirror(value, childTag, innerCount, el);
            innerCount.increaseCount();
        }
        if (elIt != null) {
            while (elIt.hasNext()) {
                elIt.next();
                elIt.remove();
            }
        }
    }
}

From source file:org.apache.maven.settings.io.jdom.SettingsJDOMWriter.java

License:Apache License

/**
 * Method iterateProxy.//from w  w  w.j  av a  2 s  .c o m
 * 
 * @param counter
 * @param childTag
 * @param parentTag
 * @param list
 * @param parent
 */
protected void iterateProxy(final IndentationCounter counter, final Element parent,
        final java.util.Collection list, final java.lang.String parentTag, final java.lang.String childTag) {
    final boolean shouldExist = (list != null) && (list.size() > 0);
    final Element element = updateElement(counter, parent, parentTag, shouldExist);
    if (shouldExist) {
        final Iterator it = list.iterator();
        Iterator elIt = element.getChildren(childTag, element.getNamespace()).iterator();
        if (!elIt.hasNext()) {
            elIt = null;
        }
        final IndentationCounter innerCount = new IndentationCounter(counter.getDepth() + 1);
        while (it.hasNext()) {
            final Proxy value = (Proxy) it.next();
            Element el;
            if (elIt != null && elIt.hasNext()) {
                el = (Element) elIt.next();
                if (!elIt.hasNext()) {
                    elIt = null;
                }
            } else {
                el = factory.element(childTag, element.getNamespace());
                insertAtPreferredLocation(element, el, innerCount);
            }
            updateProxy(value, childTag, innerCount, el);
            innerCount.increaseCount();
        }
        if (elIt != null) {
            while (elIt.hasNext()) {
                elIt.next();
                elIt.remove();
            }
        }
    }
}