1   package org.apache.maven.model.building;
2   
3   
4   
5   
6   
7   
8   
9   
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  import java.io.File;
23  import java.io.IOException;
24  import java.io.InputStream;
25  import java.io.Reader;
26  import java.util.Map;
27  
28  import org.apache.maven.model.Model;
29  import org.apache.maven.model.io.ModelReader;
30  import org.apache.maven.model.locator.ModelLocator;
31  import org.codehaus.plexus.component.annotations.Component;
32  import org.codehaus.plexus.component.annotations.Requirement;
33  
34  @Component( role = ModelProcessor.class )
35  public class DefaultModelProcessor
36      implements ModelProcessor
37  {
38  
39      @Requirement
40      private ModelLocator locator;
41  
42      @Requirement
43      private ModelReader reader;
44  
45      public DefaultModelProcessor setModelLocator( ModelLocator locator )
46      {
47          this.locator = locator;
48          return this;
49      }
50  
51      public DefaultModelProcessor setModelReader( ModelReader reader )
52      {
53          this.reader = reader;
54          return this;
55      }
56  
57      public File locatePom( File projectDirectory )
58      {
59          return locator.locatePom( projectDirectory );
60      }
61  
62      public Model read( File input, Map<String, ?> options )
63          throws IOException
64      {
65          return reader.read( input, options );
66      }
67  
68      public Model read( Reader input, Map<String, ?> options )
69          throws IOException
70      {
71          return reader.read( input, options );
72      }
73  
74      public Model read( InputStream input, Map<String, ?> options )
75          throws IOException
76      {
77          return reader.read( input, options );
78      }
79  
80  }