Package ch.grengine.source
Class DefaultSourceFactory
java.lang.Object
ch.grengine.source.DefaultSourceFactory
- All Implemented Interfaces:
SourceFactory
Default implementation of the
SourceFactory interface.
Generally used by default within Grengine, unless a different source factory has been explicitly indicated.
If the builder's URL content tracking is set, Source.getLastModified()
will be updated based on the URL content, within the latency period
and only if queried. For this purpose, a hash of the URL content is cached
internally for each URL source.
- Since:
- 1.0
- Author:
- Alain Stalder, Made in Switzerland.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsModifierConstructorDescriptionconstructor from default builder (no URL tracking).protectedconstructor from builder. -
Method Summary
Modifier and TypeMethodDescriptionvoidclears the cache of URL content hashes.gets source from script file.gets source from script text.gets source from script text and desired class name.gets source from script URL.gets the builder.
-
Constructor Details
-
DefaultSourceFactory
constructor from builder.- Parameters:
builder- builder- Since:
- 1.0
-
DefaultSourceFactory
public DefaultSourceFactory()constructor from default builder (no URL tracking).- Since:
- 1.0
-
-
Method Details
-
fromText
Description copied from interface:SourceFactorygets source from script text.- Specified by:
fromTextin interfaceSourceFactory- Parameters:
text- script text- Returns:
- source
-
fromText
Description copied from interface:SourceFactorygets source from script text and desired class name.- Specified by:
fromTextin interfaceSourceFactory- Parameters:
text- script textdesiredClassName- desired class name- Returns:
- source
-
fromFile
Description copied from interface:SourceFactorygets source from script file.- Specified by:
fromFilein interfaceSourceFactory- Parameters:
file- script file- Returns:
- source
-
fromUrl
Description copied from interface:SourceFactorygets source from script URL.- Specified by:
fromUrlin interfaceSourceFactory- Parameters:
url- script URL- Returns:
- source
-
clearCache
public void clearCache()clears the cache of URL content hashes.- Since:
- 1.0
-
getBuilder
gets the builder.- Returns:
- builder
- Since:
- 1.0
-