Interface IMetaschemaClassFactory
-
public interface IMetaschemaClassFactory
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description IGeneratedModuleClassgenerateClass(IModule module, Path targetDirectory)Generate a class in the providedtargetDirectorythat represents the provided Modulemodule.IGeneratedDefinitionClassgenerateClass(IModelDefinitionTypeInfo typeInfo, Path targetDirectory)Generate a class in the providedtargetDirectorythat represents the provided Module definition'stypeInfo.IGeneratedClassgeneratePackageInfoClass(String javaPackage, URI xmlNamespace, Collection<IGeneratedModuleClass> metaschemaProductions, Path targetDirectory)Generate a package-info.java class in the providedtargetDirectorythat represents a collection of Module modules.ITypeResolvergetTypeResolver()Get the type resolver used to generate type information for Metasschema constructs represented as Java classes, fields, and methods.static IMetaschemaClassFactorynewInstance(ITypeResolver typeResolver)Get a new instance of the default class generation factory that uses the providedtypeResolver.
-
-
-
Method Detail
-
newInstance
@NonNull static IMetaschemaClassFactory newInstance(@NonNull ITypeResolver typeResolver)
Get a new instance of the default class generation factory that uses the providedtypeResolver.- Parameters:
typeResolver- the resolver used to generate type information for Metasschema constructs- Returns:
- the new class factory
-
getTypeResolver
@NonNull ITypeResolver getTypeResolver()
Get the type resolver used to generate type information for Metasschema constructs represented as Java classes, fields, and methods.- Returns:
- the type resolver
-
generateClass
@NonNull IGeneratedModuleClass generateClass(@NonNull IModule module, @NonNull Path targetDirectory) throws IOException
Generate a class in the providedtargetDirectorythat represents the provided Modulemodule.- Parameters:
module- the Module module to generate the class fortargetDirectory- the directory to generate the Java class in- Returns:
- information about the generated class
- Throws:
IOException- if an error occurred while generating the Java class
-
generateClass
@NonNull IGeneratedDefinitionClass generateClass(@NonNull IModelDefinitionTypeInfo typeInfo, @NonNull Path targetDirectory) throws IOException
Generate a class in the providedtargetDirectorythat represents the provided Module definition'stypeInfo.- Parameters:
typeInfo- the type information for the class to generatetargetDirectory- the directory to generate the Java class in- Returns:
- the generated class details
- Throws:
IOException- if an error occurred while generating the Java class
-
generatePackageInfoClass
@NonNull IGeneratedClass generatePackageInfoClass(@NonNull String javaPackage, @NonNull URI xmlNamespace, @NonNull Collection<IGeneratedModuleClass> metaschemaProductions, @NonNull Path targetDirectory) throws IOException
Generate a package-info.java class in the providedtargetDirectorythat represents a collection of Module modules.- Parameters:
javaPackage- the Java package name to usexmlNamespace- the default XML namespace for all bound Module information elements in the generated packagemetaschemaProductions- a collection of previously generated Module modules and definition classestargetDirectory- the directory to generate the Java class in- Returns:
- the generated class details
- Throws:
IOException- if an error occurred while generating the Java class
-
-