Package org.apache.maven.model

Examples of org.apache.maven.model.Developer


        }

        final List<DocumentAuthor> ret = new ArrayList<DocumentAuthor>( 4 );

        for (Object o : project.getDevelopers()) {
            final Developer developer = (Developer) o;

            final DocumentAuthor author = new DocumentAuthor();
            author.setName(developer.getName());
            author.setEmail(developer.getEmail());
            author.setCompanyName(developer.getOrganization());
            StringBuilder roles = null;

            for (final String role : developer.getRoles()) {
                if (roles == null) {
                    roles = new StringBuilder(32);
                } else {
                    roles.append(',').append(' ');
                }
View Full Code Here


            writer.endElement(); // foaf:Person
            writer.endElement(); // asfext:chair
        }
        else
        {
            Developer chair = ASFExtOptionsUtil.findChair( developers );
            if ( chair != null )
            {
                writeContributor( writer, chair, asfExtOptions.getXmlnsPrefix(), "chair" );
                developers.remove( chair );
            }
View Full Code Here

                }

                if ( Developer.class.isAssignableFrom( contributor1.getClass() ) && Developer.class.isAssignableFrom(
                    contributor2.getClass() ) )
                {
                    Developer developer1 = (Developer) contributor1;
                    Developer developer2 = (Developer) contributor2;

                    if ( developer1.getId() == null && developer2.getId() != null )
                    {
                        return -1;
                    }
                    if ( developer1.getId() != null && developer2.getId() == null )
                    {
                        return +1;
                    }

                    return developer1.getId().compareTo( developer2.getId() );
                }

                if ( contributor1.getName() == null && contributor2.getName() != null )
                {
                    return -1;
View Full Code Here

    {
        super();

        List<Developer> developers = new ArrayList<Developer>();

        Developer developer = new Developer();
        developer.setName( "Edwin Punzalan" );
        developer.setId( "edwin" );
        developers.add( developer );

        developer = new Developer();
        developer.setName( "Keogh Edrich Punzalan" );
        developer.setId( "keogh" );
        developers.add( developer );

        super.addAll( developers );
    }
View Full Code Here

        for ( Iterator it = v3Developers.iterator(); it.hasNext(); )
        {
            org.apache.maven.model.v300.Developer v3Developer =
                (org.apache.maven.model.v300.Developer) it.next();

            Developer developer = new Developer();

            developer.setId( nullIfEmpty( v3Developer.getId() ) );

            developer.setName( nullIfEmpty( v3Developer.getName() ) );

            developer.setEmail( nullIfEmpty( v3Developer.getEmail() ) );

            developer.setOrganization( nullIfEmpty( v3Developer.getOrganization() ) );

            developer.setTimezone( nullIfEmpty( v3Developer.getTimezone() ) );

            developer.setUrl( nullIfEmpty( v3Developer.getUrl() ) );

            developer.setRoles( returnList( v3Developer.getRoles() ) );

            developers.add( developer );
        }

        return developers;
View Full Code Here

        {
            List developers = new ArrayList();

            for ( Iterator i = mavenProject.getDevelopers().iterator(); i.hasNext(); )
            {
                Developer d = (Developer) i.next();

                ProjectDeveloper cd = new ProjectDeveloper();

                cd.setScmId( d.getId() );

                cd.setName( d.getName() );

                cd.setEmail( d.getEmail() );

                developers.add( cd );
            }

            continuumProject.setDevelopers( developers );
View Full Code Here

     * @param element
     */
    private Developer parseDeveloper(String tagName, Element element, boolean strict, String encoding)
        throws IOException, DocumentException
    {
        Developer developer = new Developer();
        developer.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( "id" )  )
                {
                    if ( parsed.contains( "id" ) )
                    {
                        throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
                    }
                    parsed.add( "id" );
                    developer.setId( getTrimmedValue( childElement.getText() ) );
                }
                else if ( childElement.getName().equals( "name" )  )
                {
                    if ( parsed.contains( "name" ) )
                    {
                        throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
                    }
                    parsed.add( "name" );
                    developer.setName( getTrimmedValue( childElement.getText() ) );
                }
                else if ( childElement.getName().equals( "email" )  )
                {
                    if ( parsed.contains( "email" ) )
                    {
                        throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
                    }
                    parsed.add( "email" );
                    developer.setEmail( getTrimmedValue( childElement.getText() ) );
                }
                else if ( childElement.getName().equals( "url" )  )
                {
                    if ( parsed.contains( "url" ) )
                    {
                        throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
                    }
                    parsed.add( "url" );
                    developer.setUrl( getTrimmedValue( childElement.getText() ) );
                }
                else if ( childElement.getName().equals( "organization" ) || childElement.getName().equals( "organisation" )  )
                {
                    if ( parsed.contains( "organization" ) )
                    {
                        throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
                    }
                    parsed.add( "organization" );
                    developer.setOrganization( getTrimmedValue( childElement.getText() ) );
                }
                else if ( childElement.getName().equals( "organizationUrl" ) || childElement.getName().equals( "organisationUrl" )  )
                {
                    if ( parsed.contains( "organizationUrl" ) )
                    {
                        throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
                    }
                    parsed.add( "organizationUrl" );
                    developer.setOrganizationUrl( getTrimmedValue( childElement.getText() ) );
                }
                else if ( childElement.getName().equals( "roles" )  )
                {
                    if ( parsed.contains( "roles" ) )
                    {
                        throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
                    }
                    parsed.add( "roles" );
                    java.util.List roles = new java.util.ArrayList();
                    developer.setRoles( roles );
                    for ( Iterator j = childElement.nodeIterator(); j.hasNext(); )
                    {
                        Node n = (Node) j.next();
                        if ( n.getNodeType() != Node.ELEMENT_NODE )
                        {
                        }
                        else
                        {
                            Element listElement = (Element) n;
                            if ( listElement.getName().equals( "role" ) )
                            {
                                roles.add( getTrimmedValue( listElement.getText() ) );
                            }
                            else
                            {
                            }
                        }
                    }
                }
                else if ( childElement.getName().equals( "timezone" )  )
                {
                    if ( parsed.contains( "timezone" ) )
                    {
                        throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
                    }
                    parsed.add( "timezone" );
                    developer.setTimezone( getTrimmedValue( childElement.getText() ) );
                }
                else if ( childElement.getName().equals( "properties" )  )
                {
                    if ( parsed.contains( "properties" ) )
                    {
                        throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
                    }
                    parsed.add( "properties" );
                    for ( Iterator j = childElement.nodeIterator(); j.hasNext(); )
                    {
                        Node n = (Node) j.next();
                        if ( n.getNodeType() != Node.ELEMENT_NODE )
                        {
                        }
                        else
                        {
                            Element listElement = (Element) n;
                            String key = listElement.getName();
                            String value = listElement.getText()
                            .trim()
                            ;
                            developer.addProperty( key, value );
                        }
                    }
                }
                else
                {
View Full Code Here

     * @param xmlStreamReader
     */
    private Developer parseDeveloper(String tagName, XMLStreamReader xmlStreamReader, boolean strict, String encoding)
        throws IOException, XMLStreamException
    {
        Developer developer = new Developer();
        developer.setModelEncoding( encoding );
        java.util.Set parsed = new java.util.HashSet();
        while ( xmlStreamReader.nextTag() == XMLStreamConstants.START_ELEMENT )
        {
            if ( xmlStreamReader.getLocalName().equals( "id" )  )
            {
                if ( parsed.contains( "id" ) )
                {
                    throw new XMLStreamException( "Duplicated tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
                }
                parsed.add( "id" );
                developer.setId( getTrimmedValue( xmlStreamReader.getElementText()) );
            }
            else if ( xmlStreamReader.getLocalName().equals( "name" )  )
            {
                if ( parsed.contains( "name" ) )
                {
                    throw new XMLStreamException( "Duplicated tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
                }
                parsed.add( "name" );
                developer.setName( getTrimmedValue( xmlStreamReader.getElementText()) );
            }
            else if ( xmlStreamReader.getLocalName().equals( "email" )  )
            {
                if ( parsed.contains( "email" ) )
                {
                    throw new XMLStreamException( "Duplicated tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
                }
                parsed.add( "email" );
                developer.setEmail( getTrimmedValue( xmlStreamReader.getElementText()) );
            }
            else if ( xmlStreamReader.getLocalName().equals( "url" )  )
            {
                if ( parsed.contains( "url" ) )
                {
                    throw new XMLStreamException( "Duplicated tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
                }
                parsed.add( "url" );
                developer.setUrl( getTrimmedValue( xmlStreamReader.getElementText()) );
            }
            else if ( xmlStreamReader.getLocalName().equals( "organization" ) || xmlStreamReader.getLocalName().equals( "organisation" )  )
            {
                if ( parsed.contains( "organization" ) )
                {
                    throw new XMLStreamException( "Duplicated tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
                }
                parsed.add( "organization" );
                developer.setOrganization( getTrimmedValue( xmlStreamReader.getElementText()) );
            }
            else if ( xmlStreamReader.getLocalName().equals( "organizationUrl" ) || xmlStreamReader.getLocalName().equals( "organisationUrl" )  )
            {
                if ( parsed.contains( "organizationUrl" ) )
                {
                    throw new XMLStreamException( "Duplicated tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
                }
                parsed.add( "organizationUrl" );
                developer.setOrganizationUrl( getTrimmedValue( xmlStreamReader.getElementText()) );
            }
            else if ( xmlStreamReader.getLocalName().equals( "roles" )  )
            {
                if ( parsed.contains( "roles" ) )
                {
                    throw new XMLStreamException( "Duplicated tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
                }
                parsed.add( "roles" );
                java.util.List roles = new java.util.ArrayList();
                developer.setRoles( roles );
                while ( xmlStreamReader.nextTag() == XMLStreamConstants.START_ELEMENT )
                {
                    if ( xmlStreamReader.getLocalName().equals( "role" ) )
                    {
                        roles.add( getTrimmedValue( xmlStreamReader.getElementText()) );
                    }
                    else
                    {
                        throw new XMLStreamException( "Unrecognised tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
                    }
                }
            }
            else if ( xmlStreamReader.getLocalName().equals( "timezone" )  )
            {
                if ( parsed.contains( "timezone" ) )
                {
                    throw new XMLStreamException( "Duplicated tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
                }
                parsed.add( "timezone" );
                developer.setTimezone( getTrimmedValue( xmlStreamReader.getElementText()) );
            }
            else if ( xmlStreamReader.getLocalName().equals( "properties" )  )
            {
                if ( parsed.contains( "properties" ) )
                {
                    throw new XMLStreamException( "Duplicated tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
                }
                parsed.add( "properties" );
                while ( xmlStreamReader.nextTag() == XMLStreamConstants.START_ELEMENT )
                {
                    String key = xmlStreamReader.getLocalName();
                    String value = xmlStreamReader.getElementText()
                    .trim()
                    ;
                    developer.addProperty( key, value );
                }
            }
            else
            {
                if ( strict )
View Full Code Here

            if ( model.getDevelopers() != null && model.getDevelopers().size() > 0 )
            {
                serializer.writeStartElement( "developers" );
                for ( Iterator iter = model.getDevelopers().iterator(); iter.hasNext(); )
                {
                    Developer o = (Developer) iter.next();
                    writeDeveloper( o, "developer", serializer );
                }
                serializer.writeEndElement();
            }
            if ( model.getContributors() != null && model.getContributors().size() > 0 )
View Full Code Here

     * @param parser
     */
    private Developer parseDeveloper(String tagName, XmlPullParser parser, boolean strict, String encoding)
        throws IOException, XmlPullParserException
    {
        Developer developer = new Developer();
        developer.setModelEncoding( encoding );
        java.util.Set parsed = new java.util.HashSet();
        while ( parser.nextTag() == XmlPullParser.START_TAG )
        {
            if ( parser.getName().equals( "id" )  )
            {
                if ( parsed.contains( "id" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "id" );
                developer.setId( getTrimmedValue( parser.nextText()) );
            }
            else if ( parser.getName().equals( "name" )  )
            {
                if ( parsed.contains( "name" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "name" );
                developer.setName( getTrimmedValue( parser.nextText()) );
            }
            else if ( parser.getName().equals( "email" )  )
            {
                if ( parsed.contains( "email" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "email" );
                developer.setEmail( getTrimmedValue( parser.nextText()) );
            }
            else if ( parser.getName().equals( "url" )  )
            {
                if ( parsed.contains( "url" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "url" );
                developer.setUrl( getTrimmedValue( parser.nextText()) );
            }
            else if ( parser.getName().equals( "organization" ) || parser.getName().equals( "organisation" )  )
            {
                if ( parsed.contains( "organization" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "organization" );
                developer.setOrganization( getTrimmedValue( parser.nextText()) );
            }
            else if ( parser.getName().equals( "organizationUrl" ) || parser.getName().equals( "organisationUrl" )  )
            {
                if ( parsed.contains( "organizationUrl" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "organizationUrl" );
                developer.setOrganizationUrl( getTrimmedValue( parser.nextText()) );
            }
            else if ( parser.getName().equals( "roles" )  )
            {
                if ( parsed.contains( "roles" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "roles" );
                java.util.List roles = new java.util.ArrayList();
                developer.setRoles( roles );
                while ( parser.nextTag() == XmlPullParser.START_TAG )
                {
                    if ( parser.getName().equals( "role" ) )
                    {
                        roles.add( getTrimmedValue( parser.nextText()) );
                    }
                    else
                    {
                        parser.nextText();
                    }
                }
            }
            else if ( parser.getName().equals( "timezone" )  )
            {
                if ( parsed.contains( "timezone" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "timezone" );
                developer.setTimezone( getTrimmedValue( parser.nextText()) );
            }
            else if ( parser.getName().equals( "properties" )  )
            {
                if ( parsed.contains( "properties" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "properties" );
                while ( parser.nextTag() == XmlPullParser.START_TAG )
                {
                    String key = parser.getName();
                    String value = parser.nextText()
                    .trim()
                    ;
                    developer.addProperty( key, value );
                }
            }
            else
            {
                if ( strict )
View Full Code Here

TOP

Related Classes of org.apache.maven.model.Developer

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.