Package manifold.ext.producer.sample
Class ExtensionProducerSampleTypeManifold
- java.lang.Object
-
- manifold.api.service.BaseService
-
- manifold.api.type.ResourceFileTypeManifold<M>
-
- manifold.api.type.JavaTypeManifold<M>
-
- manifold.ext.AbstractExtensionProducer<Model>
-
- manifold.ext.producer.sample.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.
-
-
Constructor Summary
Constructors Constructor Description ExtensionProducerSampleTypeManifold()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Stringcontribute(JavaFileManager.Location location, String topLevelFqn, boolean genStubs, String existing, Model model, DiagnosticListener<JavaFileObject> errorHandler)protected ModelcreateModel(String extensionFqn, Set<manifold.api.fs.IFile> files)protected StringderiveExtendedClassFrom(String extensionClassFqn)protected Set<String>getExtendedTypes(manifold.api.fs.IFile file)protected StringgetFileExt()protected StringmakeExtensionClassName(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
-
-
-
-
Method Detail
-
createModel
protected Model createModel(String extensionFqn, Set<manifold.api.fs.IFile> files)
- Specified by:
createModelin classmanifold.ext.AbstractExtensionProducer<Model>
-
getFileExt
protected String getFileExt()
- Specified by:
getFileExtin classmanifold.ext.AbstractExtensionProducer<Model>
-
getExtendedTypes
protected Set<String> getExtendedTypes(manifold.api.fs.IFile file)
- Specified by:
getExtendedTypesin classmanifold.ext.AbstractExtensionProducer<Model>
-
makeExtensionClassName
protected String makeExtensionClassName(String extendedClassFqn)
- Specified by:
makeExtensionClassNamein classmanifold.ext.AbstractExtensionProducer<Model>
-
deriveExtendedClassFrom
protected String deriveExtendedClassFrom(String extensionClassFqn)
- Specified by:
deriveExtendedClassFromin classmanifold.ext.AbstractExtensionProducer<Model>
-
contribute
protected String contribute(JavaFileManager.Location location, String topLevelFqn, boolean genStubs, String existing, Model model, DiagnosticListener<JavaFileObject> errorHandler)
- Specified by:
contributein classmanifold.api.type.ResourceFileTypeManifold<Model>
-
-