Class SingleVariantModelBasicFix<OC extends org.eclipse.emf.ecore.EObject>
- java.lang.Object
-
- com.e1c.g5.v8.dt.check.qfix.components.BasicFix<C>
-
- com.e1c.g5.v8.dt.check.qfix.components.SingleVariantBasicFix<BasicModelFixContext>
-
- com.e1c.g5.v8.dt.check.qfix.components.SingleVariantModelBasicFix<OC>
-
- All Implemented Interfaces:
IFix<BasicModelFixContext>,IFixVariant<BasicModelFixContext>
public abstract class SingleVariantModelBasicFix<OC extends org.eclipse.emf.ecore.EObject> extends SingleVariantBasicFix<BasicModelFixContext>
Variant with a single-point user context collection/fix definition
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSingleVariantModelBasicFix.FixConfigurerConfiguration container for theSingleVariantModelBasicFixdescendants allowing them to specify fix parameters via the pure Java API
-
Constructor Summary
Constructors Modifier Constructor Description protectedSingleVariantModelBasicFix()protectedSingleVariantModelBasicFix(Class<OC> objectClass)Constructs an instance of the fix.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidapplyChanges(OC modelObject, org.eclipse.emf.ecore.EStructuralFeature targetFeature, BasicModelFixContext context, IFixSession session)Apply the changes of this fix to the target model data.protected voidconfigureFix(SingleVariantModelBasicFix.FixConfigurer configurer)Configures the fix.FixVariantDescriptordescribeChanges(BasicModelFixContext context, IFixSession session)Gets the quick fix variant descriptorClass<BasicModelFixContext>getRequiredContextType()Gets the required context typeprotected booleanisFixApplicable(BasicModelFixContext context, IFixSession session)Checks if the fix is applicable for the given contextvoidonRegistration(FixDescriptor registrationContext)This method is being called by the fix engine during the initialization phase.Collection<IFixChange>prepareChanges(BasicModelFixContext context, IFixSession session)Prepares the changes to form the fix-
Methods inherited from class com.e1c.g5.v8.dt.check.qfix.components.SingleVariantBasicFix
getVariants
-
Methods inherited from class com.e1c.g5.v8.dt.check.qfix.components.BasicFix
getCheckId
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.e1c.g5.v8.dt.check.qfix.IFix
getCheckId
-
-
-
-
Constructor Detail
-
SingleVariantModelBasicFix
protected SingleVariantModelBasicFix()
-
SingleVariantModelBasicFix
protected SingleVariantModelBasicFix(Class<OC> objectClass)
Constructs an instance of the fix. The provided class used to filter the applications of this fix (only matching model classes are being processed by this fix).- Parameters:
objectClass- The class filter. May not benull
-
-
Method Detail
-
describeChanges
public final FixVariantDescriptor describeChanges(BasicModelFixContext context, IFixSession session)
Description copied from interface:IFixVariantGets the quick fix variant descriptor- Parameters:
context- the context, cannot benullsession- the session, cannot benull- Returns:
- fix variant descriptor, never
null
-
getRequiredContextType
public final Class<BasicModelFixContext> getRequiredContextType()
Description copied from interface:IFixGets the required context type- Returns:
- The type of the context that is required by the fix variant to work. May not be
null
-
onRegistration
public final void onRegistration(FixDescriptor registrationContext)
Description copied from interface:IFixThis method is being called by the fix engine during the initialization phase. The developer may register additional fix entitier, like context factories, fix change processors, preview providers which are specific only to this fix- Parameters:
registrationContext- The descriptor of the fix. A fix developer should use it to register fix specific components. May not benull
-
prepareChanges
public final Collection<IFixChange> prepareChanges(BasicModelFixContext context, IFixSession session)
Description copied from interface:IFixVariantPrepares the changes to form the fix- Parameters:
context- The fix context. May not benull- Returns:
- The collection of prepared fix changes (if applicable). Never
null. May be empty
-
isFixApplicable
protected boolean isFixApplicable(BasicModelFixContext context, IFixSession session)
Description copied from class:SingleVariantBasicFixChecks if the fix is applicable for the given context- Overrides:
isFixApplicablein classSingleVariantBasicFix<BasicModelFixContext>- Parameters:
context- The context to check. May not benullsession- The fix session. May not benull- Returns:
- True if the context is applicable. False otherwise
-
configureFix
protected void configureFix(SingleVariantModelBasicFix.FixConfigurer configurer)
Configures the fix. The developer could provide descreptive/filtering information for the fix here- Parameters:
configurer- The configurer of the fix. May not benull
-
applyChanges
protected abstract void applyChanges(OC modelObject, org.eclipse.emf.ecore.EStructuralFeature targetFeature, BasicModelFixContext context, IFixSession session)
Apply the changes of this fix to the target model data. It's up to a fix developer to decide what the logic is- Parameters:
modelObject- The model object being a target of an original issue. May not benulltargetFeature- The target feature. May benullcontext- The fix context. May not benullsession- The fix session. May not benull
-
-