Package org.apache.maven.model

Examples of org.apache.maven.model.License


                elIt = null;
            }
            Counter innerCount = new Counter( counter.getDepth() + 1 );
            while ( it.hasNext() )
            {
                License value = (License) it.next();
                Element el;
                if ( elIt != null && elIt.hasNext() )
                {
                    el = (Element) elIt.next();
                    if ( !elIt.hasNext() )
View Full Code Here


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

        if ( ( model.getLicenses() != null ) && ( model.getLicenses().size() > 0 ) )
        {
            serializer.startTag( NAMESPACE, "licenses" );
            for ( Iterator iter = model.getLicenses().iterator(); iter.hasNext(); )
            {
                License o = (License) iter.next();
                writeLicense( o, "license", serializer );
            }
            serializer.endTag( NAMESPACE, "licenses" );
        }
        if ( ( model.getDevelopers() != null ) && ( model.getDevelopers().size() > 0 ) )
View Full Code Here

     */
    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
            {
                checkUnknownElement( parser, strict );
            }
View Full Code Here

TOP

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

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.