Class MergeTargetFileStrategy
- java.lang.Object
-
- org.apache.torque.generator.control.existingtargetstrategy.MergeTargetFileStrategy
-
- All Implemented Interfaces:
ExistingTargetStrategy
public class MergeTargetFileStrategy extends Object implements ExistingTargetStrategy
A handler which implements the strategy to replace existing target files.- Version:
- $Id: MergeTargetFileStrategy.java 1840416 2018-09-09 15:10:22Z tv $
-
-
Field Summary
Fields Modifier and Type Field Description static String
STRATEGY_NAME
The strategy name "replace".static String
WORK_SUBDIR
The subdirectory in the work directory where the results of the last generation will be stored.
-
Constructor Summary
Constructors Constructor Description MergeTargetFileStrategy()
-
Method Summary
Modifier and Type Method Description void
afterGeneration(String outputDirKey, String outputPath, String encoding, OutletResult generationResult, UnitConfiguration unitConfiguration)
Processes the results of the generation.boolean
beforeGeneration(String outputDirKey, String outputPath, String encoding, UnitConfiguration unitConfiguration)
Will be called before the generation is started and decides whether the generation process for this file should proceed.String
getStrategyName()
Returns the name of the existing target strategy.
-
-
-
Field Detail
-
STRATEGY_NAME
public static final String STRATEGY_NAME
The strategy name "replace".- See Also:
- Constant Field Values
-
WORK_SUBDIR
public static final String WORK_SUBDIR
The subdirectory in the work directory where the results of the last generation will be stored.- See Also:
- Constant Field Values
-
-
Method Detail
-
beforeGeneration
public boolean beforeGeneration(String outputDirKey, String outputPath, String encoding, UnitConfiguration unitConfiguration)
Will be called before the generation is started and decides whether the generation process for this file should proceed.- Specified by:
beforeGeneration
in interfaceExistingTargetStrategy
- Parameters:
outputDirKey
- the key for the output directory into which the generated file should be written, null for the default output directory.outputPath
- the path to which the output should be written, relative to the output base directory.encoding
- The character encoding of the generated file, or null for the platform default encoding.unitConfiguration
- the configuration of the current configuration unit, not null.- Returns:
- true always.
-
afterGeneration
public void afterGeneration(String outputDirKey, String outputPath, String encoding, OutletResult generationResult, UnitConfiguration unitConfiguration) throws GeneratorException
Processes the results of the generation.- Specified by:
afterGeneration
in interfaceExistingTargetStrategy
- Parameters:
outputDirKey
- the key for the output directory into which the generated file should be written, null for the default output directory.outputPath
- the location to which the output should be written.encoding
- The character encoding of the generated file, or null for the platform default encoding.generationResult
- the result of the generation, not null.unitConfiguration
- the configuration of the current configuration unit, not null.- Throws:
GeneratorException
- on an error.
-
getStrategyName
public String getStrategyName()
Returns the name of the existing target strategy.- Specified by:
getStrategyName
in interfaceExistingTargetStrategy
- Returns:
- "merge"
-
-