Package net.bytebuddy.dynamic.loading
Class PackageDefinitionStrategy.ManifestReading.SealBaseLocator.ForTypeResourceUrl
- java.lang.Object
-
- net.bytebuddy.dynamic.loading.PackageDefinitionStrategy.ManifestReading.SealBaseLocator.ForTypeResourceUrl
-
- All Implemented Interfaces:
PackageDefinitionStrategy.ManifestReading.SealBaseLocator
- Enclosing interface:
- PackageDefinitionStrategy.ManifestReading.SealBaseLocator
public static class PackageDefinitionStrategy.ManifestReading.SealBaseLocator.ForTypeResourceUrl extends java.lang.Object implements PackageDefinitionStrategy.ManifestReading.SealBaseLocator
A seal base locator that imitates the behavior of aURLClassLoader
, i.e. tries to deduct the base from a class's resource URL.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.loading.PackageDefinitionStrategy.ManifestReading.SealBaseLocator
PackageDefinitionStrategy.ManifestReading.SealBaseLocator.ForFixedValue, PackageDefinitionStrategy.ManifestReading.SealBaseLocator.ForTypeResourceUrl, PackageDefinitionStrategy.ManifestReading.SealBaseLocator.NonSealing
-
-
Constructor Summary
Constructors Constructor Description ForTypeResourceUrl()
Creates a new seal base locator that attempts deduction from a type's URL while using aPackageDefinitionStrategy.ManifestReading.SealBaseLocator.NonSealing
seal base locator as a fallback.ForTypeResourceUrl(PackageDefinitionStrategy.ManifestReading.SealBaseLocator fallback)
Creates a new seal base locator that attempts deduction from a type's URL.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.net.URL
findSealBase(java.lang.ClassLoader classLoader, java.lang.String typeName)
Locates the URL that should be used for sealing a package.
-
-
-
Constructor Detail
-
ForTypeResourceUrl
public ForTypeResourceUrl()
Creates a new seal base locator that attempts deduction from a type's URL while using aPackageDefinitionStrategy.ManifestReading.SealBaseLocator.NonSealing
seal base locator as a fallback.
-
ForTypeResourceUrl
public ForTypeResourceUrl(PackageDefinitionStrategy.ManifestReading.SealBaseLocator fallback)
Creates a new seal base locator that attempts deduction from a type's URL.- Parameters:
fallback
- The seal base locator to fallback to when a resource is not found or an unexpected URL protocol is discovered.
-
-
Method Detail
-
findSealBase
public java.net.URL findSealBase(java.lang.ClassLoader classLoader, java.lang.String typeName)
Description copied from interface:PackageDefinitionStrategy.ManifestReading.SealBaseLocator
Locates the URL that should be used for sealing a package.- Specified by:
findSealBase
in interfacePackageDefinitionStrategy.ManifestReading.SealBaseLocator
- Parameters:
classLoader
- The class loader loading the package.typeName
- The name of the type being loaded that triggered the package definition.- Returns:
- The URL that is used for sealing a package or
null
if the package should not be sealed.
-
-