package ca.ubc.ece.salt.sdjsb.analysis.learning.apis;

import java.util.List;

import ca.ubc.ece.salt.sdjsb.analysis.learning.apis.Keyword.KeywordType;

/**
 * Defines the default JavaScript API and stores all Node.js packages that
 * we want to include.
 */
public class TopLevelAPI extends AbstractAPI {

	protected List<PackageAPI> packages;
	
	/**
	 * @param keywords The JavaScript keywords.
	 * @param methodNames The methods in the API.
	 * @param fieldNames The fields in the API.
	 * @param constantNames The constants in the API.
	 * @param eventNames The events in the API.
	 */
	public TopLevelAPI(List<String> keywords, List<PackageAPI> packages,
					   List<String> methodNames, List<String> fieldNames, 
					   List<String> constantNames, List<String> eventNames,
					   List<ClassAPI> classes) {
		super(methodNames, fieldNames, constantNames, eventNames, classes);
		
		for(String keyword : keywords) {
			this.keywords.add(new Keyword(KeywordType.RESERVED, keyword));
		}
		
		this.packages = packages;
	}

}

@@ -299,17 +299,16 @@
 ctAPI %7B%0A
-%0A
 %09protect
@@ -337,17 +337,16 @@
 ckages;%0A
-%09
 %0A%09/**%0A%09 
@@ -984,18 +984,16 @@
 ));%0A%09%09%7D%0A
-%09%09
 %0A%09%09this.
@@ -1016,11 +1016,75 @@
 ges;%0A%09%7D%0A
+%09%0A%09public List%3CPackageAPI%3E getPackages() %7B%0A%09%09return packages;%0A%09%7D
 %0A%7D%0A

Add getter for packages on AbstractAPI