|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.exolab.castor.builder.conflictresolution.BaseClassNameCRStrategy
org.exolab.castor.builder.conflictresolution.WarningViaDialogClassNameCRStrategy
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.
Field Summary | |
---|---|
static java.lang.String |
NAME
Name of this strategy. |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
SGStateInfo |
dealWithClassNameConflict(SGStateInfo state,
ClassInfo newClassInfo,
JClass conflict)
Handle a class name conflict between newClassInfo and conflict. |
boolean |
dealWithFileOverwrite(java.lang.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. |
java.lang.String |
getName()
Returns the name of the strategy. |
void |
setConsoleDialog(ConsoleDialog dialog)
Sets the console dialog to use with this strategy. |
Methods inherited from class org.exolab.castor.builder.conflictresolution.BaseClassNameCRStrategy |
---|
getSingleClassGenerator, setSingleClassGenerator |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.exolab.castor.builder.conflictresolution.ClassNameCRStrategy |
---|
setSingleClassGenerator |
Field Detail |
---|
public static final java.lang.String NAME
Constructor Detail |
---|
public WarningViaDialogClassNameCRStrategy()
ConsoleDialog
instance to emit warnings to the
user and ask about an approach to deal with them.
Method Detail |
---|
public SGStateInfo dealWithClassNameConflict(SGStateInfo state, ClassInfo newClassInfo, JClass conflict)
dealWithClassNameConflict
in interface ClassNameCRStrategy
state
- 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 java.lang.String getName()
getName
in interface ClassNameCRStrategy
ClassNameCRStrategy.getName()
public void setConsoleDialog(ConsoleDialog dialog)
setConsoleDialog
in interface ClassNameCRStrategy
dialog
- the console dialog to use with this strategy.setConsoleDialog(org.exolab.castor.util.dialog.ConsoleDialog)
public boolean dealWithFileOverwrite(java.lang.String filename)
dealWithFileOverwrite
in interface ClassNameCRStrategy
filename
- the filename to potentially overwrite.
#dealWithFileOverwrite(java.lang.String, boolean)
protected ConsoleDialog getConsoleDialog()
ConsoleDialog
instance in use.
ConsoleDialog
used for output/feedback gathering.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |