| 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 |
|
| 2106 |
ghuddy |
21 |
public ElementAccumulator(ArrayList elementTypeList): base()
|
| 2104 |
ghuddy |
22 |
{
|
|
|
23 |
validElementTypes = elementTypeList;
|
|
|
24 |
Elements = new ArrayList();
|
|
|
25 |
}
|
|
|
26 |
|
|
|
27 |
public override void processElement( EA.Element theElement )
|
|
|
28 |
{
|
|
|
29 |
if (validElementTypes.Contains( theElement.Type ))
|
|
|
30 |
{
|
|
|
31 |
//if ( (theElement.Type == "Requirement") && (theElement.Status == "Rejected") )
|
|
|
32 |
// return;
|
|
|
33 |
|
| 2116 |
ghuddy |
34 |
if ( true == EA_DocGenOptions.optionValue(EA_DocGenOptions.boolean_options_e.SUPPRESS_PRIVATE_CLASSES)
|
| 2104 |
ghuddy |
35 |
&& 0 == theElement.Type.CompareTo("Class")
|
|
|
36 |
&& true == theElement.Visibility.StartsWith("Private") )
|
|
|
37 |
{
|
|
|
38 |
// do nothing
|
|
|
39 |
}
|
| 2116 |
ghuddy |
40 |
else if ( true == EA_DocGenOptions.optionValue(EA_DocGenOptions.boolean_options_e.CONSIDER_API_ELEMENTS_ONLY)
|
| 2104 |
ghuddy |
41 |
&& 0 > theElement.StereotypeEx.IndexOf("API") )
|
|
|
42 |
{
|
|
|
43 |
// do nothing
|
|
|
44 |
}
|
|
|
45 |
else
|
|
|
46 |
{
|
|
|
47 |
Elements.Add( theElement );
|
|
|
48 |
}
|
|
|
49 |
}
|
|
|
50 |
}
|
|
|
51 |
}
|
|
|
52 |
|
|
|
53 |
}
|