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
35
36
37 @Component( role = ModelProcessor.class )
38 public class DefaultModelProcessor
39 implements ModelProcessor
40 {
41
42 @Requirement
43 private ModelLocator locator;
44
45 @Requirement
46 private ModelReader reader;
47
48 public DefaultModelProcessor setModelLocator( ModelLocator locator )
49 {
50 this.locator = locator;
51 return this;
52 }
53
54 public DefaultModelProcessor setModelReader( ModelReader reader )
55 {
56 this.reader = reader;
57 return this;
58 }
59
60 @Override
61 public File locatePom( File projectDirectory )
62 {
63 return locator.locatePom( projectDirectory );
64 }
65
66 @Override
67 public Model read( File input, Map<String, ?> options )
68 throws IOException
69 {
70 return reader.read( input, options );
71 }
72
73 @Override
74 public Model read( Reader input, Map<String, ?> options )
75 throws IOException
76 {
77 return reader.read( input, options );
78 }
79
80 @Override
81 public Model read( InputStream input, Map<String, ?> options )
82 throws IOException
83 {
84 return reader.read( input, options );
85 }
86
87 }