Package org.apache.maven.model

Examples of org.apache.maven.model.InputLocation


    private License parseLicense( XmlPullParser parser, boolean strict, InputSource source )
        throws IOException, XmlPullParserException
    {
        String tagName = parser.getName();
        License license = new License();
        InputLocation _location;
        _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
        license.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, "name", null, parsed ) )
            {
                _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                license.setLocation( "name", _location );
                license.setName( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "url", null, parsed ) )
            {
                _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                license.setLocation( "url", _location );
                license.setUrl( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "distribution", null, parsed ) )
            {
                _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                license.setLocation( "distribution", _location );
                license.setDistribution( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "comments", null, parsed ) )
            {
                _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                license.setLocation( "comments", _location );
                license.setComments( getTrimmedValue( parser.nextText() ) );
            }
            else
            {
View Full Code Here


    private MailingList parseMailingList( XmlPullParser parser, boolean strict, InputSource source )
        throws IOException, XmlPullParserException
    {
        String tagName = parser.getName();
        MailingList mailingList = new MailingList();
        InputLocation _location;
        _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
        mailingList.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, "name", null, parsed ) )
            {
                _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                mailingList.setLocation( "name", _location );
                mailingList.setName( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "subscribe", null, parsed ) )
            {
                _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                mailingList.setLocation( "subscribe", _location );
                mailingList.setSubscribe( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "unsubscribe", null, parsed ) )
            {
                _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                mailingList.setLocation( "unsubscribe", _location );
                mailingList.setUnsubscribe( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "post", null, parsed ) )
            {
                _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                mailingList.setLocation( "post", _location );
                mailingList.setPost( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "archive", null, parsed ) )
            {
                _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                mailingList.setLocation( "archive", _location );
                mailingList.setArchive( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "otherArchives", null, parsed ) )
            {
                java.util.List otherArchives = new java.util.ArrayList/*<String>*/();
                mailingList.setOtherArchives( otherArchives );
                InputLocation _locations;
                _locations = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                mailingList.setLocation( "otherArchives", _locations );
                while ( parser.nextTag() == XmlPullParser.START_TAG )
                {
                    if ( "otherArchive".equals( parser.getName() ) )
                    {
                        _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                        _locations.setLocation( Integer.valueOf( otherArchives.size() ), _location );
                        otherArchives.add( getTrimmedValue( parser.nextText() ) );
                    }
                    else
                    {
                        checkUnknownElement( parser, strict );
View Full Code Here

    private Model parseModel( XmlPullParser parser, boolean strict, InputSource source )
        throws IOException, XmlPullParserException
    {
        String tagName = parser.getName();
        Model model = new Model();
        InputLocation _location;
        _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
        model.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 if ( "xmlns".equals( name ) )
            {
                // ignore xmlns attribute in root class, which is a reserved attribute name
            }
            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, "modelVersion", null, parsed ) )
            {
                _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                model.setLocation( "modelVersion", _location );
                model.setModelVersion( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "parent", null, parsed ) )
            {
                model.setParent( parseParent( parser, strict, source ) );
            }
            else if ( checkFieldWithDuplicate( parser, "groupId", null, parsed ) )
            {
                _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                model.setLocation( "groupId", _location );
                model.setGroupId( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "artifactId", null, parsed ) )
            {
                _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                model.setLocation( "artifactId", _location );
                model.setArtifactId( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "version", null, parsed ) )
            {
                _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                model.setLocation( "version", _location );
                model.setVersion( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "packaging", null, parsed ) )
            {
                _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                model.setLocation( "packaging", _location );
                model.setPackaging( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "name", null, parsed ) )
            {
                _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                model.setLocation( "name", _location );
                model.setName( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "description", null, parsed ) )
            {
                _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                model.setLocation( "description", _location );
                model.setDescription( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "url", null, parsed ) )
            {
                _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                model.setLocation( "url", _location );
                model.setUrl( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "inceptionYear", null, parsed ) )
            {
                _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                model.setLocation( "inceptionYear", _location );
                model.setInceptionYear( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "organization", "organisation", parsed ) )
            {
                model.setOrganization( parseOrganization( parser, strict, source ) );
            }
            else if ( checkFieldWithDuplicate( parser, "licenses", null, parsed ) )
            {
                java.util.List licenses = new java.util.ArrayList/*<License>*/();
                model.setLicenses( licenses );
                while ( parser.nextTag() == XmlPullParser.START_TAG )
                {
                    if ( "license".equals( parser.getName() ) )
                    {
                        licenses.add( parseLicense( parser, strict, source ) );
                    }
                    else
                    {
                        checkUnknownElement( parser, strict );
                    }
                }
            }
            else if ( checkFieldWithDuplicate( parser, "developers", null, parsed ) )
            {
                java.util.List developers = new java.util.ArrayList/*<Developer>*/();
                model.setDevelopers( developers );
                while ( parser.nextTag() == XmlPullParser.START_TAG )
                {
                    if ( "developer".equals( parser.getName() ) )
                    {
                        developers.add( parseDeveloper( parser, strict, source ) );
                    }
                    else
                    {
                        checkUnknownElement( parser, strict );
                    }
                }
            }
            else if ( checkFieldWithDuplicate( parser, "contributors", null, parsed ) )
            {
                java.util.List contributors = new java.util.ArrayList/*<Contributor>*/();
                model.setContributors( contributors );
                while ( parser.nextTag() == XmlPullParser.START_TAG )
                {
                    if ( "contributor".equals( parser.getName() ) )
                    {
                        contributors.add( parseContributor( parser, strict, source ) );
                    }
                    else
                    {
                        checkUnknownElement( parser, strict );
                    }
                }
            }
            else if ( checkFieldWithDuplicate( parser, "mailingLists", null, parsed ) )
            {
                java.util.List mailingLists = new java.util.ArrayList/*<MailingList>*/();
                model.setMailingLists( mailingLists );
                while ( parser.nextTag() == XmlPullParser.START_TAG )
                {
                    if ( "mailingList".equals( parser.getName() ) )
                    {
                        mailingLists.add( parseMailingList( parser, strict, source ) );
                    }
                    else
                    {
                        checkUnknownElement( parser, strict );
                    }
                }
            }
            else if ( checkFieldWithDuplicate( parser, "prerequisites", null, parsed ) )
            {
                model.setPrerequisites( parsePrerequisites( parser, strict, source ) );
            }
            else if ( checkFieldWithDuplicate( parser, "modules", null, parsed ) )
            {
                java.util.List modules = new java.util.ArrayList/*<String>*/();
                model.setModules( modules );
                InputLocation _locations;
                _locations = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                model.setLocation( "modules", _locations );
                while ( parser.nextTag() == XmlPullParser.START_TAG )
                {
                    if ( "module".equals( parser.getName() ) )
                    {
                        _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                        _locations.setLocation( Integer.valueOf( modules.size() ), _location );
                        modules.add( getTrimmedValue( parser.nextText() ) );
                    }
                    else
                    {
                        checkUnknownElement( parser, strict );
                    }
                }
            }
            else if ( checkFieldWithDuplicate( parser, "scm", null, parsed ) )
            {
                model.setScm( parseScm( parser, strict, source ) );
            }
            else if ( checkFieldWithDuplicate( parser, "issueManagement", null, parsed ) )
            {
                model.setIssueManagement( parseIssueManagement( parser, strict, source ) );
            }
            else if ( checkFieldWithDuplicate( parser, "ciManagement", null, parsed ) )
            {
                model.setCiManagement( parseCiManagement( parser, strict, source ) );
            }
            else if ( checkFieldWithDuplicate( parser, "distributionManagement", null, parsed ) )
            {
                model.setDistributionManagement( parseDistributionManagement( parser, strict, source ) );
            }
            else if ( checkFieldWithDuplicate( parser, "properties", null, parsed ) )
            {
                InputLocation _locations;
                _locations = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                model.setLocation( "properties", _locations );
                while ( parser.nextTag() == XmlPullParser.START_TAG )
                {
                    String key = parser.getName();
                    _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                    _locations.setLocation( key, _location );
                    String value = parser.nextText().trim();
                    model.addProperty( key, value );
                }
            }
            else if ( checkFieldWithDuplicate( parser, "dependencyManagement", null, parsed ) )
            {
                model.setDependencyManagement( parseDependencyManagement( parser, strict, source ) );
            }
            else if ( checkFieldWithDuplicate( parser, "dependencies", null, parsed ) )
            {
                java.util.List dependencies = new java.util.ArrayList/*<Dependency>*/();
                model.setDependencies( dependencies );
                while ( parser.nextTag() == XmlPullParser.START_TAG )
                {
                    if ( "dependency".equals( parser.getName() ) )
                    {
                        dependencies.add( parseDependency( parser, strict, source ) );
                    }
                    else
                    {
                        checkUnknownElement( parser, strict );
                    }
                }
            }
            else if ( checkFieldWithDuplicate( parser, "repositories", null, parsed ) )
            {
                java.util.List repositories = new java.util.ArrayList/*<Repository>*/();
                model.setRepositories( repositories );
                while ( parser.nextTag() == XmlPullParser.START_TAG )
                {
                    if ( "repository".equals( parser.getName() ) )
                    {
                        repositories.add( parseRepository( parser, strict, source ) );
                    }
                    else
                    {
                        checkUnknownElement( parser, strict );
                    }
                }
            }
            else if ( checkFieldWithDuplicate( parser, "pluginRepositories", null, parsed ) )
            {
                java.util.List pluginRepositories = new java.util.ArrayList/*<Repository>*/();
                model.setPluginRepositories( pluginRepositories );
                while ( parser.nextTag() == XmlPullParser.START_TAG )
                {
                    if ( "pluginRepository".equals( parser.getName() ) )
                    {
                        pluginRepositories.add( parseRepository( parser, strict, source ) );
                    }
                    else
                    {
                        checkUnknownElement( parser, strict );
                    }
                }
            }
            else if ( checkFieldWithDuplicate( parser, "build", null, parsed ) )
            {
                model.setBuild( parseBuild( parser, strict, source ) );
            }
            else if ( checkFieldWithDuplicate( parser, "reports", null, parsed ) )
            {
                _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                model.setLocation( "reports", _location );
                model.setReports( Xpp3DomBuilder.build( parser ) );
            }
            else if ( checkFieldWithDuplicate( parser, "reporting", null, parsed ) )
            {
View Full Code Here

    private ModelBase parseModelBase( XmlPullParser parser, boolean strict, InputSource source )
        throws IOException, XmlPullParserException
    {
        String tagName = parser.getName();
        ModelBase modelBase = new ModelBase();
        InputLocation _location;
        _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
        modelBase.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, "modules", null, parsed ) )
            {
                java.util.List modules = new java.util.ArrayList/*<String>*/();
                modelBase.setModules( modules );
                InputLocation _locations;
                _locations = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                modelBase.setLocation( "modules", _locations );
                while ( parser.nextTag() == XmlPullParser.START_TAG )
                {
                    if ( "module".equals( parser.getName() ) )
                    {
                        _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                        _locations.setLocation( Integer.valueOf( modules.size() ), _location );
                        modules.add( getTrimmedValue( parser.nextText() ) );
                    }
                    else
                    {
                        checkUnknownElement( parser, strict );
                    }
                }
            }
            else if ( checkFieldWithDuplicate( parser, "distributionManagement", null, parsed ) )
            {
                modelBase.setDistributionManagement( parseDistributionManagement( parser, strict, source ) );
            }
            else if ( checkFieldWithDuplicate( parser, "properties", null, parsed ) )
            {
                InputLocation _locations;
                _locations = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                modelBase.setLocation( "properties", _locations );
                while ( parser.nextTag() == XmlPullParser.START_TAG )
                {
                    String key = parser.getName();
                    _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                    _locations.setLocation( key, _location );
                    String value = parser.nextText().trim();
                    modelBase.addProperty( key, value );
                }
            }
            else if ( checkFieldWithDuplicate( parser, "dependencyManagement", null, parsed ) )
            {
                modelBase.setDependencyManagement( parseDependencyManagement( parser, strict, source ) );
            }
            else if ( checkFieldWithDuplicate( parser, "dependencies", null, parsed ) )
            {
                java.util.List dependencies = new java.util.ArrayList/*<Dependency>*/();
                modelBase.setDependencies( dependencies );
                while ( parser.nextTag() == XmlPullParser.START_TAG )
                {
                    if ( "dependency".equals( parser.getName() ) )
                    {
                        dependencies.add( parseDependency( parser, strict, source ) );
                    }
                    else
                    {
                        checkUnknownElement( parser, strict );
                    }
                }
            }
            else if ( checkFieldWithDuplicate( parser, "repositories", null, parsed ) )
            {
                java.util.List repositories = new java.util.ArrayList/*<Repository>*/();
                modelBase.setRepositories( repositories );
                while ( parser.nextTag() == XmlPullParser.START_TAG )
                {
                    if ( "repository".equals( parser.getName() ) )
                    {
                        repositories.add( parseRepository( parser, strict, source ) );
                    }
                    else
                    {
                        checkUnknownElement( parser, strict );
                    }
                }
            }
            else if ( checkFieldWithDuplicate( parser, "pluginRepositories", null, parsed ) )
            {
                java.util.List pluginRepositories = new java.util.ArrayList/*<Repository>*/();
                modelBase.setPluginRepositories( pluginRepositories );
                while ( parser.nextTag() == XmlPullParser.START_TAG )
                {
                    if ( "pluginRepository".equals( parser.getName() ) )
                    {
                        pluginRepositories.add( parseRepository( parser, strict, source ) );
                    }
                    else
                    {
                        checkUnknownElement( parser, strict );
                    }
                }
            }
            else if ( checkFieldWithDuplicate( parser, "reports", null, parsed ) )
            {
                _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                modelBase.setLocation( "reports", _location );
                modelBase.setReports( Xpp3DomBuilder.build( parser ) );
            }
            else if ( checkFieldWithDuplicate( parser, "reporting", null, parsed ) )
            {
View Full Code Here

    private Notifier parseNotifier( XmlPullParser parser, boolean strict, InputSource source )
        throws IOException, XmlPullParserException
    {
        String tagName = parser.getName();
        Notifier notifier = new Notifier();
        InputLocation _location;
        _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
        notifier.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, "type", null, parsed ) )
            {
                _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                notifier.setLocation( "type", _location );
                notifier.setType( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "sendOnError", null, parsed ) )
            {
                _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                notifier.setLocation( "sendOnError", _location );
                notifier.setSendOnError( getBooleanValue( getTrimmedValue( parser.nextText() ), "sendOnError", parser, "true" ) );
            }
            else if ( checkFieldWithDuplicate( parser, "sendOnFailure", null, parsed ) )
            {
                _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                notifier.setLocation( "sendOnFailure", _location );
                notifier.setSendOnFailure( getBooleanValue( getTrimmedValue( parser.nextText() ), "sendOnFailure", parser, "true" ) );
            }
            else if ( checkFieldWithDuplicate( parser, "sendOnSuccess", null, parsed ) )
            {
                _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                notifier.setLocation( "sendOnSuccess", _location );
                notifier.setSendOnSuccess( getBooleanValue( getTrimmedValue( parser.nextText() ), "sendOnSuccess", parser, "true" ) );
            }
            else if ( checkFieldWithDuplicate( parser, "sendOnWarning", null, parsed ) )
            {
                _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                notifier.setLocation( "sendOnWarning", _location );
                notifier.setSendOnWarning( getBooleanValue( getTrimmedValue( parser.nextText() ), "sendOnWarning", parser, "true" ) );
            }
            else if ( checkFieldWithDuplicate( parser, "address", null, parsed ) )
            {
                _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                notifier.setLocation( "address", _location );
                notifier.setAddress( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "configuration", null, parsed ) )
            {
                InputLocation _locations;
                _locations = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                notifier.setLocation( "configuration", _locations );
                while ( parser.nextTag() == XmlPullParser.START_TAG )
                {
                    String key = parser.getName();
                    _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                    _locations.setLocation( key, _location );
                    String value = parser.nextText().trim();
                    notifier.addConfiguration( key, value );
                }
            }
            else
View Full Code Here

    private Organization parseOrganization( XmlPullParser parser, boolean strict, InputSource source )
        throws IOException, XmlPullParserException
    {
        String tagName = parser.getName();
        Organization organization = new Organization();
        InputLocation _location;
        _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
        organization.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, "name", null, parsed ) )
            {
                _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                organization.setLocation( "name", _location );
                organization.setName( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "url", null, parsed ) )
            {
                _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                organization.setLocation( "url", _location );
                organization.setUrl( getTrimmedValue( parser.nextText() ) );
            }
            else
            {
View Full Code Here

    private Parent parseParent( XmlPullParser parser, boolean strict, InputSource source )
        throws IOException, XmlPullParserException
    {
        String tagName = parser.getName();
        Parent parent = new Parent();
        InputLocation _location;
        _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
        parent.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, "artifactId", null, parsed ) )
            {
                _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                parent.setLocation( "artifactId", _location );
                parent.setArtifactId( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "groupId", null, parsed ) )
            {
                _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                parent.setLocation( "groupId", _location );
                parent.setGroupId( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "version", null, parsed ) )
            {
                _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                parent.setLocation( "version", _location );
                parent.setVersion( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "relativePath", null, parsed ) )
            {
                _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                parent.setLocation( "relativePath", _location );
                parent.setRelativePath( getTrimmedValue( parser.nextText() ) );
            }
            else
            {
View Full Code Here

    private PatternSet parsePatternSet( XmlPullParser parser, boolean strict, InputSource source )
        throws IOException, XmlPullParserException
    {
        String tagName = parser.getName();
        PatternSet patternSet = new PatternSet();
        InputLocation _location;
        _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
        patternSet.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, "includes", null, parsed ) )
            {
                java.util.List includes = new java.util.ArrayList/*<String>*/();
                patternSet.setIncludes( includes );
                InputLocation _locations;
                _locations = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                patternSet.setLocation( "includes", _locations );
                while ( parser.nextTag() == XmlPullParser.START_TAG )
                {
                    if ( "include".equals( parser.getName() ) )
                    {
                        _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                        _locations.setLocation( Integer.valueOf( includes.size() ), _location );
                        includes.add( getTrimmedValue( parser.nextText() ) );
                    }
                    else
                    {
                        checkUnknownElement( parser, strict );
                    }
                }
            }
            else if ( checkFieldWithDuplicate( parser, "excludes", null, parsed ) )
            {
                java.util.List excludes = new java.util.ArrayList/*<String>*/();
                patternSet.setExcludes( excludes );
                InputLocation _locations;
                _locations = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                patternSet.setLocation( "excludes", _locations );
                while ( parser.nextTag() == XmlPullParser.START_TAG )
                {
                    if ( "exclude".equals( parser.getName() ) )
                    {
                        _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                        _locations.setLocation( Integer.valueOf( excludes.size() ), _location );
                        excludes.add( getTrimmedValue( parser.nextText() ) );
                    }
                    else
                    {
                        checkUnknownElement( parser, strict );
View Full Code Here

    private Plugin parsePlugin( XmlPullParser parser, boolean strict, InputSource source )
        throws IOException, XmlPullParserException
    {
        String tagName = parser.getName();
        Plugin plugin = new Plugin();
        InputLocation _location;
        _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
        plugin.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, "groupId", null, parsed ) )
            {
                _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                plugin.setLocation( "groupId", _location );
                plugin.setGroupId( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "artifactId", null, parsed ) )
            {
                _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                plugin.setLocation( "artifactId", _location );
                plugin.setArtifactId( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "version", null, parsed ) )
            {
                _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                plugin.setLocation( "version", _location );
                plugin.setVersion( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "extensions", null, parsed ) )
            {
                _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                plugin.setLocation( "extensions", _location );
                plugin.setExtensions( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "executions", null, parsed ) )
            {
                java.util.List executions = new java.util.ArrayList/*<PluginExecution>*/();
                plugin.setExecutions( executions );
                while ( parser.nextTag() == XmlPullParser.START_TAG )
                {
                    if ( "execution".equals( parser.getName() ) )
                    {
                        executions.add( parsePluginExecution( parser, strict, source ) );
                    }
                    else
                    {
                        checkUnknownElement( parser, strict );
                    }
                }
            }
            else if ( checkFieldWithDuplicate( parser, "dependencies", null, parsed ) )
            {
                java.util.List dependencies = new java.util.ArrayList/*<Dependency>*/();
                plugin.setDependencies( dependencies );
                while ( parser.nextTag() == XmlPullParser.START_TAG )
                {
                    if ( "dependency".equals( parser.getName() ) )
                    {
                        dependencies.add( parseDependency( parser, strict, source ) );
                    }
                    else
                    {
                        checkUnknownElement( parser, strict );
                    }
                }
            }
            else if ( checkFieldWithDuplicate( parser, "goals", null, parsed ) )
            {
                _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                plugin.setLocation( "goals", _location );
                plugin.setGoals( Xpp3DomBuilder.build( parser ) );
            }
            else if ( checkFieldWithDuplicate( parser, "inherited", null, parsed ) )
            {
                _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                plugin.setLocation( "inherited", _location );
                plugin.setInherited( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "configuration", null, parsed ) )
            {
                _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
                plugin.setLocation( "configuration", _location );
                plugin.setConfiguration( Xpp3DomBuilder.build( parser ) );
            }
            else
            {
View Full Code Here

    private PluginConfiguration parsePluginConfiguration( XmlPullParser parser, boolean strict, InputSource source )
        throws IOException, XmlPullParserException
    {
        String tagName = parser.getName();
        PluginConfiguration pluginConfiguration = new PluginConfiguration();
        InputLocation _location;
        _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source );
        pluginConfiguration.setLocation( "", _location );
        for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- )
        {
            String name = parser.getAttributeName( i );
            String value = parser.getAttributeValue( i );
View Full Code Here

TOP

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

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.