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 @Override
58 public File locatePom( File projectDirectory )
59 {
60 return locator.locatePom( projectDirectory );
61 }
62
63 @Override
64 public Model read( File input, Map<String, ?> options )
65 throws IOException
66 {
67 return reader.read( input, options );
68 }
69
70 @Override
71 public Model read( Reader input, Map<String, ?> options )
72 throws IOException
73 {
74 return reader.read( input, options );
75 }
76
77 @Override
78 public Model read( InputStream input, Map<String, ?> options )
79 throws IOException
80 {
81 return reader.read( input, options );
82 }
83
84 }