|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.schmant.support.AbstractArgumentChecker
org.schmant.task.stub.AbstractTask<T>
org.schmant.task.stub.AbstractGeneratorTask<T>
public abstract class AbstractGeneratorTask<T extends GeneratorTaskSpec<T>>
This class may be used as a starting point for generator task implementations.
| Field Summary |
|---|
| Fields inherited from interface org.schmant.task.confable.OverwriteConfigurable |
|---|
DEFAULT_OVERWRITE_STRATEGY |
| Constructor Summary | |
|---|---|
AbstractGeneratorTask()
|
|
| Method Summary | |
|---|---|
void |
copyProperties(T spec)
Override the method inherited from AbstractTask to copy the
target and overwrite strategy properties. |
protected OverwriteStrategy |
getOverwriteStrategy()
|
Object |
getTarget()
Get the target. |
protected boolean |
isTargetMandatory()
Is a target mandatory? This method always returns true. |
T |
setOverwrite(boolean b)
Should things be overwritten? If this is set to true, it is
equivalent to setting the overwrite strategy to
DoOverwriteAndLogWarning. |
T |
setOverwriteStrategy(OverwriteStrategy strat)
Set a strategy for how to react to existing entities in locations where the task wants to write. |
T |
setTarget(Object o)
Set the target. |
protected Collection<String> |
validate(Report r)
Override the method inherited from AbstractTask to give a
validation error if the target property is not set (and
isTargetMandatory() returns true). |
| Methods inherited from class org.schmant.task.stub.AbstractTask |
|---|
cancel, createTask, getDefaultLogFooter, getDefaultLogHeader, getDependencyForTasksScheduledByThisTask, getDependencyObservable, getFailureCause, getLogFooter, getLogHeader, getSatisfiedStateLock, getThis, isCancelled, isDone, isInterrupted, isRunning, isSatisfied, isSuccessful, run, runInternal, setLogFooter, setLogHeader, setReportLevel, setTraceLogging, toString |
| Methods inherited from class org.schmant.support.AbstractArgumentChecker |
|---|
check, check, check, check |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.schmant.task.TaskSpecification |
|---|
createTask |
| Methods inherited from interface org.schmant.task.confable.LoggingConfigurable |
|---|
setLogFooter, setLogHeader, setReportLevel, setTraceLogging |
| Constructor Detail |
|---|
public AbstractGeneratorTask()
| Method Detail |
|---|
public final T setTarget(Object o)
TargetConfigurable
setTarget in interface TargetConfigurable<T extends GeneratorTaskSpec<T>>o - The target.
thispublic final Object getTarget()
TargetConfigured
getTarget in interface TargetConfigurednull if it is not set.public final T setOverwrite(boolean b)
OverwriteConfigurabletrue, it is
equivalent to setting the overwrite strategy to
DoOverwriteAndLogWarning. If this is set to false, it is
equivalent to setting the overwrite strategy to
DontOverwriteAndLogWarning.
setOverwrite in interface OverwriteConfigurable<T extends GeneratorTaskSpec<T>>b - Should things be overwritten?
thispublic final T setOverwriteStrategy(OverwriteStrategy strat)
OverwriteConfigurable
setOverwriteStrategy in interface OverwriteConfigurable<T extends GeneratorTaskSpec<T>>strat - The overwrite strategy.
thisprotected final OverwriteStrategy getOverwriteStrategy()
protected boolean isTargetMandatory()
true.
Subclasses may override this to return false if a target is not
mandatory for them.
true, alwaysprotected Collection<String> validate(Report r)
AbstractTask to give a
validation error if the target property is not set (and
isTargetMandatory() returns true).
Subclasses may override this to add their own validation.
validate in class AbstractTask<T extends GeneratorTaskSpec<T>>r - A report to log warning and debug messages to. Validation errors
should not be logged, though. They are logged later.
public void copyProperties(T spec)
AbstractTask to copy the
target and overwrite strategy properties.
Subclasses must override this to copy their own properties.
copyProperties in interface TaskSpecification<T extends GeneratorTaskSpec<T>>copyProperties in class AbstractTask<T extends GeneratorTaskSpec<T>>spec - The specification to copy properties to.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||