public class ContainerFileResolver extends AbstractFileResolver
<p>A file resolver strategy for file containers.</p>
| Constructor and Description |
|---|
ContainerFileResolver(com.buschmais.jqassistant.core.scanner.api.ScannerContext scannerContext,
FileContainerDescriptor fileContainerDescriptor) |
| Modifier and Type | Method and Description |
|---|---|
void |
flush()
<p>Flush the caches to the store.
|
<D extends FileDescriptor> |
match(String containedPath,
Class<D> type,
com.buschmais.jqassistant.core.scanner.api.ScannerContext context)
<p>Match an existing descriptor in the store and return it with as the given
type if it exists.
|
void |
put(String path,
FileDescriptor fileDescriptor)
<p>Adds a file to the container.
|
<D extends FileDescriptor> |
require(String requiredPath,
String containedPath,
Class<D> type,
com.buschmais.jqassistant.core.scanner.api.ScannerContext context)
<p>Resolve an existing file descriptor for the given paths.
|
int |
size()
<p>Returns the size of the container.
|
getOrCreateAs, require, toFileDescriptorpublic ContainerFileResolver(com.buschmais.jqassistant.core.scanner.api.ScannerContext scannerContext,
FileContainerDescriptor fileContainerDescriptor)
public <D extends FileDescriptor> D require(String requiredPath, String containedPath, Class<D> type, com.buschmais.jqassistant.core.scanner.api.ScannerContext context)
FileResolver<p>Resolve an existing file descriptor for the given paths. <p> This is usually done by evaluating the given path, e.g. if a path "com/buschmais/Test.class" is given a class file resolver might return an existing class descriptor with the fully qualified name "com.buschmais.Test" which has been created before as a referenced class.</p>
requiredPath - The path of the file to require, e.g. /com/acme/Example.classcontainedPath - The internal path (e.g. within the the same artifact if
applicable), e.g. /WEB-INF/classes/com/acme/Example.classtype - The file descriptor type.context - The scanner context.public <D extends FileDescriptor> D match(String containedPath, Class<D> type, com.buschmais.jqassistant.core.scanner.api.ScannerContext context)
FileResolver<p>Match an existing descriptor in the store and return it with as the given type if it exists. <p> Example: A Java class might exist with a fully qualified name in the database. The implementation of this method should check if the given path can be transformed into a class name (i.e. replacing '/' with '.') that already exists as descriptor (i.e. node) and return it.</p>
D - The expected type.containedPath - The path.type - The expected type.context - The scanner context.public void flush()
<p>Flush the caches to the store.</p>
public void put(String path, FileDescriptor fileDescriptor)
<p>Adds a file to the container.</p>
path - The path of the file.fileDescriptor - The file descriptor.public int size()
<p>Returns the size of the container.</p>
Copyright © 2016–2021 jQAssistant Development Team. All rights reserved.