Class ClassLoaderFiles
java.lang.Object
org.springframework.boot.devtools.restart.classloader.ClassLoaderFiles
- All Implemented Interfaces:
Serializable,ClassLoaderFileRepository
ClassLoaderFileRepository that maintains a collection of
ClassLoaderFile items grouped by source directories.- Since:
- 1.3.0
- Author:
- Phillip Webb
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAn individual source directory that is being managed by the collection. -
Field Summary
Fields inherited from interface org.springframework.boot.devtools.restart.classloader.ClassLoaderFileRepository
NONE -
Constructor Summary
ConstructorsConstructorDescriptionCreate a newClassLoaderFilesinstance.ClassLoaderFiles(ClassLoaderFiles classLoaderFiles) Create a newClassLoaderFilesinstance. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAll(ClassLoaderFiles files) Add all elements items from the specifiedClassLoaderFilesto this instance.voidaddFile(String sourceDirectory, String name, ClassLoaderFile file) Add a singleClassLoaderFileto the collection.voidaddFile(String name, ClassLoaderFile file) Add a singleClassLoaderFileto the collection.Return aClassLoaderFilefor the given name ornullif no file is contained in this collection.protected final ClassLoaderFiles.SourceDirectoryGet or create aClassLoaderFiles.SourceDirectorywith the given name.Return allSourceDirectoriesthat have been added to the collection.intsize()Return the size of the collection.
-
Constructor Details
-
ClassLoaderFiles
public ClassLoaderFiles()Create a newClassLoaderFilesinstance. -
ClassLoaderFiles
Create a newClassLoaderFilesinstance.- Parameters:
classLoaderFiles- the source classloader files.
-
-
Method Details
-
addAll
Add all elements items from the specifiedClassLoaderFilesto this instance.- Parameters:
files- the files to add
-
addFile
Add a singleClassLoaderFileto the collection.- Parameters:
name- the name of the filefile- the file to add
-
addFile
Add a singleClassLoaderFileto the collection.- Parameters:
sourceDirectory- the source directory of the filename- the name of the filefile- the file to add
-
getOrCreateSourceDirectory
Get or create aClassLoaderFiles.SourceDirectorywith the given name.- Parameters:
name- the name of the directory- Returns:
- an existing or newly added
ClassLoaderFiles.SourceDirectory
-
getSourceDirectories
Return allSourceDirectoriesthat have been added to the collection.- Returns:
- a collection of
ClassLoaderFiles.SourceDirectoryitems
-
size
public int size()Return the size of the collection.- Returns:
- the size of the collection
-
getFile
Description copied from interface:ClassLoaderFileRepositoryReturn aClassLoaderFilefor the given name ornullif no file is contained in this collection.- Specified by:
getFilein interfaceClassLoaderFileRepository- Parameters:
name- the name of the file- Returns:
- a
ClassLoaderFileornull
-