View Javadoc
1   package org.codehaus.plexus.languages.java.jpms;
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one
5    * or more contributor license agreements.  See the NOTICE file
6    * distributed with this work for additional information
7    * regarding copyright ownership.  The ASF licenses this file
8    * to you under the Apache License, Version 2.0 (the
9    * "License"); you may not use this file except in compliance
10   * with the License.  You may obtain a copy of the License at
11   *
12   *   http://www.apache.org/licenses/LICENSE-2.0
13   *
14   * Unless required by applicable law or agreed to in writing,
15   * software distributed under the License is distributed on an
16   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17   * KIND, either express or implied.  See the License for the
18   * specific language governing permissions and limitations
19   * under the License.
20   */
21  
22  import java.util.ArrayList;
23  import java.util.Collection;
24  import java.util.HashMap;
25  import java.util.Map;
26  
27  /**
28   * Holds the results of the project analyzer
29   * 
30   * @author Robert Scholte
31   * @since 1.0.0
32   */
33  public class ResolvePathsResult<T>
34  {
35      /**
36       * Source of the modulename 
37       */
38      public enum ModuleNameSource
39      {
40          FILENAME, MANIFEST, MODULEDESCRIPTOR
41      }
42      
43      private JavaModuleDescriptor mainModuleDescriptor;
44      
45      /**
46       * Ordered map, respects the classpath order
47       */
48      private Map<T, JavaModuleDescriptor> pathElements;
49      
50      private Map<T, ModuleNameSource> modulepathElements = new HashMap<>();
51      
52      private Collection<T> classpathElements = new ArrayList<>();
53      
54      void setMainModuleDescriptor( JavaModuleDescriptor mainModuleDescriptor )
55      {
56          this.mainModuleDescriptor = mainModuleDescriptor;
57      }
58  
59      public JavaModuleDescriptor getMainModuleDescriptor()
60      {
61          return mainModuleDescriptor;
62      }
63  
64      void setPathElements( Map<T, JavaModuleDescriptor> pathElements )
65      {
66          this.pathElements = pathElements;
67      }
68      
69      /**
70       * Ordered map, respects the classpath order
71       */
72      public Map<T, JavaModuleDescriptor> getPathElements()
73      {
74          return pathElements;
75      }
76      
77      void setClasspathElements( Collection<T> classpathElements )
78      {
79          this.classpathElements = classpathElements;
80      }
81      
82      public Collection<T> getClasspathElements()
83      {
84          return classpathElements;
85      }
86      
87      void setModulepathElements( Map<T, ModuleNameSource> modulepathElements )
88      {
89          this.modulepathElements = modulepathElements;
90      }
91      
92      public Map<T, ModuleNameSource> getModulepathElements()
93      {
94          return modulepathElements;
95      }
96  }