Class SourceFileFactory

java.lang.Object
org.wurbelizer.wurbel.SourceFileFactory

public final class SourceFileFactory extends Object
A factory and cache for sourcefiles.
The sourcefiles are kept in the current wurbel context.
Author:
harald
  • Method Details

    • open

      public static SourceFile open(String filename) throws WurbelException
      Opens the file and loads it into memory.
      If the file already has been loaded, it will be reused.
      Parameters:
      filename - the filename
      Returns:
      the open file
      Throws:
      WurbelException - if reading the file did fail
    • initialize

      public static void initialize()
      Discards all cached files, if any.
    • resetAll

      public static void resetAll()
      Rewinds all output streams (makes them empty again).
    • flushAll

      public static int flushAll() throws WurbelException
      Flushes all files and clears the cache.
      Returns:
      the number of updated files
      Throws:
      WurbelException - if closing a file failed