Subversion Repositories DevTools

Rev

Rev 2106 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2104 ghuddy 1
using System;
2
using System.Collections;
3
 
4
namespace EA_DocGen
5
{
6
   /// <summary>
7
   /// This class is one derived from the EA_UtilitiesRecursionWorker base class so that
8
   /// an instance of it can be used as a parameter in the EA_Utilities.findAndProcessPackageElements
9
   /// method which recursively parses a given package. Thus, clients can parse EA model structure but
10
   /// specify their own functionality to be carried out on packages and elements found in the 
11
   /// parsing.
12
   /// This particular derived class is designed to collect a list of element names from the
13
   /// package, from elements that have a type that is acceptable.
14
   /// </summary>
15
   public class ElementAccumulator : EA_UtilitiesRecursionWorker
16
   {
17
      public ArrayList Elements = null;
18
 
19
      private ArrayList validElementTypes = null;
20
 
21
      private EA_Utilities EA_Utils = null;
22
 
23
      public ElementAccumulator(ArrayList elementTypeList, EA_Utilities theEA_Utils): base()
24
      {
25
         validElementTypes = elementTypeList;
26
         EA_Utils = theEA_Utils;
27
         Elements = new ArrayList();
28
      }
29
 
30
      public override void processElement( EA.Element theElement )
31
      {
32
         if (validElementTypes.Contains( theElement.Type ))
33
         {
34
            //if ( (theElement.Type == "Requirement") && (theElement.Status == "Rejected") )
35
            //   return;
36
 
37
            if (  true == EA_Utils.options.opt_SuppressPrivateClasses
38
               &&    0 == theElement.Type.CompareTo("Class")
39
               && true == theElement.Visibility.StartsWith("Private") )
40
            {
41
               // do nothing
42
            }
43
            else if (   true == EA_Utils.options.opt_ConsiderAPIElementsOnly
44
               &&    0  > theElement.StereotypeEx.IndexOf("API") )
45
            {
46
               // do nothing
47
            }
48
            else
49
            {
50
               Elements.Add( theElement );
51
            }
52
         }
53
      }
54
   }
55
 
56
}