Class ExtensionProducerSampleTypeManifold

  • All Implemented Interfaces:
    manifold.api.service.IPluginHost, manifold.api.service.IService, manifold.api.type.IFileConnected, manifold.api.type.ISelfCompiled, manifold.api.type.ITypeManifold, manifold.ext.IExtensionClassProducer

    public class ExtensionProducerSampleTypeManifold
    extends manifold.ext.AbstractExtensionProducer<Model>
    A sample implementation to exercise the IExtensionClassProducer interface.

    Handles the contrived ".favs" file extension having the following format:

       (<qualified-type-name> | <favorite-name> | <favorite-value> [new line])*
     
    For example:
       java.lang.String|Food|Cheeseburger
       java.lang.String|Car|Alfieri
       java.util.Map|Food|Pizza
     
    As such this class adds methods favoriteFood() and favoriteCar() to String, and favoriteFood() to Map. The methods return a String value corresponding with Cheeseburger, Alfieri, and Pizza.
    • Nested Class Summary

      • Nested classes/interfaces inherited from class manifold.api.type.ResourceFileTypeManifold

        manifold.api.type.ResourceFileTypeManifold.CacheClearer
    • Field Summary

      • Fields inherited from interface manifold.api.type.ITypeManifold

        ARG_DUMP_SOURCE
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected String contribute​(JavaFileManager.Location location, String topLevelFqn, boolean genStubs, String existing, Model model, DiagnosticListener<JavaFileObject> errorHandler)  
      protected Model createModel​(String extensionFqn, Set<manifold.api.fs.IFile> files)  
      protected String deriveExtendedClassFrom​(String extensionClassFqn)  
      protected Set<String> getExtendedTypes​(manifold.api.fs.IFile file)  
      protected String getFileExt()  
      protected String makeExtensionClassName​(String extendedClassFqn)  
      • Methods inherited from class manifold.ext.AbstractExtensionProducer

        createCacheClearer, findTopLevelFqn, getExtendedTypes, getExtendedTypesForFile, getExtensionClasses, getPeripheralTypes, getTypeNameForFile, getTypesForFile, handlesFileExtension, init, isExtendedType, isInnerType, refreshedFile
      • Methods inherited from class manifold.api.type.JavaTypeManifold

        getClassType, getContributorKind, getSourceKind
      • Methods inherited from class manifold.api.type.ResourceFileTypeManifold

        clear, contribute, findFilesForType, getAdditionalTypes, getAllTypeNames, getContent, getModel, getModule, getPackage, getTypeNames, handlesFile, init, isDuplicate, isFileBacked, isPackage, isTopLevelType, isType
      • Methods inherited from class manifold.api.service.BaseService

        doInit, doUninit, init, isInited, uninit
      • Methods inherited from interface manifold.api.type.IFileConnected

        handlesFile, isFileBacked
      • Methods inherited from interface manifold.api.service.IPluginHost

        getInterface
      • Methods inherited from interface manifold.api.type.ISelfCompiled

        compile, isSelfCompile, parse
      • Methods inherited from interface manifold.api.type.ITypeManifold

        accept, clear, contribute, enterPostJavaCompilation, findFilesForType, getAllTypeNames, getClassType, getContributorKind, getModule, getPackage, getSourceKind, getTypeNames, isPackage, isTopLevelType, isType
    • Constructor Detail

      • ExtensionProducerSampleTypeManifold

        public ExtensionProducerSampleTypeManifold()
    • Method Detail

      • createModel

        protected Model createModel​(String extensionFqn,
                                    Set<manifold.api.fs.IFile> files)
        Specified by:
        createModel in class manifold.ext.AbstractExtensionProducer<Model>
      • getFileExt

        protected String getFileExt()
        Specified by:
        getFileExt in class manifold.ext.AbstractExtensionProducer<Model>
      • getExtendedTypes

        protected Set<String> getExtendedTypes​(manifold.api.fs.IFile file)
        Specified by:
        getExtendedTypes in class manifold.ext.AbstractExtensionProducer<Model>
      • makeExtensionClassName

        protected String makeExtensionClassName​(String extendedClassFqn)
        Specified by:
        makeExtensionClassName in class manifold.ext.AbstractExtensionProducer<Model>
      • deriveExtendedClassFrom

        protected String deriveExtendedClassFrom​(String extensionClassFqn)
        Specified by:
        deriveExtendedClassFrom in class manifold.ext.AbstractExtensionProducer<Model>