Package net.morimekta.providence.reflect
Class ProgramLoader
- java.lang.Object
-
- net.morimekta.providence.reflect.ProgramLoader
-
public class ProgramLoader extends java.lang.ObjectClass that loads programs and packages them into a contained type structure.
-
-
Constructor Summary
Constructors Constructor Description ProgramLoader()Constructor with lax and default behavior.ProgramLoader(boolean requireFieldId, boolean requireEnumValue, boolean allowLanguageReservedNames)Constructor with specified options.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GlobalRegistrygetGlobalRegistry()ProgramRegistryload(java.io.File file)ProgramRegistryload(java.nio.file.Path file)Load a thrift definition from file including all it's dependencies.
-
-
-
Constructor Detail
-
ProgramLoader
public ProgramLoader()
Constructor with lax and default behavior.
-
ProgramLoader
public ProgramLoader(boolean requireFieldId, boolean requireEnumValue, boolean allowLanguageReservedNames)Constructor with specified options.- Parameters:
requireFieldId- If field IDs are required.requireEnumValue- If enum values are required.allowLanguageReservedNames- If language-reserved names are allowed.
-
-
Method Detail
-
load
public ProgramRegistry load(java.io.File file) throws java.io.IOException
- Throws:
java.io.IOException
-
load
public ProgramRegistry load(java.nio.file.Path 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.
-
getGlobalRegistry
public GlobalRegistry getGlobalRegistry()
- Returns:
- The local registry.
-
-