View Javadoc
1   package org.codehaus.mojo.jdepend.objects;
2   
3   /*
4    * #%L
5    * JDepend Maven Plugin
6    * %%
7    * Copyright (C) 2006 - 2014 Codehaus
8    * %%
9    * Licensed under the Apache License, Version 2.0 (the "License");
10   * you may not use this file except in compliance with the License.
11   * You may obtain a copy of the License at
12   * 
13   *    http://www.apache.org/licenses/LICENSE-2.0
14   * 
15   * Unless required by applicable law or agreed to in writing, software
16   * distributed under the License is distributed on an "AS IS" BASIS,
17   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18   * See the License for the specific language governing permissions and
19   * limitations under the License.
20   * #L%
21   */
22  
23  import java.util.ArrayList;
24  import java.util.List;
25  
26  /**
27   * @author Who ever this implemented first.
28   */
29  public class JDPackage
30  {
31      /* Elements */
32      private Stats stats;
33  
34      private String packageName;
35  
36      private List<String> abstractClasses;
37  
38      private List<String> concreteClasses;
39  
40      private List<String> dependsUpon;
41  
42      private List<String> usedBy;
43  
44      /**
45       * Creates a new instance of JDPackage.
46       */
47      public JDPackage()
48      {
49      }
50  
51      public String getPackageName()
52      {
53          return this.packageName;
54      }
55  
56      public void setPackageName( String name )
57      {
58          this.packageName = name;
59      }
60  
61      public Stats getStats()
62      {
63          return stats;
64      }
65  
66      public void setStats( Stats stats )
67      {
68          this.stats = stats;
69      }
70  
71      public List<String> getAbstractClasses()
72      {
73          if ( abstractClasses == null )
74          {
75              abstractClasses = new ArrayList<String>();
76          }
77          return abstractClasses;
78      }
79  
80      public void addAbstractClasses( String object )
81      {
82          getAbstractClasses().add( object );
83      }
84  
85      public List<String> getConcreteClasses()
86      {
87          if ( concreteClasses == null )
88          {
89              concreteClasses = new ArrayList<String>();
90          }
91          return concreteClasses;
92      }
93  
94      public void addConcreteClasses( String object )
95      {
96          getConcreteClasses().add( object );
97      }
98  
99      public List<String> getDependsUpon()
100     {
101         if ( dependsUpon == null )
102         {
103             dependsUpon = new ArrayList<String>();
104         }
105         return dependsUpon;
106     }
107 
108     public void addDependsUpon( String object )
109     {
110         getDependsUpon().add( object );
111     }
112 
113     public void addUsedBy( String object )
114     {
115         getUsedBy().add( object );
116     }
117 
118     public List<String> getUsedBy()
119     {
120         if ( usedBy == null )
121         {
122             usedBy = new ArrayList<String>();
123         }
124         return usedBy;
125     }
126 }