Class AbstractExternalValidationSupport<T extends IComponent<? extends IModel>,EVR>
- java.lang.Object
-
- com._1c.g5.aef2.standard.validation.AbstractExternalValidationSupport<T,EVR>
-
- 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
Constructors Modifier Constructor Description protected
AbstractExternalValidationSupport(T rootComponent)
Creates a new instance.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
dispose()
Disposes the external validation support.protected void
disposeInternal()
Performs the disposition.protected T
getComponent()
Returns the component.protected abstract Iterable<EVR>
getExternalValidationResults(Object validable)
Returns a external validation result.protected abstract String
getMessage(EVR result)
Returns the message of the external validation result object.protected abstract Object
getQuery(EVR result)
Returns the query to component matching by the validation result.protected IScene
getScene()
Returns the scene.protected abstract ExternalValidationStatusSeverity
getSeverity(EVR result)
Returns the severity of the specified validation result.protected Object
getValidable()
Returns the object to perform external validation.void
initialize()
Initializes the external validation supports.
It installs component/scene listeners.protected void
initializeInternal()
Performs the initialization steps.protected boolean
isDisposed()
Returnstrue
if the support is disposed.protected abstract void
onComponentModelChange(IModel model)
Reacts on component model change.
It is a place to make conversion model to validable object.protected void
onExternalValidationRequired()
It is invoked on external validation required.protected void
setValidable(Object validable)
Sets the object to external validation.
-
-
-
Constructor Detail
-
AbstractExternalValidationSupport
protected AbstractExternalValidationSupport(T rootComponent)
Creates a new instance.- Parameters:
rootComponent
- the root component of the scene, cannot benull
.
-
-
Method Detail
-
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
protected abstract Iterable<EVR> getExternalValidationResults(Object validable)
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
protected abstract String getMessage(EVR result)
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
protected abstract ExternalValidationStatusSeverity getSeverity(EVR result)
Returns the severity of the specified validation result.- Parameters:
result
- the result of the validation, cannot benull
.- Returns:
- the severity, never
null
.
-
getQuery
protected abstract Object getQuery(EVR result)
Returns the query to component matching by the validation result.- Parameters:
result
- the result of the validation, cannot benull
.- Returns:
- the query or
null
if there are no matching component.
-
onComponentModelChange
protected abstract void onComponentModelChange(IModel model)
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:
setValidable(Object)
-
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
protected void setValidable(Object validable)
Sets the object to external validation.- Parameters:
validable
- the object to validate, can benull
.
-
getValidable
protected Object getValidable()
Returns the object to perform external validation.- Returns:
- the object to perform external validation, or
null
if there no validable object at the moment.
-
onExternalValidationRequired
protected final void onExternalValidationRequired()
It is invoked on external validation required.
-
isDisposed
protected final boolean isDisposed()
Returnstrue
if the support is disposed.- Returns:
true
if it's disposed.
-
getScene
protected final IScene getScene()
Returns the scene.- Returns:
- the scene or
null
if the support is disposed.
-
getComponent
protected final T getComponent()
Returns the component.- Returns:
- the component, never
null
.
-
-