Class TypeLoader


  • public class TypeLoader
    extends java.lang.Object
    Since:
    07.09.15
    Author:
    Stein Eldar Johnsen
    • Constructor Detail

      • TypeLoader

        public TypeLoader​(java.util.Collection<java.io.File> includes)
        Construct a type loader for file types matches with the given parser.
        Parameters:
        includes - List of files with include path roots. For includes search these in order.
      • TypeLoader

        public TypeLoader​(java.util.Collection<java.io.File> includes,
                          ProgramParser parser)
        Construct a type loader for file types matches with the given parser.
        Parameters:
        includes - List of files with include path roots. For includes search these in order.
        parser - The thrift file parser.
      • TypeLoader

        protected TypeLoader​(java.util.Collection<java.io.File> includes,
                             ProgramParser parser,
                             ProgramRegistry registry,
                             ProgramConverter converter)
        Constructor with injected functionality.
        Parameters:
        includes - List of files with include path roots. For includes search these in order.
        parser - The thrift file parser.
        registry - The type registry.
        converter - The document converter
    • Method Detail

      • loadedPrograms

        public java.util.Collection<ProgramType> loadedPrograms()
        Returns:
        Set of loaded documents.
      • load

        public ProgramTypeRegistry load​(java.io.File file)
                                 throws java.io.IOException
        Load a thrift definition from file including all it's dependencies.
        Parameters:
        file - The file to load.
        Returns:
        The loaded contained document.
        Throws:
        java.io.IOException - If the file could not be read or parsed.
      • getProgramRegistry

        public ProgramRegistry getProgramRegistry()
        Returns:
        The local registry.