public class ValidateEditTransformUtility extends TransformUtility
addAffectedFiles()
methods. These (static) methods can be called
multiple times to add files to the set of affected files maintained by the
rule. The list of files is stored in the context.CODE_OTHER, CODE_PROPERTY, CODE_SOURCE, CODE_TARGET, CODE_TARGET_CONTAINER
Constructor and Description |
---|
ValidateEditTransformUtility(ITransformUtilityDescriptor descriptor)
Constructor
|
Modifier and Type | Method and Description |
---|---|
static void |
addAffectedFile(ITransformContext context,
org.eclipse.core.resources.IFile file)
Add a file to the list of affected files.
|
static void |
addAffectedFiles(ITransformContext context,
java.util.List fileList)
Add the given files to the list of affected files.
|
boolean |
canAccept(ITransformContext context)
Using the context, determine if this transformation element should be executed.
|
void |
doExecute(ITransformContext context)
The specific task that this TransformUtility performs based on the data
contained within the execution context.
|
protected static java.util.HashSet |
getAffectedFiles(ITransformContext context)
Get the list of affected files from the context.
|
protected void |
reportError(org.eclipse.core.runtime.IStatus status,
ITransformContext context)
Process error that occured during file validation.
|
createContext, execute, getWorkUnitsPropertyId, handle, internalExecute, setPropertyInContext, validateContext
getProgressMonitorWorkUnits, getTransformationDescriptor
getAcceptCondition, getDescription, getId, getName, getProgressMonitor, setAcceptCondition, setDescription, setId, setName
public ValidateEditTransformUtility(ITransformUtilityDescriptor descriptor)
descriptor
- the descriptor for this utilitypublic static void addAffectedFile(ITransformContext context, org.eclipse.core.resources.IFile file)
context
- the current context of the transformation executionfile
- A file that will be created or modified by the transform.public static void addAffectedFiles(ITransformContext context, java.util.List fileList)
context
- the current context of the transformation executionfileList
- a list of files (of type IFile)that will be created or modified by the transform.protected static java.util.HashSet getAffectedFiles(ITransformContext context)
context
- the current context of the transformation executionpublic void doExecute(ITransformContext context) throws java.lang.Exception
TransformUtility
doExecute
in class TransformUtility
context
- The execution context.java.lang.Exception
public boolean canAccept(ITransformContext context)
AbstractTransformElement
The default implementation will make use of the condition if one is defined. Subclasses may override this method to provide more specialized acceptance criteria.
canAccept
in class AbstractTransformElement
context
- the current context of the transformation executionprotected void reportError(org.eclipse.core.runtime.IStatus status, ITransformContext context)
status
- - file validation statuscontext
- - the current context of the transformation execution