Package org.apache.maven.project

Examples of org.apache.maven.project.MailingList


            {
                Element listElement = element;
                listElement = element.addElement( "mailingLists" );
                for ( Iterator iter = model.getMailingLists().iterator(); iter.hasNext(); )
                {
                    MailingList o = (MailingList) iter.next();
                    writeMailingList( o, "mailingList", listElement );
                }
            }
            if ( model.getDevelopers() != null && model.getDevelopers().size() > 0 )
            {
View Full Code Here


     * @param parser
     */
    private MailingList parseMailingList(String tagName, XmlPullParser parser, boolean strict, String encoding)
        throws IOException, XmlPullParserException
    {
        MailingList mailingList = new MailingList();
        mailingList.setModelEncoding( encoding );
        java.util.Set parsed = new java.util.HashSet();
        while ( parser.nextTag() == XmlPullParser.START_TAG )
        {
            if ( parser.getName().equals( "name" )  )
            {
                if ( parsed.contains( "name" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "name" );
                mailingList.setName( getTrimmedValue( parser.nextText()) );
            }
            else if ( parser.getName().equals( "subscribe" )  )
            {
                if ( parsed.contains( "subscribe" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "subscribe" );
                mailingList.setSubscribe( getTrimmedValue( parser.nextText()) );
            }
            else if ( parser.getName().equals( "unsubscribe" )  )
            {
                if ( parsed.contains( "unsubscribe" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "unsubscribe" );
                mailingList.setUnsubscribe( getTrimmedValue( parser.nextText()) );
            }
            else if ( parser.getName().equals( "post" )  )
            {
                if ( parsed.contains( "post" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "post" );
                mailingList.setPost( getTrimmedValue( parser.nextText()) );
            }
            else if ( parser.getName().equals( "archive" )  )
            {
                if ( parsed.contains( "archive" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "archive" );
                mailingList.setArchive( getTrimmedValue( parser.nextText()) );
            }
            else if ( parser.getName().equals( "otherArchives" )  )
            {
                if ( parsed.contains( "otherArchives" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "otherArchives" );
                java.util.List otherArchives = new java.util.ArrayList();
                mailingList.setOtherArchives( otherArchives );
                while ( parser.nextTag() == XmlPullParser.START_TAG )
                {
                    if ( parser.getName().equals( "otherArchive" ) )
                    {
                        otherArchives.add( getTrimmedValue( parser.nextText()) );
View Full Code Here

     * @param xmlStreamReader
     */
    private MailingList parseMailingList(String tagName, XMLStreamReader xmlStreamReader, boolean strict, String encoding)
        throws IOException, XMLStreamException
    {
        MailingList mailingList = new MailingList();
        mailingList.setModelEncoding( encoding );
        java.util.Set parsed = new java.util.HashSet();
        while ( xmlStreamReader.nextTag() == XMLStreamConstants.START_ELEMENT )
        {
            if ( xmlStreamReader.getLocalName().equals( "name" )  )
            {
                if ( parsed.contains( "name" ) )
                {
                    throw new XMLStreamException( "Duplicated tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
                }
                parsed.add( "name" );
                mailingList.setName( getTrimmedValue( xmlStreamReader.getElementText()) );
            }
            else if ( xmlStreamReader.getLocalName().equals( "subscribe" )  )
            {
                if ( parsed.contains( "subscribe" ) )
                {
                    throw new XMLStreamException( "Duplicated tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
                }
                parsed.add( "subscribe" );
                mailingList.setSubscribe( getTrimmedValue( xmlStreamReader.getElementText()) );
            }
            else if ( xmlStreamReader.getLocalName().equals( "unsubscribe" )  )
            {
                if ( parsed.contains( "unsubscribe" ) )
                {
                    throw new XMLStreamException( "Duplicated tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
                }
                parsed.add( "unsubscribe" );
                mailingList.setUnsubscribe( getTrimmedValue( xmlStreamReader.getElementText()) );
            }
            else if ( xmlStreamReader.getLocalName().equals( "post" )  )
            {
                if ( parsed.contains( "post" ) )
                {
                    throw new XMLStreamException( "Duplicated tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
                }
                parsed.add( "post" );
                mailingList.setPost( getTrimmedValue( xmlStreamReader.getElementText()) );
            }
            else if ( xmlStreamReader.getLocalName().equals( "archive" )  )
            {
                if ( parsed.contains( "archive" ) )
                {
                    throw new XMLStreamException( "Duplicated tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
                }
                parsed.add( "archive" );
                mailingList.setArchive( getTrimmedValue( xmlStreamReader.getElementText()) );
            }
            else if ( xmlStreamReader.getLocalName().equals( "otherArchives" )  )
            {
                if ( parsed.contains( "otherArchives" ) )
                {
                    throw new XMLStreamException( "Duplicated tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
                }
                parsed.add( "otherArchives" );
                java.util.List otherArchives = new java.util.ArrayList();
                mailingList.setOtherArchives( otherArchives );
                while ( xmlStreamReader.nextTag() == XMLStreamConstants.START_ELEMENT )
                {
                    if ( xmlStreamReader.getLocalName().equals( "otherArchive" ) )
                    {
                        otherArchives.add( getTrimmedValue( xmlStreamReader.getElementText()) );
View Full Code Here

            if ( model.getMailingLists() != null && model.getMailingLists().size() > 0 )
            {
                serializer.startTag( NAMESPACE, "mailingLists" );
                for ( Iterator iter = model.getMailingLists().iterator(); iter.hasNext(); )
                {
                    MailingList o = (MailingList) iter.next();
                    writeMailingList( o, "mailingList", serializer );
                }
                serializer.endTag( NAMESPACE, "mailingLists" );
            }
            if ( model.getDevelopers() != null && model.getDevelopers().size() > 0 )
View Full Code Here

            if ( model.getMailingLists() != null && model.getMailingLists().size() > 0 )
            {
                serializer.writeStartElement( "mailingLists" );
                for ( Iterator iter = model.getMailingLists().iterator(); iter.hasNext(); )
                {
                    MailingList o = (MailingList) iter.next();
                    writeMailingList( o, "mailingList", serializer );
                }
                serializer.writeEndElement();
            }
            if ( model.getDevelopers() != null && model.getDevelopers().size() > 0 )
View Full Code Here

     * @param element
     */
    private MailingList parseMailingList(String tagName, Element element, boolean strict, String encoding)
        throws IOException, DocumentException
    {
        MailingList mailingList = new MailingList();
        mailingList.setModelEncoding( encoding );
        java.util.Set parsed = new java.util.HashSet();
        for ( Iterator i = element.nodeIterator(); i.hasNext(); )
        {
            Node node = (Node) i.next();
            if ( node.getNodeType() != Node.ELEMENT_NODE )
            {
            }
            else
            {
                Element childElement = (Element) node;
                if ( childElement.getName().equals( "name" )  )
                {
                    if ( parsed.contains( "name" ) )
                    {
                        throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
                    }
                    parsed.add( "name" );
                    mailingList.setName( getTrimmedValue( childElement.getText() ) );
                }
                else if ( childElement.getName().equals( "subscribe" )  )
                {
                    if ( parsed.contains( "subscribe" ) )
                    {
                        throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
                    }
                    parsed.add( "subscribe" );
                    mailingList.setSubscribe( getTrimmedValue( childElement.getText() ) );
                }
                else if ( childElement.getName().equals( "unsubscribe" )  )
                {
                    if ( parsed.contains( "unsubscribe" ) )
                    {
                        throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
                    }
                    parsed.add( "unsubscribe" );
                    mailingList.setUnsubscribe( getTrimmedValue( childElement.getText() ) );
                }
                else if ( childElement.getName().equals( "post" )  )
                {
                    if ( parsed.contains( "post" ) )
                    {
                        throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
                    }
                    parsed.add( "post" );
                    mailingList.setPost( getTrimmedValue( childElement.getText() ) );
                }
                else if ( childElement.getName().equals( "archive" )  )
                {
                    if ( parsed.contains( "archive" ) )
                    {
                        throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
                    }
                    parsed.add( "archive" );
                    mailingList.setArchive( getTrimmedValue( childElement.getText() ) );
                }
                else if ( childElement.getName().equals( "otherArchives" )  )
                {
                    if ( parsed.contains( "otherArchives" ) )
                    {
                        throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
                    }
                    parsed.add( "otherArchives" );
                    java.util.List otherArchives = new java.util.ArrayList();
                    mailingList.setOtherArchives( otherArchives );
                    for ( Iterator j = childElement.nodeIterator(); j.hasNext(); )
                    {
                        Node n = (Node) j.next();
                        if ( n.getNodeType() != Node.ELEMENT_NODE )
                        {
View Full Code Here

TOP

Related Classes of org.apache.maven.project.MailingList

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.