Package net.morimekta.providence.reflect
Class TypeLoader
- java.lang.Object
-
- net.morimekta.providence.reflect.TypeLoader
-
public class TypeLoader extends java.lang.Object
- Since:
- 07.09.15
- Author:
- Stein Eldar Johnsen
-
-
Constructor Summary
Constructors Modifier Constructor Description TypeLoader(java.util.Collection<java.io.File> includes)
Construct a type loader for file types matches with the given parser.TypeLoader(java.util.Collection<java.io.File> includes, ProgramParser parser)
Construct a type loader for file types matches with the given parser.protected
TypeLoader(java.util.Collection<java.io.File> includes, ProgramParser parser, ProgramRegistry registry, ProgramConverter converter)
Constructor with injected functionality.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ProgramRegistry
getProgramRegistry()
ProgramTypeRegistry
load(java.io.File file)
Load a thrift definition from file including all it's dependencies.java.util.Collection<ProgramType>
loadedPrograms()
-
-
-
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.
-
-