@HashCodeAndEqualsPlugin.Enhance public static class Plugin.Engine.Source.InMemory extends java.lang.Object implements Plugin.Engine.Source, Plugin.Engine.Source.Origin
Modifier and Type | Class and Description |
---|---|
protected static class |
Plugin.Engine.Source.InMemory.MapEntryIterator
An iterator that represents map entries as sources.
|
Plugin.Engine.Source.Element, Plugin.Engine.Source.Empty, Plugin.Engine.Source.ForFolder, Plugin.Engine.Source.ForJarFile, Plugin.Engine.Source.InMemory, Plugin.Engine.Source.Origin
Plugin.Engine.Source.Origin.ForJarFile
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.String,byte[]> |
storage
A mapping of resource names to their binary representation.
|
NO_MANIFEST
Constructor and Description |
---|
InMemory(java.util.Map<java.lang.String,byte[]> storage)
Creates a new in-memory source.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
ClassFileLocator |
getClassFileLocator()
Returns a class file locator for the represented source.
|
java.util.jar.Manifest |
getManifest()
Returns the manifest file of the source location or
null if no manifest exists. |
java.util.Iterator<Plugin.Engine.Source.Element> |
iterator() |
static Plugin.Engine.Source |
ofTypes(java.lang.Class<?>... type)
Represents a collection of types as a in-memory source.
|
static Plugin.Engine.Source |
ofTypes(java.util.Collection<? extends java.lang.Class<?>> types)
Represents a collection of types as a in-memory source.
|
static Plugin.Engine.Source |
ofTypes(java.util.Map<TypeDescription,byte[]> binaryRepresentations)
Represents a map of type names to their binary representation as an in-memory source.
|
Plugin.Engine.Source.Origin |
read()
Initiates reading from a source.
|
private final java.util.Map<java.lang.String,byte[]> storage
public InMemory(java.util.Map<java.lang.String,byte[]> storage)
storage
- A mapping of resource names to their binary representation.public static Plugin.Engine.Source ofTypes(java.lang.Class<?>... type)
type
- The types to represent.public static Plugin.Engine.Source ofTypes(java.util.Collection<? extends java.lang.Class<?>> types)
types
- The types to represent.public static Plugin.Engine.Source ofTypes(java.util.Map<TypeDescription,byte[]> binaryRepresentations)
binaryRepresentations
- A mapping of type names to their binary representation.public Plugin.Engine.Source.Origin read()
read
in interface Plugin.Engine.Source
public ClassFileLocator getClassFileLocator()
getClassFileLocator
in interface Plugin.Engine.Source.Origin
public java.util.jar.Manifest getManifest() throws java.io.IOException
null
if no manifest exists.getManifest
in interface Plugin.Engine.Source.Origin
null
.java.io.IOException
- If an I/O error occurs.public java.util.Iterator<Plugin.Engine.Source.Element> iterator()
iterator
in interface java.lang.Iterable<Plugin.Engine.Source.Element>
public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable