constructor
Optional
mParameter: {Parameters
Optional
resourceBundle?: ResourceBundlei18n resource bundle class. Specify if you want to change the default required validation error message.
Optional
targetAggregations?: string | string[]The aggregation name of the control to be added for validation. Specify if there are controls that are not validated by default.
Optional
useFocusoutValidation?: booleanFor controls with isRequired="true" and controls targeted by registerValidator and registerRequiredValidator, should the validation function be attached at focus-out time when the validate method is executed?
If true (default): validate once and then validation will work on focus out (focus out with the correct value and the error will disappear, but if you focus out with the incorrect value again, the error will occur).
If false: Once validated, errors will remain until removeErrors is done.
However, if registerValidator, registerRequiredValidator isAttachFocusoutValidationImmediately: true, then the validation function is Attached regardless of the value of useFocusoutValidation.
ResourceBundle key for required validation error messages for input controls.
ResourceBundle key for required validation error messages for select controls.
Returns the public facade of this object.
By default, the public facade is implemented as an instance of sap.ui.base.Interface, exposing
the publicMethods
as defined in the metadata of the class of this object.
See the documentation of the #.extend extend method for an explanation of publicMethods
.
The facade is created on the first call of getInterface
and reused for all later calls.
A facade for this object, with at least the public methods of the class of this.
Type or types to check for
Whether this object is an instance of the given type or of any of the given types
1.56
Checks whether this object is an instance of the named type.
This check is solely based on the type names as declared in the class metadata. It compares the given
vTypeName
with the name of the class of this object, with the names of any base class of that class
and with the names of all interfaces implemented by any of the aforementioned classes.
Instead of a single type name, an array of type names can be given and the method will check if this object is an instance of any of the listed types (logical or).
Should the UI5 class system in future implement additional means of associating classes with type names (e.g. by introducing mixins), then this method might detect matches for those names as well.
Register a required check function in the validator.
The registered function is executed when the validate method is executed.
It is also attached to the target control as a validation function when the focus is out, depending on the setting.
Arbitrary ID to identify fnTest
Function to perform required checks
Controls to be validated
When validate is executed, fnTest is executed after oControlValidateBefore validation. to specify the order in which fnTest is executed
Optional
mParameter: OptionParameterOfRegisterValidatorOptional parameter
Reference to this in order to allow method chaining
Register a required check function in the validator.
The registered function is executed when the validate method is executed.
It is also attached to the target control as a validation function when the focus is out, depending on the setting.
Function to perform required checks
Controls to be validated
When validate is executed, fnTest is executed after oControlValidateBefore validation. to specify the order in which fnTest is executed
Optional
mParameter: OptionParameterOfRegisterValidatorOptional parameter
Reference to this in order to allow method chaining
Register a check function in the validator.
The registered function is executed when the validate method is executed.
It is also attached to the target control as a validation function when the focus is out, depending on the setting.
Arbitrary ID to identify fnTest
Function to perform checks
Verification error messages
Controls to be validated
When validate is executed, fnTest is executed after oControlValidateBefore validation. to specify the order in which fnTest is executed
Optional
mParameter: OptionParameterOfRegisterValidatorOptional parameter
Reference to this in order to allow method chaining
Register a check function in the validator.
The registered function is executed when the validate method is executed.
It is also attached to the target control as a validation function when the focus is out, depending on the setting.
Function to perform checks
Verification error messages
Controls to be validated
When validate is executed, fnTest is executed after oControlValidateBefore validation. to specify the order in which fnTest is executed
Optional
mParameter: OptionParameterOfRegisterValidatorOptional parameter
Reference to this in order to allow method chaining
Detaches the function attached by this class for the argument object or its subordinate controls.
Target control or container containing it
For the argument object or its subordinate controls, the messages added by this class are removed from MessageManager. If, as a result, there are no more messages in the corresponding control, ValueState is also cleared.
Control to be validated or container containing it
Unregister functions registered with registerValidator, registerRequiredValidator.
sValidateFunctionId passed as argument to registerValidator, registerRequiredValidator method
oControlValidateBefore passed as argument to registerValidator, registerRequiredValidator method
Reference to this in order to allow method chaining
Validate the argument object or its subordinate controls.
Control to be validated or container containing it
Optional parameter
true: valid, false: invalid
Static
definename of an (already declared) constructor function
static info used to create the metadata object
qualified name of a base class
array of names of public methods
Optional
FNMetaImpl: Functionconstructor function for the metadata object. If not given, it defaults to sap.ui.base.Metadata.
the created metadata object
(since 1.3.1) - Use the static extend
method of the desired base class (e.g. sap.ui.base.Object.extend)
Creates metadata for a given class and attaches it to the constructor and prototype of that class.
After creation, metadata can be retrieved with getMetadata().
The static info can at least contain the following entries: - baseType: {string} fully qualified name of a base class or empty - publicMethods: {string} an array of method names that will be visible in the interface proxy returned by #getInterface
Static
extendname of the class to be created
Optional
oClassInfo: ClassInfo<T, BaseObject>structured object with information about the class
Optional
FNMetaImpl: Functionconstructor function for the metadata object. If not given, it defaults to sap.ui.base.Metadata.
the created class / constructor function
1.3.1
Creates a subclass of class sap.ui.base.Object with name sClassName
and enriches it with the information
contained in oClassInfo
.
oClassInfo
might contain three kinds of information:
- metadata:
an (optional) object literal with metadata about the class. The information in the object
literal will be wrapped by an instance of sap.ui.base.Metadata Metadata and might contain the
following information
interfaces:
{string[]} (optional) set of names of implemented interfaces (defaults to no interfaces)
- `publicMethods:` {string[]} (optional) list of methods that should be part of the public facade of
the class
- `abstract:` {boolean} (optional) flag that marks the class as abstract (purely informational, defaults
to false)
- `final:` {boolean} (optional) flag that marks the class as final (defaults to false) Subclasses
of sap.ui.base.Object can enrich the set of supported metadata (e.g. see sap.ui.core.Element.extend).
- `constructor:` a function that serves as a constructor function for the new class. If no constructor
function is given, the framework creates a default implementation that delegates all its arguments to
the constructor function of the base class.
any-other-name: any other property in the oClassInfo
is copied into the prototype object
of the newly created class. Callers can thereby add methods or properties to all instances of the class.
But be aware that the given values are shared between all instances of the class. Usually, it doesn't
make sense to use primitive values here other than to declare public constants.
If such a property has a function as its value, and if the property name does not start with an underscore
or with the prefix "on", the property name will be automatically added to the list of public methods
of the class (see property publicMethods
in the metadata
section). If a method's name matches that
pattern, but is not meant to be public, it shouldn't be included in the class info object, but be assigned
to the prototype instead.
The prototype object of the newly created class uses the same prototype as instances of the base class (prototype chaining).
A metadata object is always created, even if there is no metadata
entry in the oClassInfo
object.
A getter for the metadata is always attached to the prototype and to the class (constructor function)
itself.
Last but not least, with the third argument FNMetaImpl
the constructor of a metadata class can be specified.
Instances of that class will be used to represent metadata for the newly created class and for any subclass
created from it. Typically, only frameworks will use this parameter to enrich the metadata for a new
class hierarchy they introduce (e.g. sap.ui.core.Element.extend Element).
Static
isAObject which will be checked whether it is an instance of the given type
Type or types to check for
Whether the given object is an instance of the given type or of any of the given types
Validator class