Package org.apache.maven.project

Examples of org.apache.maven.project.Version


            {
                Element listElement = element;
                listElement = element.addElement( "versions" );
                for ( Iterator iter = model.getVersions().iterator(); iter.hasNext(); )
                {
                    Version o = (Version) iter.next();
                    writeVersion( o, "version", listElement );
                }
            }
            if ( model.getBranches() != null && model.getBranches().size() > 0 )
            {
View Full Code Here


     * @param parser
     */
    private Version parseVersion(String tagName, XmlPullParser parser, boolean strict, String encoding)
        throws IOException, XmlPullParserException
    {
        Version version = new Version();
        version.setModelEncoding( encoding );
        java.util.Set parsed = new java.util.HashSet();
        while ( parser.nextTag() == XmlPullParser.START_TAG )
        {
            if ( parser.getName().equals( "name" )  )
            {
                if ( parsed.contains( "name" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "name" );
                version.setName( getTrimmedValue( parser.nextText()) );
            }
            else if ( parser.getName().equals( "tag" )  )
            {
                if ( parsed.contains( "tag" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "tag" );
                version.setTag( getTrimmedValue( parser.nextText()) );
            }
            else if ( parser.getName().equals( "id" )  )
            {
                if ( parsed.contains( "id" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "id" );
                version.setId( getTrimmedValue( parser.nextText()) );
            }
            else
            {
                if ( strict )
                {
View Full Code Here

            if ( model.getVersions() != null && model.getVersions().size() > 0 )
            {
                serializer.startTag( NAMESPACE, "versions" );
                for ( Iterator iter = model.getVersions().iterator(); iter.hasNext(); )
                {
                    Version o = (Version) iter.next();
                    writeVersion( o, "version", serializer );
                }
                serializer.endTag( NAMESPACE, "versions" );
            }
            if ( model.getBranches() != null && model.getBranches().size() > 0 )
View Full Code Here

     * @param xmlStreamReader
     */
    private Version parseVersion(String tagName, XMLStreamReader xmlStreamReader, boolean strict, String encoding)
        throws IOException, XMLStreamException
    {
        Version version = new Version();
        version.setModelEncoding( encoding );
        java.util.Set parsed = new java.util.HashSet();
        while ( xmlStreamReader.nextTag() == XMLStreamConstants.START_ELEMENT )
        {
            if ( xmlStreamReader.getLocalName().equals( "name" )  )
            {
                if ( parsed.contains( "name" ) )
                {
                    throw new XMLStreamException( "Duplicated tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
                }
                parsed.add( "name" );
                version.setName( getTrimmedValue( xmlStreamReader.getElementText()) );
            }
            else if ( xmlStreamReader.getLocalName().equals( "tag" )  )
            {
                if ( parsed.contains( "tag" ) )
                {
                    throw new XMLStreamException( "Duplicated tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
                }
                parsed.add( "tag" );
                version.setTag( getTrimmedValue( xmlStreamReader.getElementText()) );
            }
            else if ( xmlStreamReader.getLocalName().equals( "id" )  )
            {
                if ( parsed.contains( "id" ) )
                {
                    throw new XMLStreamException( "Duplicated tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
                }
                parsed.add( "id" );
                version.setId( getTrimmedValue( xmlStreamReader.getElementText()) );
            }
            else
            {
                if ( strict )
                {
View Full Code Here

            if ( model.getVersions() != null && model.getVersions().size() > 0 )
            {
                serializer.writeStartElement( "versions" );
                for ( Iterator iter = model.getVersions().iterator(); iter.hasNext(); )
                {
                    Version o = (Version) iter.next();
                    writeVersion( o, "version", serializer );
                }
                serializer.writeEndElement();
            }
            if ( model.getBranches() != null && model.getBranches().size() > 0 )
View Full Code Here

     * @param element
     */
    private Version parseVersion(String tagName, Element element, boolean strict, String encoding)
        throws IOException, DocumentException
    {
        Version version = new Version();
        version.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( "name" )  )
                {
                    if ( parsed.contains( "name" ) )
                    {
                        throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
                    }
                    parsed.add( "name" );
                    version.setName( getTrimmedValue( childElement.getText() ) );
                }
                else if ( childElement.getName().equals( "tag" )  )
                {
                    if ( parsed.contains( "tag" ) )
                    {
                        throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
                    }
                    parsed.add( "tag" );
                    version.setTag( getTrimmedValue( childElement.getText() ) );
                }
                else if ( childElement.getName().equals( "id" )  )
                {
                    if ( parsed.contains( "id" ) )
                    {
                        throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
                    }
                    parsed.add( "id" );
                    version.setId( getTrimmedValue( childElement.getText() ) );
                }
                else
                {
                    if ( strict )
                    {
View Full Code Here

TOP

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

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.