Package org.apache.maven.project

Examples of org.apache.maven.project.Resource


     * @param xmlStreamReader
     */
    private Resource parseResource(String tagName, XMLStreamReader xmlStreamReader, boolean strict, String encoding)
        throws IOException, XMLStreamException
    {
        Resource resource = new Resource();
        resource.setModelEncoding( encoding );
        java.util.Set parsed = new java.util.HashSet();
        while ( xmlStreamReader.nextTag() == XMLStreamConstants.START_ELEMENT )
        {
            if ( xmlStreamReader.getLocalName().equals( "targetPath" )  )
            {
                if ( parsed.contains( "targetPath" ) )
                {
                    throw new XMLStreamException( "Duplicated tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
                }
                parsed.add( "targetPath" );
                resource.setTargetPath( getTrimmedValue( xmlStreamReader.getElementText()) );
            }
            else if ( xmlStreamReader.getLocalName().equals( "filtering" )  )
            {
                if ( parsed.contains( "filtering" ) )
                {
                    throw new XMLStreamException( "Duplicated tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
                }
                parsed.add( "filtering" );
                resource.setFiltering( getBooleanValue( getTrimmedValue( xmlStreamReader.getElementText()), "filtering", xmlStreamReader ) );
            }
            else if ( xmlStreamReader.getLocalName().equals( "directory" )  )
            {
                if ( parsed.contains( "directory" ) )
                {
                    throw new XMLStreamException( "Duplicated tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
                }
                parsed.add( "directory" );
                resource.setDirectory( getTrimmedValue( xmlStreamReader.getElementText()) );
            }
            else if ( xmlStreamReader.getLocalName().equals( "includes" )  )
            {
                if ( parsed.contains( "includes" ) )
                {
                    throw new XMLStreamException( "Duplicated tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
                }
                parsed.add( "includes" );
                java.util.List includes = new java.util.ArrayList();
                resource.setIncludes( includes );
                while ( xmlStreamReader.nextTag() == XMLStreamConstants.START_ELEMENT )
                {
                    if ( xmlStreamReader.getLocalName().equals( "include" ) )
                    {
                        includes.add( getTrimmedValue( xmlStreamReader.getElementText()) );
                    }
                    else
                    {
                        throw new XMLStreamException( "Unrecognised tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
                    }
                }
            }
            else if ( xmlStreamReader.getLocalName().equals( "excludes" )  )
            {
                if ( parsed.contains( "excludes" ) )
                {
                    throw new XMLStreamException( "Duplicated tag: '" + xmlStreamReader.getLocalName() + "'", xmlStreamReader.getLocation() );
                }
                parsed.add( "excludes" );
                java.util.List excludes = new java.util.ArrayList();
                resource.setExcludes( excludes );
                while ( xmlStreamReader.nextTag() == XMLStreamConstants.START_ELEMENT )
                {
                    if ( xmlStreamReader.getLocalName().equals( "exclude" ) )
                    {
                        excludes.add( getTrimmedValue( xmlStreamReader.getElementText()) );
View Full Code Here


            if ( build.getResources() != null && build.getResources().size() > 0 )
            {
                serializer.writeStartElement( "resources" );
                for ( Iterator iter = build.getResources().iterator(); iter.hasNext(); )
                {
                    Resource o = (Resource) iter.next();
                    writeResource( o, "resource", serializer );
                }
                serializer.writeEndElement();
            }
            serializer.writeEndElement();
View Full Code Here

            if ( buildBase.getResources() != null && buildBase.getResources().size() > 0 )
            {
                serializer.writeStartElement( "resources" );
                for ( Iterator iter = buildBase.getResources().iterator(); iter.hasNext(); )
                {
                    Resource o = (Resource) iter.next();
                    writeResource( o, "resource", serializer );
                }
                serializer.writeEndElement();
            }
            serializer.writeEndElement();
View Full Code Here

            if ( unitTest.getResources() != null && unitTest.getResources().size() > 0 )
            {
                serializer.writeStartElement( "resources" );
                for ( Iterator iter = unitTest.getResources().iterator(); iter.hasNext(); )
                {
                    Resource o = (Resource) iter.next();
                    writeResource( o, "resource", serializer );
                }
                serializer.writeEndElement();
            }
            if ( unitTest.getIncludes() != null && unitTest.getIncludes().size() > 0 )
View Full Code Here

     * @param element
     */
    private Resource parseResource(String tagName, Element element, boolean strict, String encoding)
        throws IOException, DocumentException
    {
        Resource resource = new Resource();
        resource.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( "targetPath" )  )
                {
                    if ( parsed.contains( "targetPath" ) )
                    {
                        throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
                    }
                    parsed.add( "targetPath" );
                    resource.setTargetPath( getTrimmedValue( childElement.getText() ) );
                }
                else if ( childElement.getName().equals( "filtering" )  )
                {
                    if ( parsed.contains( "filtering" ) )
                    {
                        throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
                    }
                    parsed.add( "filtering" );
                    resource.setFiltering( getBooleanValue( getTrimmedValue( childElement.getText() ), "filtering" ) );
                }
                else if ( childElement.getName().equals( "directory" )  )
                {
                    if ( parsed.contains( "directory" ) )
                    {
                        throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
                    }
                    parsed.add( "directory" );
                    resource.setDirectory( getTrimmedValue( childElement.getText() ) );
                }
                else if ( childElement.getName().equals( "includes" )  )
                {
                    if ( parsed.contains( "includes" ) )
                    {
                        throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
                    }
                    parsed.add( "includes" );
                    java.util.List includes = new java.util.ArrayList();
                    resource.setIncludes( includes );
                    for ( Iterator j = childElement.nodeIterator(); j.hasNext(); )
                    {
                        Node n = (Node) j.next();
                        if ( n.getNodeType() != Node.ELEMENT_NODE )
                        {
                        }
                        else
                        {
                            Element listElement = (Element) n;
                            if ( listElement.getName().equals( "include" ) )
                            {
                                includes.add( getTrimmedValue( listElement.getText() ) );
                            }
                            else
                            {
                            }
                        }
                    }
                }
                else if ( childElement.getName().equals( "excludes" )  )
                {
                    if ( parsed.contains( "excludes" ) )
                    {
                        throw new DocumentException( "Duplicated tag: '" + element.getName() + "'");
                    }
                    parsed.add( "excludes" );
                    java.util.List excludes = new java.util.ArrayList();
                    resource.setExcludes( excludes );
                    for ( Iterator j = childElement.nodeIterator(); j.hasNext(); )
                    {
                        Node n = (Node) j.next();
                        if ( n.getNodeType() != Node.ELEMENT_NODE )
                        {
View Full Code Here

TOP

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

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.