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 javax.inject.Inject;
29 import javax.inject.Named;
30 import javax.inject.Singleton;
31
32 import org.apache.maven.model.Model;
33 import org.apache.maven.model.io.ModelReader;
34 import org.apache.maven.model.locator.ModelLocator;
35 import org.eclipse.sisu.Typed;
36
37
38
39
40 @Named
41 @Singleton
42 @Typed( ModelProcessor.class )
43 public class DefaultModelProcessor
44 implements ModelProcessor
45 {
46
47 @Inject
48 private ModelLocator locator;
49
50 @Inject
51 private ModelReader reader;
52
53 public DefaultModelProcessor setModelLocator( ModelLocator locator )
54 {
55 this.locator = locator;
56 return this;
57 }
58
59 public DefaultModelProcessor setModelReader( ModelReader reader )
60 {
61 this.reader = reader;
62 return this;
63 }
64
65 @Override
66 public File locatePom( File projectDirectory )
67 {
68 return locator.locatePom( projectDirectory );
69 }
70
71 @Override
72 public Model read( File input, Map<String, ?> options )
73 throws IOException
74 {
75 return reader.read( input, options );
76 }
77
78 @Override
79 public Model read( Reader input, Map<String, ?> options )
80 throws IOException
81 {
82 return reader.read( input, options );
83 }
84
85 @Override
86 public Model read( InputStream input, Map<String, ?> options )
87 throws IOException
88 {
89 return reader.read( input, options );
90 }
91
92 }