Class JavaSourceOrClassFileResourceCachingFactoryImpl
java.lang.Object
org.splevo.jamopp.extraction.resource.JavaSourceOrClassFileResourceCachingFactoryImpl
- All Implemented Interfaces:
Resource.Factory
public class JavaSourceOrClassFileResourceCachingFactoryImpl
extends Object
implements Resource.Factory
Factory for creating cache enabled JaMoPP java and class file resource.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.emf.ecore.resource.Resource.Factory
Resource.Factory.Descriptor, Resource.Factory.Registry
-
Constructor Summary
ConstructorDescriptionJavaSourceOrClassFileResourceCachingFactoryImpl
(Resource.Factory factory, List<String> cacheDirectories) Constructor to set the base directory for internal reference cache. -
Method Summary
Modifier and TypeMethodDescriptioncreateResource
(URI uri) Create a cache enabled resource for file scheme URIs.Access the internal cache.
-
Constructor Details
-
JavaSourceOrClassFileResourceCachingFactoryImpl
public JavaSourceOrClassFileResourceCachingFactoryImpl(Resource.Factory factory, List<String> cacheDirectories) Constructor to set the base directory for internal reference cache.- Parameters:
factory
- The resource factory to which the requests are forwarded.cacheDirectories
- The absolute paths of directories containing cache files.
-
-
Method Details
-
createResource
Create a cache enabled resource for file scheme URIs.
Depending on how the URI is created, one must call
Otherwise a regular JaMoPP resource is created.new File("myRelativePath").getCanonicalPath()
before to ensure the URI starts with file://- Specified by:
createResource
in interfaceResource.Factory
-
getReferenceCache
Access the internal cache.- Returns:
- The internally used cache.
-