test_class.declarator: directoryManager
test_class.modifier: private
test_class.original_string: private SourceDirectoryManager directoryManager;
test_class.type: SourceDirectoryManager
test_class.var_name: directoryManager
test_class.declarator: context = new CompilerContext()
test_class.modifier: private
test_class.original_string: private CompilerContext context = new CompilerContext();
test_class.type: CompilerContext
test_class.var_name: context
test_class.file: compiler/ballerina-lang/src/test/java/org/wso2/ballerinalang/compiler/SourceDirectoryManagerTest.java
test_class.identifier: SourceDirectoryManagerTest
test_case.body: @Test(description = "Return module should be equivalence to the expected module")
      public void testGetPackageID() {
          PackageID fruits = directoryManager.getPackageID("fruits");
          Names names = Names.getInstance(context);
          PackageID expectedPackageId = new PackageID(names.fromString("abc"),
                                                      names.fromString("fruits"),
                                                      names.fromString("0.0.1"));
          Assert.assertEquals(fruits, expectedPackageId);
      }
test_case.class_method_signature: SourceDirectoryManagerTest.testGetPackageID()
test_case.full_signature: @Test(description = "Return module should be equivalence to the expected module") public void testGetPackageID()
test_case.identifier: testGetPackageID
test_case.invocations: getPackageID getInstance fromString fromString fromString assertEquals
test_case.modifiers: @Test(description = "Return module should be equivalence to the expected module") public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetPackageID()
focal_class.declarator: PROJECT_DIR_KEY =
              new CompilerContext.Key<>()
focal_class.modifier: private static final
focal_class.original_string: private static final CompilerContext.Key<SourceDirectoryManager> PROJECT_DIR_KEY =
              new CompilerContext.Key<>();
