Class Plugin.Engine.Source.InMemory

    • Field Detail

      • storage

        private final java.util.Map<java.lang.String,​byte[]> storage
        A mapping of resource names to their binary representation.
    • Constructor Detail

      • InMemory

        public InMemory​(java.util.Map<java.lang.String,​byte[]> storage)
        Creates a new in-memory source.
        Parameters:
        storage - A mapping of resource names to their binary representation.
    • Method Detail

      • ofTypes

        public static Plugin.Engine.Source ofTypes​(java.lang.Class<?>... type)
        Represents a collection of types as a in-memory source.
        Parameters:
        type - The types to represent.
        Returns:
        A source representing the supplied types.
      • ofTypes

        public static Plugin.Engine.Source ofTypes​(java.util.Collection<? extends java.lang.Class<?>> types)
        Represents a collection of types as a in-memory source.
        Parameters:
        types - The types to represent.
        Returns:
        A source representing the supplied types.
      • ofTypes

        public 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.
        Parameters:
        binaryRepresentations - A mapping of type names to their binary representation.
        Returns:
        A source representing the supplied types.
      • getClassFileLocator

        public ClassFileLocator getClassFileLocator()
        Returns a class file locator for the represented source. If the class file locator needs to be closed, it is the responsibility of this origin to close the locator or its underlying resources.
        Specified by:
        getClassFileLocator in interface Plugin.Engine.Source.Origin
        Returns:
        A class file locator for locating class files of this instance..
      • getManifest

        public java.util.jar.Manifest getManifest()
                                           throws java.io.IOException
        Returns the manifest file of the source location or null if no manifest exists.
        Specified by:
        getManifest in interface Plugin.Engine.Source.Origin
        Returns:
        This source's manifest or null.
        Throws:
        java.io.IOException - If an I/O error occurs.
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable