Package org.apache.maven.model

Examples of org.apache.maven.model.RepositoryBase


     * @return RepositoryBase
     */
    private RepositoryBase parseRepositoryBase( String tagName, XmlPullParser parser, boolean strict )
        throws IOException, XmlPullParserException
    {
        RepositoryBase repositoryBase = new RepositoryBase();
        java.util.Set parsed = new java.util.HashSet();
        while ( parser.nextTag() == XmlPullParser.START_TAG )
        {
            if ( checkFieldWithDuplicate( parser, "id", null, parsed ) )
            {
                repositoryBase.setId( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "name", null, parsed ) )
            {
                repositoryBase.setName( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "url", null, parsed ) )
            {
                repositoryBase.setUrl( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "layout", null, parsed ) )
            {
                repositoryBase.setLayout( getTrimmedValue( parser.nextText() ) );
            }
            else
            {
                if ( strict )
                {
View Full Code Here


                newR.setVersion( relocation.getVersion() );

                newDM.setRelocation( newR );
            }

            RepositoryBase repo = dm.getRepository();

            if ( repo != null )
            {
                DeploymentRepository newRepo = new DeploymentRepository();

                newRepo.setId( repo.getId() );
                newRepo.setLayout( repo.getLayout() );
                newRepo.setName( repo.getName() );
                newRepo.setUrl( repo.getUrl() );

                newDM.setRepository( newRepo );
            }

            Site site = dm.getSite();

            if ( site != null )
            {
                Site newSite = new Site();

                newSite.setId( site.getId() );
                newSite.setName( site.getName() );
                newSite.setUrl( site.getUrl() );

                newDM.setSite( newSite );
            }

            RepositoryBase sRepo = dm.getSnapshotRepository();

            if ( sRepo != null )
            {
                DeploymentRepository newRepo = new DeploymentRepository();

                newRepo.setId( sRepo.getId() );
                newRepo.setLayout( sRepo.getLayout() );
                newRepo.setName( sRepo.getName() );
                newRepo.setUrl( sRepo.getUrl() );

                newDM.setSnapshotRepository( newRepo );
            }
        }
View Full Code Here

                newR.setVersion( relocation.getVersion() );

                newDM.setRelocation( newR );
            }

            RepositoryBase repo = dm.getRepository();

            if ( repo != null )
            {
                DeploymentRepository newRepo = new DeploymentRepository();

                newRepo.setId( repo.getId() );
                newRepo.setLayout( repo.getLayout() );
                newRepo.setName( repo.getName() );
                newRepo.setUrl( repo.getUrl() );

                newDM.setRepository( newRepo );
            }

            Site site = dm.getSite();

            if ( site != null )
            {
                Site newSite = new Site();

                newSite.setId( site.getId() );
                newSite.setName( site.getName() );
                newSite.setUrl( site.getUrl() );

                newDM.setSite( newSite );
            }

            RepositoryBase sRepo = dm.getSnapshotRepository();

            if ( sRepo != null )
            {
                DeploymentRepository newRepo = new DeploymentRepository();

                newRepo.setId( sRepo.getId() );
                newRepo.setLayout( sRepo.getLayout() );
                newRepo.setName( sRepo.getName() );
                newRepo.setUrl( sRepo.getUrl() );

                newDM.setSnapshotRepository( newRepo );
            }
        }
View Full Code Here

     * @param parser
     */
    private RepositoryBase parseRepositoryBase(String tagName, XmlPullParser parser, boolean strict, String encoding)
        throws IOException, XmlPullParserException
    {
        RepositoryBase repositoryBase = new RepositoryBase();
        repositoryBase.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" );
                repositoryBase.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" );
                repositoryBase.setName( 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" );
                repositoryBase.setUrl( getTrimmedValue( parser.nextText()) );
            }
            else if ( parser.getName().equals( "layout" )  )
            {
                if ( parsed.contains( "layout" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "layout" );
                repositoryBase.setLayout( getTrimmedValue( parser.nextText()) );
            }
            else
            {
                if ( strict )
                {
View Full Code Here

                newR.setVersion( relocation.getVersion() );

                newDM.setRelocation( newR );
            }

            RepositoryBase repo = dm.getRepository();

            if ( repo != null )
            {
                DeploymentRepository newRepo = new DeploymentRepository();

                newRepo.setId( repo.getId() );
                newRepo.setLayout( repo.getLayout() );
                newRepo.setName( repo.getName() );
                newRepo.setUrl( repo.getUrl() );

                newDM.setRepository( newRepo );
            }

            Site site = dm.getSite();

            if ( site != null )
            {
                Site newSite = new Site();

                newSite.setId( site.getId() );
                newSite.setName( site.getName() );
                newSite.setUrl( site.getUrl() );

                newDM.setSite( newSite );
            }

            RepositoryBase sRepo = dm.getSnapshotRepository();

            if ( sRepo != null )
            {
                DeploymentRepository newRepo = new DeploymentRepository();

                newRepo.setId( sRepo.getId() );
                newRepo.setLayout( sRepo.getLayout() );
                newRepo.setName( sRepo.getName() );
                newRepo.setUrl( sRepo.getUrl() );

                newDM.setSnapshotRepository( newRepo );
            }
        }
View Full Code Here

     */
    private RepositoryBase parseRepositoryBase( XmlPullParser parser, boolean strict )
        throws IOException, XmlPullParserException
    {
        String tagName = parser.getName();
        RepositoryBase repositoryBase = new RepositoryBase();
        for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
        {
            String name = parser.getAttributeName( i );
            String value = parser.getAttributeValue( i );

            if ( name.indexOf( ':' ) >= 0 )
            {
                // just ignore attributes with non-default namespace (for example: xmlns:xsi)
            }
            else
            {
                checkUnknownAttribute( parser, name, tagName, strict );
            }
        }
        java.util.Set parsed = new java.util.HashSet();
        while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
        {
            if ( checkFieldWithDuplicate( parser, "id", null, parsed ) )
            {
                repositoryBase.setId( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "name", null, parsed ) )
            {
                repositoryBase.setName( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "url", null, parsed ) )
            {
                repositoryBase.setUrl( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "layout", null, parsed ) )
            {
                repositoryBase.setLayout( getTrimmedValue( parser.nextText() ) );
            }
            else
            {
                checkUnknownElement( parser, strict );
            }
View Full Code Here

     */
    private RepositoryBase parseRepositoryBase( XmlPullParser parser, boolean strict, InputSource source )
        throws IOException, XmlPullParserException
    {
        String tagName = parser.getName();
        RepositoryBase repositoryBase = new RepositoryBase();
        InputLocation _location;
        _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
        repositoryBase.setLocation( "", _location );
        for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
        {
            String name = parser.getAttributeName( i );
            String value = parser.getAttributeValue( i );

            if ( name.indexOf( ':' ) >= 0 )
            {
                // just ignore attributes with non-default namespace (for example: xmlns:xsi)
            }
            else
            {
                checkUnknownAttribute( parser, name, tagName, strict );
            }
        }
        java.util.Set parsed = new java.util.HashSet();
        while ( ( strict ? parser.nextTag() : nextTag( parser ) ) == XmlPullParser.START_TAG )
        {
            if ( checkFieldWithDuplicate( parser, "id", null, parsed ) )
            {
                _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                repositoryBase.setLocation( "id", _location );
                repositoryBase.setId( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "name", null, parsed ) )
            {
                _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                repositoryBase.setLocation( "name", _location );
                repositoryBase.setName( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "url", null, parsed ) )
            {
                _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                repositoryBase.setLocation( "url", _location );
                repositoryBase.setUrl( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "layout", null, parsed ) )
            {
                _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                repositoryBase.setLocation( "layout", _location );
                repositoryBase.setLayout( getTrimmedValue( parser.nextText() ) );
            }
            else
            {
                checkUnknownElement( parser, strict );
            }
View Full Code Here

TOP

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

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.