104
105 /**
106 * Exclude all files with particular names from being scanned.
107 * This will typically be for directories like SCCS, Codemgr_wsdata, etc
108 * @param names The names of files to be excluded.
109 */
110 public void exclude(String[] names) {
111 for (int i = 0; i < names.length; i++) {
112 String name = names[i];
113 excludeList.put(name, name);
114 }
115 }
116
117 /**
118 * Nominate a class to read files that have a particular extension.
119 * @param extn The extension for which this class is to be used
120 * @param commentStreamClass
121 * A class to read files of a particular extension.
122 * The class must be a subtype of CommentStream
123 */
124 public void addExtension(String extn, Class commentStreamClass) {
125 if (!extn.startsWith("."))
126 throw new IllegalArgumentException("extension must begin with `.'");
127 if (commentStreamClass != null && !CommentStream.class.isAssignableFrom(commentStreamClass))
128 throw new IllegalArgumentException("class must be a subtype of " + CommentStream.class.getName());
129
130 extensionTable.put(extn, commentStreamClass);
131 }
132
133 /**
134 * Get the class used to handle an extension.
135 * @param extn The extension in question
136 * @return the class previously registered with addExtension
137 */
138 public Class getClassForExtension(String extn) {
139 return extensionTable.get(extn);
140 }
141
142 /**
143 * Call to register the methods which are test methods.
144 */
145 public void foundTestMethod(String name) {
146 testMethods.add(name);
147 }
148
149 protected boolean verbose = false;
150 protected Map<String, String> tdValues = new HashMap<>();
151 protected boolean scanClasses = false;
152 protected File currFile;
153 protected Map<String, String> excludeList = new HashMap<>();
154 protected Map<String, Class> extensionTable = new HashMap<>();
155 protected List<String> testMethods;
156 protected static final String[] excludeNames = {
157 "SCCS", "deleted_files", ".svn"
158 };
159 }
|
104
105 /**
106 * Exclude all files with particular names from being scanned.
107 * This will typically be for directories like SCCS, Codemgr_wsdata, etc
108 * @param names The names of files to be excluded.
109 */
110 public void exclude(String[] names) {
111 for (int i = 0; i < names.length; i++) {
112 String name = names[i];
113 excludeList.put(name, name);
114 }
115 }
116
117 /**
118 * Nominate a class to read files that have a particular extension.
119 * @param extn The extension for which this class is to be used
120 * @param commentStreamClass
121 * A class to read files of a particular extension.
122 * The class must be a subtype of CommentStream
123 */
124 public void addExtension(String extn, Class<?> commentStreamClass) {
125 if (!extn.startsWith("."))
126 throw new IllegalArgumentException("extension must begin with `.'");
127 if (commentStreamClass != null && !CommentStream.class.isAssignableFrom(commentStreamClass))
128 throw new IllegalArgumentException("class must be a subtype of " + CommentStream.class.getName());
129
130 extensionTable.put(extn, commentStreamClass);
131 }
132
133 /**
134 * Get the class used to handle an extension.
135 * @param extn The extension in question
136 * @return the class previously registered with addExtension
137 */
138 public Class<?> getClassForExtension(String extn) {
139 return extensionTable.get(extn);
140 }
141
142 /**
143 * Call to register the methods which are test methods.
144 */
145 public void foundTestMethod(String name) {
146 testMethods.add(name);
147 }
148
149 protected boolean verbose = false;
150 protected Map<String, String> tdValues = new HashMap<>();
151 protected boolean scanClasses = false;
152 protected File currFile;
153 protected Map<String, String> excludeList = new HashMap<>();
154 protected Map<String, Class<?>> extensionTable = new HashMap<>();
155 protected List<String> testMethods;
156 protected static final String[] excludeNames = {
157 "SCCS", "deleted_files", ".svn"
158 };
159 }
|