public final class WarningViaDialogClassNameCRStrategy extends BaseClassNameCRStrategy implements ClassNameCRStrategy
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.| Modifier and Type | Field and Description |
|---|---|
static String |
NAME
Name of this strategy.
|
| Constructor and Description |
|---|
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. |
| Modifier and Type | Method and Description |
|---|---|
SGStateInfo |
dealWithClassNameConflict(SGStateInfo state,
ClassInfo newClassInfo,
JClass conflict)
Handle a class name conflict between newClassInfo and conflict.
|
boolean |
dealWithFileOverwrite(String filename)
Presents the user with a console dialog, asking for confirmation whether an existing file
should be overwritten (or not).
|
protected ConsoleDialog |
getConsoleDialog()
Returns the
ConsoleDialog instance in use. |
String |
getName()
Returns the name of the strategy.
|
void |
setConsoleDialog(ConsoleDialog dialog)
Sets the console dialog to use with this strategy.
|
getSingleClassGenerator, setSingleClassGeneratorclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsetSingleClassGeneratorpublic static final String NAME
public WarningViaDialogClassNameCRStrategy()
ConsoleDialog instance to emit warnings to the user and ask about an approach to deal
with them.public SGStateInfo dealWithClassNameConflict(SGStateInfo state, ClassInfo newClassInfo, JClass conflict)
dealWithClassNameConflict in interface ClassNameCRStrategystate - SourceGeneration statenewClassInfo - ClassInfo for the new classconflict - JClass for the existing class#dealWithClassNameConflict(org.exolab.castor.builder.SGStateInfo,
org.exolab.castor.builder.info.ClassInfo, org.exolab.javasource.JClass)public String getName()
getName in interface ClassNameCRStrategyClassNameCRStrategy.getName()public void setConsoleDialog(ConsoleDialog dialog)
setConsoleDialog in interface ClassNameCRStrategydialog - the console dialog to use with this strategy.setConsoleDialog(org.exolab.castor.util.dialog.ConsoleDialog)public boolean dealWithFileOverwrite(String filename)
dealWithFileOverwrite in interface ClassNameCRStrategyfilename - the filename to potentially overwrite.#dealWithFileOverwrite(java.lang.String, boolean)protected ConsoleDialog getConsoleDialog()
ConsoleDialog instance in use.ConsoleDialog used for output/feedback gathering.Copyright © 2016. All rights reserved.