Class AbstractExternalValidationSupport<T extends IComponent<? extends IModel>,EVR>
java.lang.Object
com._1c.g5.aef2.standard.validation.AbstractExternalValidationSupport<T,EVR>
- Record Components:
T- the component typeEVR- the external validation result type
- Direct Known Subclasses:
AbstractManagingComponentValidationSupport
public abstract class AbstractExternalValidationSupport<T extends IComponent<? extends IModel>,EVR>
extends Object
Provides the external validation support for components.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractExternalValidationSupport(T rootComponent) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionfinal voiddispose()Disposes the external validation support.protected voidPerforms the disposition.protected final TReturns the component.getExternalValidationResults(Object validable) Returns a external validation result.protected abstract StringgetMessage(EVR result) Returns the message of the external validation result object.protected abstract ObjectReturns the query to component matching by the validation result.protected final IScenegetScene()Returns the scene.protected abstract ExternalValidationStatusSeveritygetSeverity(EVR result) Returns the severity of the specified validation result.protected ObjectReturns the object to perform external validation.final voidInitializes the external validation supports.
It installs component/scene listeners.protected voidPerforms the initialization steps.protected final booleanReturnstrueif the support is disposed.protected abstract voidonComponentModelChange(IModel model) Reacts on component model change.
It is a place to make conversion model to validable object.protected final voidIt is invoked on external validation required.protected voidsetValidable(Object validable) Sets the object to external validation.
-
Constructor Details
-
AbstractExternalValidationSupport
Creates a new instance.- Parameters:
rootComponent- the root component of the scene, cannot benull.
-
-
Method Details
-
initialize
public final void initialize()Initializes the external validation supports.
It installs component/scene listeners. -
dispose
public final void dispose()Disposes the external validation support. -
getExternalValidationResults
Returns a external validation result.- Parameters:
validable- the object to validate, cannot benull.- Returns:
- the iterable with the external validation result, cannot be
null.
-
getMessage
Returns the message of the external validation result object.- Parameters:
result- the result of the validation, cannot benull.- Returns:
- the message, cannot be
null.
-
getSeverity
Returns the severity of the specified validation result.- Parameters:
result- the result of the validation, cannot benull.- Returns:
- the severity, never
null.
-
getQuery
Returns the query to component matching by the validation result.- Parameters:
result- the result of the validation, cannot benull.- Returns:
- the query or
nullif there are no matching component.
-
onComponentModelChange
Reacts on component model change.
It is a place to make conversion model to validable object.- Parameters:
model- the component model, cannot benull.- See Also:
-
initializeInternal
protected void initializeInternal()Performs the initialization steps. By default it does nothing.
It is invoked withininitialize(). -
disposeInternal
protected void disposeInternal()Performs the disposition. By default it does nothing.
It is invoked withindispose(). -
setValidable
Sets the object to external validation.- Parameters:
validable- the object to validate, can benull.
-
getValidable
Returns the object to perform external validation.- Returns:
- the object to perform external validation, or
nullif there no validable object at the moment.
-
onExternalValidationRequired
protected final void onExternalValidationRequired()It is invoked on external validation required. -
isDisposed
protected final boolean isDisposed()Returnstrueif the support is disposed.- Returns:
trueif it's disposed.
-
getScene
Returns the scene.- Returns:
- the scene or
nullif the support is disposed.
-
getComponent
Returns the component.- Returns:
- the component, never
null.
-