focal_class.type: CompilerContext.Key<SourceDirectoryManager>
focal_class.var_name: PROJECT_DIR_KEY
focal_class.declarator: options
focal_class.modifier: private final
focal_class.original_string: private final CompilerOptions options;
focal_class.type: CompilerOptions
focal_class.var_name: options
focal_class.declarator: names
focal_class.modifier: private final
focal_class.original_string: private final Names names;
focal_class.type: Names
focal_class.var_name: names
focal_class.declarator: sourceDirectory
focal_class.modifier: private final
focal_class.original_string: private final SourceDirectory sourceDirectory;
focal_class.type: SourceDirectory
focal_class.var_name: sourceDirectory
focal_class.declarator: manifest
focal_class.modifier: private
focal_class.original_string: private Manifest manifest;
focal_class.type: Manifest
focal_class.var_name: manifest
focal_class.file: compiler/ballerina-lang/src/main/java/org/wso2/ballerinalang/compiler/SourceDirectoryManager.java
focal_class.identifier: SourceDirectoryManager
focal_class.interfaces: implements Project
focal_class.class_method_signature: SourceDirectoryManager.getInstance(CompilerContext context)
focal_class.full_signature: public static SourceDirectoryManager getInstance(CompilerContext context)
focal_class.identifier: getInstance
focal_class.modifiers: public static
focal_class.parameters: (CompilerContext context)
focal_class.return: SourceDirectoryManager
focal_class.signature: SourceDirectoryManager getInstance(CompilerContext context)
focal_class.class_method_signature: SourceDirectoryManager.SourceDirectoryManager(CompilerContext context)
focal_class.full_signature: private  SourceDirectoryManager(CompilerContext context)
focal_class.identifier: SourceDirectoryManager
focal_class.modifiers: private
focal_class.parameters: (CompilerContext context)
focal_class.signature:  SourceDirectoryManager(CompilerContext context)
focal_class.class_method_signature: SourceDirectoryManager.listSourceFilesAndPackages()
focal_class.full_signature: public Stream<PackageID> listSourceFilesAndPackages()
focal_class.identifier: listSourceFilesAndPackages
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Stream<PackageID>
focal_class.signature: Stream<PackageID> listSourceFilesAndPackages()
focal_class.class_method_signature: SourceDirectoryManager.getManifest()
focal_class.full_signature: private Manifest getManifest()
focal_class.identifier: getManifest
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: Manifest
focal_class.signature: Manifest getManifest()
focal_class.class_method_signature: SourceDirectoryManager.getPackageID(String sourcePackage)
focal_class.full_signature: public PackageID getPackageID(String sourcePackage)
focal_class.identifier: getPackageID
focal_class.modifiers: public
focal_class.parameters: (String sourcePackage)
focal_class.return: PackageID
focal_class.signature: PackageID getPackageID(String sourcePackage)
focal_class.class_method_signature: SourceDirectoryManager.getSourceDirectory()
focal_class.full_signature: public SourceDirectory getSourceDirectory()
focal_class.identifier: getSourceDirectory
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: SourceDirectory
focal_class.signature: SourceDirectory getSourceDirectory()
focal_class.class_method_signature: SourceDirectoryManager.initializeAndGetSourceDirectory(CompilerContext context)
focal_class.full_signature: private SourceDirectory initializeAndGetSourceDirectory(CompilerContext context)
focal_class.identifier: initializeAndGetSourceDirectory
focal_class.modifiers: private
focal_class.parameters: (CompilerContext context)
focal_class.return: SourceDirectory
focal_class.signature: SourceDirectory initializeAndGetSourceDirectory(CompilerContext context)
focal_class.class_method_signature: SourceDirectoryManager.getOrgName(Manifest manifest)
focal_class.full_signature: private Name getOrgName(Manifest manifest)
focal_class.identifier: getOrgName
focal_class.modifiers: private
focal_class.parameters: (Manifest manifest)
focal_class.return: Name
focal_class.signature: Name getOrgName(Manifest manifest)
focal_class.class_method_signature: SourceDirectoryManager.checkIfSourcesExists(String pkg)
focal_class.full_signature:  boolean checkIfSourcesExists(String pkg)
focal_class.identifier: checkIfSourcesExists
focal_class.parameters: (String pkg)
focal_class.return: boolean
focal_class.signature: boolean checkIfSourcesExists(String pkg)
focal_class.class_method_signature: SourceDirectoryManager.isModuleExists(PackageID moduleId)
focal_class.full_signature: @Override public boolean isModuleExists(PackageID moduleId)
focal_class.identifier: isModuleExists
focal_class.modifiers: @Override public
focal_class.parameters: (PackageID moduleId)
focal_class.return: boolean
focal_class.signature: boolean isModuleExists(PackageID moduleId)
focal_class.class_method_signature: SourceDirectoryManager.getBaloPath(PackageID moduleId)
focal_class.full_signature: @Override public Path getBaloPath(PackageID moduleId)
focal_class.identifier: getBaloPath
focal_class.modifiers: @Override public
focal_class.parameters: (PackageID moduleId)
focal_class.return: Path
focal_class.signature: Path getBaloPath(PackageID moduleId)
focal_method.body: public PackageID getPackageID(String sourcePackage) {
          List<String> sourceFileNames = this.sourceDirectory.getSourceFileNames();
          Name orgName = getOrgName(this.manifest);
          Name version = new Name(this.manifest.getProject().getVersion());
  
          //Check for built-in packages
          if (orgName.equals(Names.BUILTIN_ORG)) {
              return new PackageID(orgName, names.fromString(sourcePackage), version);
          }
  
          //Check for source files
          if (sourceFileNames.contains(sourcePackage)) {
              return new PackageID(sourcePackage);
          }
  
          //Check for packages
          List<String> packageNames = this.sourceDirectory.getSourcePackageNames();
          if (packageNames.contains(sourcePackage)) {
              return new PackageID(orgName, names.fromString(sourcePackage), version);
          }
  
          return null;
      }
focal_method.class_method_signature: SourceDirectoryManager.getPackageID(String sourcePackage)
focal_method.full_signature: public PackageID getPackageID(String sourcePackage)
focal_method.identifier: getPackageID
focal_method.invocations: getSourceFileNames getOrgName getVersion getProject equals fromString contains getSourcePackageNames contains fromString
focal_method.modifiers: public
focal_method.parameters: (String sourcePackage)
focal_method.return: PackageID
focal_method.signature: PackageID getPackageID(String sourcePackage)