Package org.apache.maven.toolchain.model

Examples of org.apache.maven.toolchain.model.ToolchainModel


                if ( lst != null )
                {
                    Iterator it = lst.iterator();
                    while ( it.hasNext() )
                    {
                        ToolchainModel toolchainModel = (ToolchainModel) it.next();
                        ToolchainFactory fact = (ToolchainFactory) factories.get( toolchainModel.getType() );
                        if ( fact != null )
                        {
                            toRet.add( fact.createToolchain( toolchainModel ) );
                        }
                        else
                        {
                            getLogger().error("Missing toolchain factory for type:" + toolchainModel.getType() + ". Possibly caused by misconfigured project.");
                        }
                    }
                }
            }
            Iterator it = factories.values().iterator();
View Full Code Here


        {
            //HACK to make compiler plugin happy
            type = "jdk";
        }
        Object obj = context.get( getStorageKey( type ) );
        ToolchainModel model = (ToolchainModel)obj;
       
        if ( model != null )
        {
            try
            {
View Full Code Here

     * @return ToolchainModel
     */
    private ToolchainModel parseToolchainModel( String tagName, XmlPullParser parser, boolean strict )
        throws IOException, XmlPullParserException
    {
        ToolchainModel toolchainModel = new ToolchainModel();
        java.util.Set parsed = new java.util.HashSet();
        while ( parser.nextTag() == XmlPullParser.START_TAG )
        {
            if ( checkFieldWithDuplicate( parser, "type", null, parsed ) )
            {
                toolchainModel.setType( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "provides", null, parsed ) )
            {
                toolchainModel.setProvides( Xpp3DomBuilder.build( parser ) );
            }
            else if ( checkFieldWithDuplicate( parser, "configuration", null, parsed ) )
            {
                toolchainModel.setConfiguration( Xpp3DomBuilder.build( parser ) );
            }
            else
            {
                if ( strict )
                {
View Full Code Here

            serializer.attribute( "", "xsi:schemaLocation", "http://maven.apache.org/TOOLCHAINS/1.0.0 http://maven.apache.org/xsd/toolchains-1.0.0.xsd" );
            if ( ( persistedToolchains.getToolchains() != null ) && ( persistedToolchains.getToolchains().size() > 0 ) )
            {
                for ( Iterator iter = persistedToolchains.getToolchains().iterator(); iter.hasNext(); )
                {
                    ToolchainModel o = (ToolchainModel) iter.next();
                    writeToolchainModel( o, "toolchain", serializer );
                }
            }
            serializer.endTag( NAMESPACE, tagName );
        }
View Full Code Here

    public Toolchain getToolchainFromBuildContext( String type, MavenSession session )
    {
        Map<String, Object> context = retrieveContext( session );

        ToolchainModel model = (ToolchainModel) context.get( getStorageKey( type ) );

        if ( model != null )
        {
            try
            {
View Full Code Here

                if ( lst != null )
                {
                    Iterator it = lst.iterator();
                    while ( it.hasNext() )
                    {
                        ToolchainModel toolchainModel = (ToolchainModel) it.next();
                        ToolchainFactory fact = (ToolchainFactory) factories.get( toolchainModel.getType() );
                        if ( fact != null )
                        {
                            toRet.add( fact.createToolchain( toolchainModel ) );
                        }
                        else
                        {
                            getLogger().error("Missing toolchain factory for type:" + toolchainModel.getType() + ". Possibly caused by misconfigured project.");
                        }
                    }
                }
            }
            Iterator it = factories.values().iterator();
View Full Code Here

        {
            //HACK to make compiler plugin happy
            type = "jdk";
        }
        Object obj = context.get( getStorageKey( type ) );
        ToolchainModel model = (ToolchainModel)obj;
       
        if ( model != null )
        {
            try
            {
View Full Code Here

     */
    private ToolchainModel parseToolchainModel( XmlPullParser parser, boolean strict )
        throws IOException, XmlPullParserException
    {
        String tagName = parser.getName();
        ToolchainModel toolchainModel = new ToolchainModel();
        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 ) )
            {
                toolchainModel.setType( getTrimmedValue( parser.nextText() ) );
            }
            else if ( checkFieldWithDuplicate( parser, "provides", null, parsed ) )
            {
                toolchainModel.setProvides( Xpp3DomBuilder.build( parser ) );
            }
            else if ( checkFieldWithDuplicate( parser, "configuration", null, parsed ) )
            {
                toolchainModel.setConfiguration( Xpp3DomBuilder.build( parser ) );
            }
            else
            {
                checkUnknownElement( parser, strict );
            }
View Full Code Here

        serializer.attribute( "", "xsi:schemaLocation", "http://maven.apache.org/TOOLCHAINS/1.0.0 http://maven.apache.org/xsd/toolchains-1.0.0.xsd" );
        if ( ( persistedToolchains.getToolchains() != null ) && ( persistedToolchains.getToolchains().size() > 0 ) )
        {
            for ( Iterator iter = persistedToolchains.getToolchains().iterator(); iter.hasNext(); )
            {
                ToolchainModel o = (ToolchainModel) iter.next();
                writeToolchainModel( o, "toolchain", serializer );
            }
        }
        serializer.endTag( NAMESPACE, tagName );
    } //-- void writePersistedToolchains( PersistedToolchains, String, XmlSerializer )
View Full Code Here

TOP

Related Classes of org.apache.maven.toolchain.model.ToolchainModel

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.