Class InformViaLogClassNameCRStrategy
- java.lang.Object
-
- org.exolab.castor.builder.conflictresolution.BaseClassNameCRStrategy
-
- org.exolab.castor.builder.conflictresolution.InformViaLogClassNameCRStrategy
-
- All Implemented Interfaces:
ClassNameCRStrategy
public final class InformViaLogClassNameCRStrategy extends BaseClassNameCRStrategy implements ClassNameCRStrategy
An implementation ofClassNameCRStrategythat reports any conflict notifications to a log file, basically stating what classes have been overwriten as a result of such a name conflict.- Since:
- 1.1
- Author:
- Werner Guttmann
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringNAMEName of this strategy.
-
Constructor Summary
Constructors Constructor 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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SGStateInfodealWithClassNameConflict(SGStateInfo state, ClassInfo newClassInfo, JClass conflict)Handle a class name conflict between newClassInfo and conflict.booleandealWithFileOverwrite(java.lang.String filename)Presents the user with a console dialog, asking for confirmation whether an existing file should be overwritten (or not).java.lang.StringgetName()Returns the name of the strategy.voidsetConsoleDialog(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
-
NAME
public static final java.lang.String NAME
Name of this strategy.- See Also:
- Constant Field Values
-
-
Method Detail
-
dealWithClassNameConflict
public SGStateInfo dealWithClassNameConflict(SGStateInfo state, ClassInfo newClassInfo, JClass conflict)
Handle a class name conflict between newClassInfo and conflict.- Specified by:
dealWithClassNameConflictin interfaceClassNameCRStrategy- Parameters:
state- SourceGeneration statenewClassInfo- ClassInfo for the new classconflict- JClass for the existing class- Returns:
- the provided source generator state, as modified by the strategy
- See Also:
#dealWithClassNameConflict(org.exolab.castor.builder.SGStateInfo, org.exolab.castor.builder.info.ClassInfo, org.exolab.javasource.JClass)
-
getName
public java.lang.String getName()
Returns the name of the strategy.- Specified by:
getNamein interfaceClassNameCRStrategy- Returns:
- the name of the strategy.
- See Also:
ClassNameCRStrategy.getName()
-
setConsoleDialog
public void setConsoleDialog(ConsoleDialog dialog)
Sets the console dialog to use with this strategy.- Specified by:
setConsoleDialogin interfaceClassNameCRStrategy- Parameters:
dialog- the console dialog to use with this strategy.
-
dealWithFileOverwrite
public 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).- Specified by:
dealWithFileOverwritein interfaceClassNameCRStrategy- Parameters:
filename- the filename to potentially overwrite.- Returns:
- whether or not the file should be overwritten.
- See Also:
#dealWithFileOverwrite(java.lang.String, boolean)
-
-