- java.lang.Object
-
- uk.autores.processing.handlers.ResourceFiling
-
public final class ResourceFiling extends Object
Utility type for working withFiler
. Sample usage:Filer filer = ...; String annotationPackage = "foo.bar"; String resourcePath = "/META-INF/foo.txt"; String pkg = ResourceFiling.pkg(annotationPackage, resourcePath); String relativeName = ResourceFiling.relativeName(resourcePath); FileObject fo = filer.getResource(location, pkg, relativeName);
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static CharSequence
pkg(CharSequence annotationPackage, CharSequence resourcePath)
Resolves the package string to be passed toFiler.getResource(JavaFileManager.Location, CharSequence, CharSequence)
.static CharSequence
relativeName(CharSequence resourcePath)
Resolves the relative name to be passed toFiler.getResource(JavaFileManager.Location, CharSequence, CharSequence)
.
-
-
-
Method Detail
-
pkg
public static CharSequence pkg(CharSequence annotationPackage, CharSequence resourcePath)
Resolves the package string to be passed toFiler.getResource(JavaFileManager.Location, CharSequence, CharSequence)
.- Parameters:
annotationPackage
- the annotated packageresourcePath
- non-empty resource path- Returns:
- the package to use in the filer
-
relativeName
public static CharSequence relativeName(CharSequence resourcePath)
Resolves the relative name to be passed toFiler.getResource(JavaFileManager.Location, CharSequence, CharSequence)
.- Parameters:
resourcePath
- non-empty resource path as specified in annotation- Returns:
- the resource name to use in the filer
-
-