Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "pack/jvm/java/javaProjectUtils"

Index

Variables

Const AllJavaAndKotlinFiles

AllJavaAndKotlinFiles: "**/{*.java,*.kt}" = "**/{*.java,*.kt}"

Const AllJavaFiles

AllJavaFiles: "**/*.java" = "**/*.java"

Const JavaAndKotlinSource

JavaAndKotlinSource: "**/src/main/**/{*.java,*.kt}" = "**/src/main/**/{*.java,*.kt}"

Const JavaSourceFiles

JavaSourceFiles: "**/src/main/java/**/*.java" = "**/src/main/java/**/*.java"

Const JavaTestFiles

JavaTestFiles: "**/src/main/test/**/*.java" = "**/src/main/test/**/*.java"

Const KotlinSourceFiles

KotlinSourceFiles: "**/src/main/kotlin/**/*.kt" = "**/src/main/kotlin/**/*.kt"

Const ResourcesDir

ResourcesDir: "**/src/main/resources" = "**/src/main/resources"

Functions

classNameFromFqn

  • classNameFromFqn(fqn: string): string

cleanEmptyFoldersRecursively

  • cleanEmptyFoldersRecursively(folder: string): void

inferStructureAndMovePackage

  • inferStructureAndMovePackage(rootPackage: string, p: Project): Promise<Project>

Const inferStructureAndMovePackageTransform

movePackage

  • movePackage(project: Project, oldPackage: string, newPackage: string, globPattern?: string): Promise<Project>
  • Move files from one package to another. Defaults to working on all Java and Kotlin source. Will work for Scala if you pass in the appropriate glob pattern to select the files you want.

    Parameters

    • project: Project

      project whose files should be moved

    • oldPackage: string

      name of package to move from

    • newPackage: string

      name of package to move to

    • Default value globPattern: string = AllJavaAndKotlinFiles

      glob to select files. Defaults to all Java files in the project

    Returns Promise<Project>

packageNameFromFqn

  • packageNameFromFqn(fqn: string): string

packageToPath

  • packageToPath(pkg: string): string

renameClass

  • renameClass(project: Project, oldClass: string, newClass: string): Promise<Project>
  • Rename all instances of a Java or Kotlin class. This method is somewhat surgical when replacing appearances in Java code but brutal when replacing appearances elsewhere. Renames class stem (start of class name), not just a whole class name Does not change filename, which is necessary in Java.

    Parameters

    • project: Project

      project whose Java classes should be renamed

    • oldClass: string

      name of class to move from

    • newClass: string

      name of class to move to

    Returns Promise<Project>

Generated using TypeDoc