Package org.apache.maven.project

Examples of org.apache.maven.project.Repository


     * @param parser
     */
    private Repository parseRepository(String tagName, XmlPullParser parser, boolean strict, String encoding)
        throws IOException, XmlPullParserException
    {
        Repository repository = new Repository();
        repository.setModelEncoding( encoding );
        java.util.Set parsed = new java.util.HashSet();
        while ( parser.nextTag() == XmlPullParser.START_TAG )
        {
            if ( parser.getName().equals( "connection" )  )
            {
                if ( parsed.contains( "connection" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "connection" );
                repository.setConnection( getTrimmedValue( parser.nextText()) );
            }
            else if ( parser.getName().equals( "developerConnection" )  )
            {
                if ( parsed.contains( "developerConnection" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "developerConnection" );
                repository.setDeveloperConnection( 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" );
                repository.setUrl( getTrimmedValue( parser.nextText()) );
            }
            else
            {
                if ( strict )
                {
View Full Code Here


     * @param xmlStreamReader
     */
    private Repository parseRepository(String tagName, XMLStreamReader xmlStreamReader, boolean strict, String encoding)
        throws IOException, XMLStreamException
    {
        Repository repository = new Repository();
        repository.setModelEncoding( encoding );
        java.util.Set parsed = new java.util.HashSet();
        while ( xmlStreamReader.nextTag() == XMLStreamConstants.START_ELEMENT )
        {
            if ( xmlStreamReader.getLocalName().equals( "connection" )  )
            {
                if ( parsed.contains( "connection" ) )
                {
                    throw new XMLStreamException( "Duplicated tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
                }
                parsed.add( "connection" );
                repository.setConnection( getTrimmedValue( xmlStreamReader.getElementText()) );
            }
            else if ( xmlStreamReader.getLocalName().equals( "developerConnection" )  )
            {
                if ( parsed.contains( "developerConnection" ) )
                {
                    throw new XMLStreamException( "Duplicated tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
                }
                parsed.add( "developerConnection" );
                repository.setDeveloperConnection( 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" );
                repository.setUrl( getTrimmedValue( xmlStreamReader.getElementText()) );
            }
            else
            {
                if ( strict )
                {
View Full Code Here

     * @param element
     */
    private Repository parseRepository(String tagName, Element element, boolean strict, String encoding)
        throws IOException, DocumentException
    {
        Repository repository = new Repository();
        repository.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( "connection" )  )
                {
                    if ( parsed.contains( "connection" ) )
                    {
                        throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
                    }
                    parsed.add( "connection" );
                    repository.setConnection( getTrimmedValue( childElement.getText() ) );
                }
                else if ( childElement.getName().equals( "developerConnection" )  )
                {
                    if ( parsed.contains( "developerConnection" ) )
                    {
                        throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
                    }
                    parsed.add( "developerConnection" );
                    repository.setDeveloperConnection( getTrimmedValue( childElement.getText() ) );
                }
                else if ( childElement.getName().equals( "url" )  )
                {
                    if ( parsed.contains( "url" ) )
                    {
                        throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
                    }
                    parsed.add( "url" );
                    repository.setUrl( getTrimmedValue( childElement.getText() ) );
                }
                else
                {
                    if ( strict )
                    {
View Full Code Here

TOP

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

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.