@Override protected void mergeModelBase_Modules( ModelBase target, ModelBase source, boolean sourceDominant, Map<Object, Object> context ) { List<String> src = source.getModules(); if ( !src.isEmpty() && sourceDominant ) { List<Integer> indices = new ArrayList<>(); List<String> tgt = target.getModules(); Set<String> excludes = new LinkedHashSet<>( tgt ); List<String> merged = new ArrayList<>( tgt.size() + src.size() ); merged.addAll( tgt ); for ( int i = 0, n = tgt.size(); i < n; i++ ) { indices.add( i ); } for ( int i = 0, n = src.size(); i < n; i++ ) { String s = src.get( i ); if ( !excludes.contains( s ) ) { merged.add( s ); indices.add( ~i ); } } target.setModules( merged ); target.setLocation( "modules", InputLocation.merge( target.getLocation( "modules" ), source.getLocation( "modules" ), indices ) ); } }
protected void mergeModelBase_Properties( ModelBase target, ModelBase source, boolean sourceDominant, Map<Object, Object> context ) { Properties merged = new Properties(); if ( sourceDominant ) { merged.putAll( target.getProperties() ); merged.putAll( source.getProperties() ); } else { merged.putAll( source.getProperties() ); merged.putAll( target.getProperties() ); } target.setProperties( merged ); target.setLocation( "properties", InputLocation.merge( target.getLocation( "properties" ), source.getLocation( "properties" ), sourceDominant ) ); }
@Override protected void mergeModelBase_Properties( ModelBase target, ModelBase source, boolean sourceDominant, Map<Object, Object> context ) { Properties merged = new Properties(); if ( sourceDominant ) { merged.putAll( target.getProperties() ); putAll( merged, source.getProperties(), CHILD_DIRECTORY_PROPERTY ); } else { putAll( merged, source.getProperties(), CHILD_DIRECTORY_PROPERTY ); merged.putAll( target.getProperties() ); } target.setProperties( merged ); target.setLocation( "properties", InputLocation.merge( target.getLocation( "properties" ), source.getLocation( "properties" ), sourceDominant ) ); }
InputLocation _location; _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source ); modelBase.setLocation( "", _location ); for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- ) InputLocation _locations; _locations = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source ); modelBase.setLocation( "modules", _locations ); while ( parser.nextTag() == XmlPullParser.START_TAG ) modelBase.setLocation( "properties", _locations ); while ( parser.nextTag() == XmlPullParser.START_TAG ) modelBase.setLocation( "reports", _location ); modelBase.setReports( org.codehaus.plexus.util.xml.Xpp3DomBuilder.build( parser, true ) );
@Override protected void mergeModelBase_Modules( ModelBase target, ModelBase source, boolean sourceDominant, Map<Object, Object> context ) { List<String> src = source.getModules(); if ( !src.isEmpty() && sourceDominant ) { List<Integer> indices = new ArrayList<>(); List<String> tgt = target.getModules(); Set<String> excludes = new LinkedHashSet<>( tgt ); List<String> merged = new ArrayList<>( tgt.size() + src.size() ); merged.addAll( tgt ); for ( int i = 0, n = tgt.size(); i < n; i++ ) { indices.add( i ); } for ( int i = 0, n = src.size(); i < n; i++ ) { String s = src.get( i ); if ( !excludes.contains( s ) ) { merged.add( s ); indices.add( ~i ); } } target.setModules( merged ); target.setLocation( "modules", InputLocation.merge( target.getLocation( "modules" ), source.getLocation( "modules" ), indices ) ); } }
protected void mergeModelBase_Properties( ModelBase target, ModelBase source, boolean sourceDominant, Map<Object, Object> context ) { Properties merged = new Properties(); if ( sourceDominant ) { merged.putAll( target.getProperties() ); merged.putAll( source.getProperties() ); } else { merged.putAll( source.getProperties() ); merged.putAll( target.getProperties() ); } target.setProperties( merged ); target.setLocation( "properties", InputLocation.merge( target.getLocation( "properties" ), source.getLocation( "properties" ), sourceDominant ) ); }
@Override protected void mergeModelBase_Properties( ModelBase target, ModelBase source, boolean sourceDominant, Map<Object, Object> context ) { Properties merged = new Properties(); if ( sourceDominant ) { merged.putAll( target.getProperties() ); putAll( merged, source.getProperties(), CHILD_DIRECTORY_PROPERTY ); } else { putAll( merged, source.getProperties(), CHILD_DIRECTORY_PROPERTY ); merged.putAll( target.getProperties() ); } target.setProperties( merged ); target.setLocation( "properties", InputLocation.merge( target.getLocation( "properties" ), source.getLocation( "properties" ), sourceDominant ) ); }
InputLocation _location; _location = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source ); modelBase.setLocation( "", _location ); for ( int i = parser.getAttributeCount() - 1; i >= 0; i-- ) InputLocation _locations; _locations = new InputLocation( parser.getLineNumber(), parser.getColumnNumber(), source ); modelBase.setLocation( "modules", _locations ); while ( parser.nextTag() == XmlPullParser.START_TAG ) modelBase.setLocation( "properties", _locations ); while ( parser.nextTag() == XmlPullParser.START_TAG ) modelBase.setLocation( "reports", _location ); modelBase.setReports( org.codehaus.plexus.util.xml.Xpp3DomBuilder.build( parser, true ) );