public abstract class Extension<E>
extends java.lang.Object
Constructor and Description |
---|
Extension() |
Modifier and Type | Method and Description |
---|---|
protected E |
add(java.lang.Class<? extends TransformationTemplate> templateClass)
Adds a new transformation template class to the set
|
java.util.Optional<java.lang.Class<? extends TransformationTemplate>> |
automaticResolution(java.io.File applicationFolder)
Butterfly might be able to automatically identify the type of application
and which transformation template to be applied to it.
|
abstract java.lang.String |
getDescription()
Returns the extension description
|
protected org.apache.maven.model.Model |
getRootPomFile(java.io.File folder)
This is a convenience method in case the Extension subclass wants to implement its
automaticResolution(File) method based on one or more Maven pom files |
java.util.List<java.lang.Class<? extends TransformationTemplate>> |
getTemplateClasses()
Returns a read-only set containing all transformation template classes
|
abstract java.lang.String |
getVersion()
Returns the extension version
|
java.lang.String |
toString() |
protected final E add(java.lang.Class<? extends TransformationTemplate> templateClass)
templateClass
- the transformation template class to be added to the extensionpublic abstract java.lang.String getDescription()
public abstract java.lang.String getVersion()
public final java.util.List<java.lang.Class<? extends TransformationTemplate>> getTemplateClasses()
public java.util.Optional<java.lang.Class<? extends TransformationTemplate>> automaticResolution(java.io.File applicationFolder) throws TemplateResolutionException
TransformationTemplate
class is returned: if application type is recognized and application is validTemplateResolutionException
exception is thrown: if the application type is recognized as a known and supported type
(based on most of its folders and files structure and content), however, the extension identifies it as invalid for specific reasons,
(for missing a required file for example, having an invalid property version, etc). Call Throwable.getMessage()
for details.
applicationFolder
- the folder where the code of the application to be transformed isTemplateResolutionException
- see aboveprotected org.apache.maven.model.Model getRootPomFile(java.io.File folder) throws java.io.IOException, org.codehaus.plexus.util.xml.pull.XmlPullParserException
automaticResolution(File)
method based on one or more Maven pom filesfolder
- the folder where the pom.xml file would befolder
java.io.IOException
- if pom file does not exist, or any error happens when trying to read itorg.codehaus.plexus.util.xml.pull.XmlPullParserException
- if any error happens when trying to parse the pom filepublic final java.lang.String toString()
toString
in class java.lang.Object