Interface IMetaschemaClassFactory

    • Method Detail

      • newInstance

        @NonNull
        static IMetaschemaClassFactory newInstance​(@NonNull
                                                   ITypeResolver typeResolver)
        Get a new instance of the default class generation factory that uses the provided typeResolver.
        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 provided targetDirectory that represents the provided Module module.
        Parameters:
        module - the Module module to generate the class for
        targetDirectory - 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 provided targetDirectory that represents the provided Module definition's typeInfo.
        Parameters:
        typeInfo - the type information for the class to generate
        targetDirectory - 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 provided targetDirectory that represents a collection of Module modules.
        Parameters:
        javaPackage - the Java package name to use
        xmlNamespace - the default XML namespace for all bound Module information elements in the generated package
        metaschemaProductions - a collection of previously generated Module modules and definition classes
        targetDirectory - the directory to generate the Java class in
        Returns:
        the generated class details
        Throws:
        IOException - if an error occurred while generating the Java class