Class PluginCodeSource
java.lang.Object
com.ultikits.ultitools.context.PluginCodeSource
The resolved JAR or class directory of a plugin. Internal to the framework; not a public API.
- Since:
- 7.2.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclassNames(String basePackage) Lists binary class names in the package and its subpackages from this source alone.booleanTests the candidate's defining location, without looking at its superclass chain.directoryClassNames(String basePackage) static @Nullable PluginCodeSourceResolves an explicit local scan root, without consulting a class loader.booleanjarClassNames(String basePackage) private static @Nullable Pathpath()static @Nullable PluginCodeSourceResolves the first located class in the plugin's runtime superclass chain, before the Paper API.
-
Field Details
-
CLASS_EXTENSION
- See Also:
-
path
-
directory
private final boolean directory
-
-
Constructor Details
-
PluginCodeSource
-
-
Method Details
-
resolve
Resolves the first located class in the plugin's runtime superclass chain, before the Paper API. A generated subclass with no location inherits its author's scan source.- Parameters:
runtimeClass- the plugin's runtime class- Returns:
- the plugin's local JAR or directory, or null if no local source is available
-
fromPath
Resolves an explicit local scan root, without consulting a class loader. -
path
- Returns:
- the normalized location of this source
-
isDirectory
public boolean isDirectory()- Returns:
- whether this source is a compiled class directory rather than a JAR
-
classNames
Lists binary class names in the package and its subpackages from this source alone. An empty package scans the whole source. Descriptors and entries underMETA-INFare excluded.- Parameters:
basePackage- a dotted package name or the empty string- Returns:
- candidate class names in unspecified order, without loading the classes
- Throws:
IOException- if the source cannot be read
-
defines
Tests the candidate's defining location, without looking at its superclass chain.- Parameters:
candidate- the resolved class to check- Returns:
- whether the class was defined in this source
-
directoryClassNames
- Throws:
IOException
-
jarClassNames
- Throws:
IOException
-
localPath
-