public final class InformViaLogClassNameCRStrategy extends BaseClassNameCRStrategy implements ClassNameCRStrategy
ClassNameCRStrategy
that
reports any conflict notifications to a log file, basically
stating what classes have been overwriten as a result of such
a name conflict.Modifier and Type | Field and Description |
---|---|
static String |
NAME
Name of this strategy.
|
Constructor and Description |
---|
InformViaLogClassNameCRStrategy()
Creates an instance of this name conflict resolution strategy, that will
emit warnings to the user as part of a standard logging aproach.
|
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).
|
String |
getName()
Returns the name of the strategy.
|
void |
setConsoleDialog(ConsoleDialog dialog)
Sets the console dialog to use with this strategy.
|
getSingleClassGenerator, setSingleClassGenerator
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setSingleClassGenerator
public static final String NAME
public InformViaLogClassNameCRStrategy()
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 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(String filename)
dealWithFileOverwrite
in interface ClassNameCRStrategy
filename
- the filename to potentially overwrite.#dealWithFileOverwrite(java.lang.String, boolean)
Copyright © 2019. All rights reserved.