Class AbstractDefinitionModel
- java.lang.Object
-
- com._1c.g5.aef2.validators.Validable
-
- com._1c.g5.aef2.models.Model
-
- com._1c.g5.aef2.standard.definitions.models.AbstractDefinitionModel
-
- All Implemented Interfaces:
ICompoundModel
,IModel
,IDefinitionModel
,IValidable
- Direct Known Subclasses:
DefinitionModel
,DtGranularEditorPageDefinitionModel
public abstract class AbstractDefinitionModel extends Model implements IDefinitionModel
The abstract definition model.
It implements the basic functionality: the sub-models managing and the rule result processing.
It doesn't specify the way of getting the model objects or definition.
-
-
Constructor Summary
Constructors Constructor Description AbstractDefinitionModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addModel(IModel model)
Adds the givenmodel
to the current definition model.void
addRuleResultListener(IRuleResultListener listener)
Adds the rule result listener.void
dispose()
Disposes this model.IChange
getChange()
Iterable<IModel>
getModels()
IRuleResult
getRuleResult()
Returns the rule result.IRuleResultProcessor
getRuleResultProcessor()
Returns aIRuleResultProcessor
instance.protected void
handleRuleResultChanged(IRuleResult oldRuleResult, IRuleResult newRuleResult)
Handle rule result changed.void
removeModel(IModel model)
Removes the givenmodel
from the current definition model.void
removeRuleResultListener(IRuleResultListener listener)
Removes the rule result listener.void
setRuleResult(IRuleResult ruleResult)
Sets the rule result.void
setRuleResultProcessor(IRuleResultProcessor ruleResultProcessor)
Sets the specifiedruleResultProcessor
to the model.String
toString()
-
Methods inherited from class com._1c.g5.aef2.models.Model
addModelListener, beginExternalUpdate, checkOffline, checkOnline, commit, createWorkingCopy, discard, endExternalUpdate, getComponent, getCurrentChangeOrigin, getRunnableQueue, isOnline, notifyModelChanged, notifyModelCommitted, removeModelListener, setComponent, setOnline
-
Methods inherited from class com._1c.g5.aef2.validators.Validable
addValidator, getValidatorTarget, removeValidator, validate, validate
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com._1c.g5.aef2.standard.definitions.models.IDefinitionModel
getDefinition, getObjects
-
Methods inherited from interface com._1c.g5.aef2.models.IModel
addModelListener, commit, createWorkingCopy, discard, getComponent, isOnline, removeModelListener, setComponent
-
Methods inherited from interface com._1c.g5.aef2.validators.IValidable
addValidator, removeValidator, validate, validate
-
-
-
-
Method Detail
-
getChange
public final IChange getChange()
-
getRuleResult
public IRuleResult getRuleResult()
Description copied from interface:IDefinitionModel
Returns the rule result.- Specified by:
getRuleResult
in interfaceIDefinitionModel
- Returns:
- the rule result, never
null
. - See Also:
IRuleResult
-
setRuleResult
public void setRuleResult(IRuleResult ruleResult)
Description copied from interface:IDefinitionModel
Sets the rule result.- Specified by:
setRuleResult
in interfaceIDefinitionModel
- Parameters:
ruleResult
- the rule result, cannot benull
.- See Also:
IRuleResult
-
addRuleResultListener
public void addRuleResultListener(IRuleResultListener listener)
Description copied from interface:IDefinitionModel
Adds the rule result listener.- Specified by:
addRuleResultListener
in interfaceIDefinitionModel
- Parameters:
listener
- the listener to add, cannot benull
.
-
removeRuleResultListener
public void removeRuleResultListener(IRuleResultListener listener)
Description copied from interface:IDefinitionModel
Removes the rule result listener.- Specified by:
removeRuleResultListener
in interfaceIDefinitionModel
- Parameters:
listener
- the listener to remove, cannot benull
.
-
addModel
public void addModel(IModel model)
Description copied from interface:IDefinitionModel
Adds the givenmodel
to the current definition model.- Specified by:
addModel
in interfaceIDefinitionModel
- Parameters:
model
- the model to add, cannot benull
.
-
removeModel
public void removeModel(IModel model)
Description copied from interface:IDefinitionModel
Removes the givenmodel
from the current definition model.- Specified by:
removeModel
in interfaceIDefinitionModel
- Parameters:
model
- the model to remove, cannot benull
.
-
dispose
public void dispose()
Description copied from interface:IModel
Disposes this model.
-
getModels
public Iterable<IModel> getModels()
- Specified by:
getModels
in interfaceICompoundModel
- Returns:
- the models this compound model contains.
-
setRuleResultProcessor
public void setRuleResultProcessor(IRuleResultProcessor ruleResultProcessor)
Description copied from interface:IDefinitionModel
Sets the specifiedruleResultProcessor
to the model.- Specified by:
setRuleResultProcessor
in interfaceIDefinitionModel
- Parameters:
ruleResultProcessor
- theIRuleResultProcessor
instance, cannot benull
.
-
getRuleResultProcessor
public IRuleResultProcessor getRuleResultProcessor()
Description copied from interface:IDefinitionModel
Returns aIRuleResultProcessor
instance.- Specified by:
getRuleResultProcessor
in interfaceIDefinitionModel
- Returns:
IRuleResultProcessor
instance ornull
.
-
handleRuleResultChanged
protected void handleRuleResultChanged(IRuleResult oldRuleResult, IRuleResult newRuleResult)
Handle rule result changed. It notifies theIRuleResultListener
s that are added to the model.- Parameters:
oldRuleResult
- the old rule result, cannot benull
.newRuleResult
- the new rule result, cannot benull
.
-
-