Interface ClassNameCRStrategy
- All Known Implementing Classes:
BaseClassNameCRStrategy,InformViaLogClassNameCRStrategy,WarningViaDialogClassNameCRStrategy
public interface ClassNameCRStrategy
Strategy pattern for dealing with class name conflicts during source code
generation. The various implementations of this stragtegy will implement
individual approaches for dealing with such a naming collision.
- Since:
- 1.1
- Author:
- Werner Guttmann
-
Method Summary
Modifier and TypeMethodDescriptiondealWithClassNameConflict(SGStateInfo state, ClassInfo newClassInfo, JClass conflict) Implements a specific strategy for dealing with class name conflicts.booleandealWithFileOverwrite(String filename) Implements a specific strategy for dealing with the fact that -- for a given file name -- an artifact with the same name already exists.getName()Returns the name of this strategy.voidsetConsoleDialog(ConsoleDialog dialog) Sets theConsoleDialoginstance to use (if required).voidsetSingleClassGenerator(SingleClassGenerator generator) Injects theSingleClassGeneratorinstance that actually is calling a method of this strategy.
-
Method Details
-
dealWithClassNameConflict
Implements a specific strategy for dealing with class name conflicts.- Parameters:
state- The current source generator state.newClassInfo- Thefor the new class to be generated.invalid reference
CLassInfoconflict- TheJClassinstance representing the potential conflict.- Returns:
- the source generator state, as modified by the decision.
-
dealWithFileOverwrite
Implements a specific strategy for dealing with the fact that -- for a given file name -- an artifact with the same name already exists.- Parameters:
filename- The name of the file to be overwritten.- Returns:
- True of the file should be overwritten.
-
getName
-
setConsoleDialog
Sets theConsoleDialoginstance to use (if required).- Parameters:
dialog- theConsoleDialoginstance to use (if required).
-
setSingleClassGenerator
Injects theSingleClassGeneratorinstance that actually is calling a method of this strategy.- Parameters:
generator- The callingSingleClassGenerator- See Also:
-