Package manifold.ext
Class AbstractExtensionProducer<M extends manifold.api.type.IModel>
- java.lang.Object
-
- manifold.api.service.BaseService
-
- manifold.api.type.ResourceFileTypeManifold<M>
-
- manifold.api.type.JavaTypeManifold<M>
-
- manifold.ext.AbstractExtensionProducer<M>
-
- All Implemented Interfaces:
manifold.api.service.IPluginHost,manifold.api.service.IService,manifold.api.type.IFileConnected,manifold.api.type.ISelfCompiled,manifold.api.type.ITypeManifold,IExtensionClassProducer
public abstract class AbstractExtensionProducer<M extends manifold.api.type.IModel> extends manifold.api.type.JavaTypeManifold<M> implements IExtensionClassProducer
An abstraction for a type manifold that produces Extension Classes to be processed by theExtensionManifold. See ExtensionProducerSampleTypeManifold as a reference implementation.
-
-
Constructor Summary
Constructors Constructor Description AbstractExtensionProducer()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected manifold.api.type.ResourceFileTypeManifold.CacheClearercreateCacheClearer()protected abstract McreateModel(String extensionClassName, Set<manifold.api.fs.IFile> files)protected abstract StringderiveExtendedClassFrom(String extensionClassFqn)StringfindTopLevelFqn(String fqn)Overridden because the file's fqn isn't really a type for this type manifold, only the extension classes derived from the files are types this manifold produces.Set<String>getExtendedTypes()The set of extension classes this type manifold produces.protected abstract Set<String>getExtendedTypes(manifold.api.fs.IFile file)Set<String>getExtendedTypesForFile(manifold.api.fs.IFile file)The set of classes extended via {$code file}.Set<String>getExtensionClasses(String extendedType)The subset of extension classes this type manifold produces that extendfqnprotected abstract StringgetFileExt()protected Map<String,manifold.util.concurrent.LocklessLazyVar<M>>getPeripheralTypes()StringgetTypeNameForFile(String defaultFqn, manifold.api.fs.IFile file)The type name[s] produced from a file from an extension producer are the names of the extension classesString[]getTypesForFile(manifold.api.fs.IFile file)booleanhandlesFileExtension(String fileExtension)voidinit(manifold.api.host.IModule moduleComponent)booleanisExtendedType(String fqn)Does this type manifold produce extension class[es] forfqn?booleanisInnerType(String topLevelFqn, String relativeInner)protected abstract StringmakeExtensionClassName(String extendedClassFqn)manifold.api.host.RefreshKindrefreshedFile(manifold.api.fs.IFile file, String[] types, manifold.api.host.RefreshKind kind)-
Methods inherited from class manifold.api.type.JavaTypeManifold
getClassType, getContributorKind, getSourceKind
-
Methods inherited from class manifold.api.type.ResourceFileTypeManifold
clear, contribute, 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
-
init
public void init(manifold.api.host.IModule moduleComponent)
- Specified by:
initin interfacemanifold.api.type.ITypeManifold- Overrides:
initin classmanifold.api.type.ResourceFileTypeManifold<M extends manifold.api.type.IModel>
-
getFileExt
protected abstract String getFileExt()
- Returns:
- The file extension of the resource files this type manifold processes
-
createModel
protected abstract M createModel(String extensionClassName, Set<manifold.api.fs.IFile> files)
- Returns:
- A new model for the qualified
extensionClassNameusingfiles
-
makeExtensionClassName
protected abstract String makeExtensionClassName(String extendedClassFqn)
- Returns:
- The qualified extension class name corresponding with
extendedClassFqn
-
deriveExtendedClassFrom
protected abstract String deriveExtendedClassFrom(String extensionClassFqn)
- Returns:
- The qualified extended class name derived from
extendedClassFqn
-
getTypeNameForFile
public String getTypeNameForFile(String defaultFqn, manifold.api.fs.IFile file)
The type name[s] produced from a file from an extension producer are the names of the extension classes- Overrides:
getTypeNameForFilein classmanifold.api.type.ResourceFileTypeManifold<M extends manifold.api.type.IModel>
-
findTopLevelFqn
public String findTopLevelFqn(String fqn)
Overridden because the file's fqn isn't really a type for this type manifold, only the extension classes derived from the files are types this manifold produces.- Overrides:
findTopLevelFqnin classmanifold.api.type.ResourceFileTypeManifold<M extends manifold.api.type.IModel>
-
createCacheClearer
protected manifold.api.type.ResourceFileTypeManifold.CacheClearer createCacheClearer()
- Overrides:
createCacheClearerin classmanifold.api.type.ResourceFileTypeManifold<M extends manifold.api.type.IModel>
-
refreshedFile
public manifold.api.host.RefreshKind refreshedFile(manifold.api.fs.IFile file, String[] types, manifold.api.host.RefreshKind kind)- Specified by:
refreshedFilein interfacemanifold.api.type.IFileConnected- Overrides:
refreshedFilein classmanifold.api.type.ResourceFileTypeManifold<M extends manifold.api.type.IModel>
-
handlesFileExtension
public boolean handlesFileExtension(String fileExtension)
- Specified by:
handlesFileExtensionin interfacemanifold.api.type.IFileConnected
-
getPeripheralTypes
protected Map<String,manifold.util.concurrent.LocklessLazyVar<M>> getPeripheralTypes()
- Overrides:
getPeripheralTypesin classmanifold.api.type.ResourceFileTypeManifold<M extends manifold.api.type.IModel>
-
isInnerType
public boolean isInnerType(String topLevelFqn, String relativeInner)
- Specified by:
isInnerTypein classmanifold.api.type.ResourceFileTypeManifold<M extends manifold.api.type.IModel>
-
isExtendedType
public boolean isExtendedType(String fqn)
Description copied from interface:IExtensionClassProducerDoes this type manifold produce extension class[es] forfqn?- Specified by:
isExtendedTypein interfaceIExtensionClassProducer- Parameters:
fqn- The fully qualified name of a type for which this manifold may produce an extension class- Returns:
- True if this manifold produces extension class[es] for
fqn
-
getExtensionClasses
public Set<String> getExtensionClasses(String extendedType)
Description copied from interface:IExtensionClassProducerThe subset of extension classes this type manifold produces that extendfqn- Specified by:
getExtensionClassesin interfaceIExtensionClassProducer- Parameters:
extendedType- The fully qualified name of a potentially extended type- Returns:
- The subset of extension classes this type manifold produces that extend
fqn
-
getExtendedTypes
public Set<String> getExtendedTypes()
Description copied from interface:IExtensionClassProducerThe set of extension classes this type manifold produces.- Specified by:
getExtendedTypesin interfaceIExtensionClassProducer
-
getTypesForFile
public String[] getTypesForFile(manifold.api.fs.IFile file)
- Specified by:
getTypesForFilein interfacemanifold.api.type.IFileConnected- Overrides:
getTypesForFilein classmanifold.api.type.ResourceFileTypeManifold<M extends manifold.api.type.IModel>
-
getExtendedTypesForFile
public Set<String> getExtendedTypesForFile(manifold.api.fs.IFile file)
Description copied from interface:IExtensionClassProducerThe set of classes extended via {$code file}.- Specified by:
getExtendedTypesForFilein interfaceIExtensionClassProducer- Parameters:
file- A resource file associated with this class producer
-
-