| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static Path | |
| public static String | |
| public static Path | fileInPackageAbsolutePath(String
the root directory in which the package resides root, String the package in which the file resides, like "com.laamella.parser" pkg, String the filename of the file in the package. file)Calculates the path to a file in a package. |
| public static Path | |
| public static Path | |
| public static String | |
| public static String | |
| public static Path | |
| public static String | |
| public static Path | packageAbsolutePath(String
the root directory in which the package resides root, String the package, like "com.laamella.parser" pkg)Calculates the path of a package. |
| public static Path | |
| public static String | packageToPath(String pkg)
Converts a package name like "com.laamella.parser" to a path like "com/laamella/parser" |
| public static String | |
| public static Path | subtractPaths(Path full, Path difference)
Shortens path "full" by cutting "difference" off the end of it. |
| CodeGenerationUtils | back to summary |
|---|---|
| private CodeGenerationUtils() | |
| classLoaderRoot | back to summary |
|---|---|
public static Path classLoaderRoot(Class<?> c)
| |
| f | back to summary |
|---|---|
| public static String f(String format, Object... params) A shortcut to String.format. | |
| fileInPackageAbsolutePath | back to summary |
|---|---|
| public static Path fileInPackageAbsolutePath(String root, String pkg, String file) Calculates the path to a file in a package. | |
| fileInPackageAbsolutePath | back to summary |
|---|---|
| public static Path fileInPackageAbsolutePath(Path root, String pkg, String file) | |
| fileInPackageRelativePath | back to summary |
|---|---|
| public static Path fileInPackageRelativePath(String pkg, String file) Turns a package and a file into a relative path. "com.laamella" and "Simple.java" will become "com/laamella/Simple.java" | |
| getterName | back to summary |
|---|---|
| public static String getterName(Class<?> type, String name) | |
| getterToPropertyName | back to summary |
|---|---|
| public static String getterToPropertyName(String getterName) | |
| mavenModuleRoot | back to summary |
|---|---|
| public static Path mavenModuleRoot(Class<?> c) Useful for locating source code in your Maven project. Finds the classpath for class c, then backs up out of "target/(test-)classes", giving the directory containing the pom.xml. | |
| optionalOf | back to summary |
|---|---|
| public static String optionalOf(String text, boolean isOptional) | |
| packageAbsolutePath | back to summary |
|---|---|
| public static Path packageAbsolutePath(String root, String pkg) Calculates the path of a package. | |
| packageAbsolutePath | back to summary |
|---|---|
| public static Path packageAbsolutePath(Path root, String pkg) | |
| packageToPath | back to summary |
|---|---|
| public static String packageToPath(String pkg) Converts a package name like "com.laamella.parser" to a path like "com/laamella/parser" | |
| setterName | back to summary |
|---|---|
| public static String setterName(String fieldName) | |
| subtractPaths | back to summary |
|---|---|
| public static Path subtractPaths(Path full, Path difference) Shortens path "full" by cutting "difference" off the end of it. | |