org.exolab.castor.builder.conflictresolution
Class WarningViaDialogClassNameCRStrategy
- ClassNameCRStrategy
public final class WarningViaDialogClassNameCRStrategy
An implementation of
ClassNameCRStrategy
that reports any conflict
notifications to a console dialog, asking the user whether to stop code
generation (as the conflict is not acceptable), or whether to proceed by
overwriting an already existing class.
static String | NAME - Name of this strategy.
|
NAME
public static final String NAME
Name of this strategy.
WarningViaDialogClassNameCRStrategy
public WarningViaDialogClassNameCRStrategy()
Creates an instance of this name conflict resolution strategy, that will
use the specified
ConsoleDialog
instance to emit warnings to the
user and ask about an approach to deal with them.
dealWithClassNameConflict
public SGStateInfo dealWithClassNameConflict(SGStateInfo state,
ClassInfo newClassInfo,
JClass conflict)
Handle a class name conflict between newClassInfo and conflict.
- dealWithClassNameConflict in interface ClassNameCRStrategy
state
- SourceGeneration statenewClassInfo
- ClassInfo for the new classconflict
- JClass for the existing class
- the provided source generator state, as modified by the strategy
dealWithFileOverwrite
public boolean dealWithFileOverwrite(String filename)
Presents the user with a console dialog, asking for confirmation whether
an existing file should be overwritten (or not).
- dealWithFileOverwrite in interface ClassNameCRStrategy
filename
- the filename to potentially overwrite.
- whether or not the file should be overwritten.
getName
public String getName()
Returns the name of the strategy.
- getName in interface ClassNameCRStrategy
- the name of the strategy.
setConsoleDialog
public void setConsoleDialog(ConsoleDialog dialog)
Sets the console dialog to use with this strategy.
- setConsoleDialog in interface ClassNameCRStrategy
dialog
- the console dialog to use with this strategy.
setConsoleDialog(org.exolab.castor.util.dialog.ConsoleDialog)
Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com