Package org.apache.maven.model

Examples of org.apache.maven.model.PackageGroup


     * @param parser
     */
    private PackageGroup parsePackageGroup(String tagName, XmlPullParser parser, boolean strict, String encoding)
        throws IOException, XmlPullParserException
    {
        PackageGroup packageGroup = new PackageGroup();
        packageGroup.setModelEncoding( encoding );
        java.util.Set parsed = new java.util.HashSet();
        while ( parser.nextTag() == XmlPullParser.START_TAG )
        {
            if ( parser.getName().equals( "title" )  )
            {
                if ( parsed.contains( "title" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "title" );
                packageGroup.setTitle( getTrimmedValue( parser.nextText()) );
            }
            else if ( parser.getName().equals( "packages" )  )
            {
                if ( parsed.contains( "packages" ) )
                {
                    throw new XmlPullParserException( "Duplicated tag: '" + parser.getName() + "'", parser, null);
                }
                parsed.add( "packages" );
                packageGroup.setPackages( getTrimmedValue( parser.nextText()) );
            }
            else
            {
                if ( strict )
                {
View Full Code Here


            if ( model.getPackageGroups() != null && model.getPackageGroups().size() > 0 )
            {
                serializer.startTag( NAMESPACE, "packageGroups" );
                for ( Iterator iter = model.getPackageGroups().iterator(); iter.hasNext(); )
                {
                    PackageGroup o = (PackageGroup) iter.next();
                    writePackageGroup( o, "packageGroup", serializer );
                }
                serializer.endTag( NAMESPACE, "packageGroups" );
            }
            if ( model.getReports() != null && model.getReports().size() > 0 )
View Full Code Here

            if ( model.getPackageGroups() != null && model.getPackageGroups().size() > 0 )
            {
                serializer.writeStartElement( "packageGroups" );
                for ( Iterator iter = model.getPackageGroups().iterator(); iter.hasNext(); )
                {
                    PackageGroup o = (PackageGroup) iter.next();
                    writePackageGroup( o, "packageGroup", serializer );
                }
                serializer.writeEndElement();
            }
            if ( model.getReports() != null && model.getReports().size() > 0 )
View Full Code Here

     * @param xmlStreamReader
     */
    private PackageGroup parsePackageGroup(String tagName, XMLStreamReader xmlStreamReader, boolean strict, String encoding)
        throws IOException, XMLStreamException
    {
        PackageGroup packageGroup = new PackageGroup();
        packageGroup.setModelEncoding( encoding );
        java.util.Set parsed = new java.util.HashSet();
        while ( xmlStreamReader.nextTag() == XMLStreamConstants.START_ELEMENT )
        {
            if ( xmlStreamReader.getLocalName().equals( "title" )  )
            {
                if ( parsed.contains( "title" ) )
                {
                    throw new XMLStreamException( "Duplicated tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
                }
                parsed.add( "title" );
                packageGroup.setTitle( getTrimmedValue( xmlStreamReader.getElementText()) );
            }
            else if ( xmlStreamReader.getLocalName().equals( "packages" )  )
            {
                if ( parsed.contains( "packages" ) )
                {
                    throw new XMLStreamException( "Duplicated tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
                }
                parsed.add( "packages" );
                packageGroup.setPackages( getTrimmedValue( xmlStreamReader.getElementText()) );
            }
            else
            {
                if ( strict )
                {
View Full Code Here

     * @param element
     */
    private PackageGroup parsePackageGroup(String tagName, Element element, boolean strict, String encoding)
        throws IOException, DocumentException
    {
        PackageGroup packageGroup = new PackageGroup();
        packageGroup.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( "title" )  )
                {
                    if ( parsed.contains( "title" ) )
                    {
                        throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
                    }
                    parsed.add( "title" );
                    packageGroup.setTitle( getTrimmedValue( childElement.getText() ) );
                }
                else if ( childElement.getName().equals( "packages" )  )
                {
                    if ( parsed.contains( "packages" ) )
                    {
                        throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
                    }
                    parsed.add( "packages" );
                    packageGroup.setPackages( getTrimmedValue( childElement.getText() ) );
                }
                else
                {
                    if ( strict )
                    {
View Full Code Here

            {
                Element listElement = element;
                listElement = element.addElement( "packageGroups" );
                for ( Iterator iter = model.getPackageGroups().iterator(); iter.hasNext(); )
                {
                    PackageGroup o = (PackageGroup) iter.next();
                    writePackageGroup( o, "packageGroup", listElement );
                }
            }
            if ( model.getReports() != null && model.getReports().size() > 0 )
            {
View Full Code Here

TOP

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

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.