NameException class abstract
Base class for all name-related exceptions.
An Exception is intended to convey information to the user about a failure, so that the error can be addressed programmatically.
A name handling failure is not considered an error that should cause a program
failure. Au contraire, it is expected that a programmer using this utility
would consider validating a name using its own business rules. That is not
this utility's job to guess those rules. So, the predefined ValidationRules
obey some common validation techniques when it comes to sanitizing a person
name. For this reason, the Config.bypass is set to true
by default,
indicating that those predefined rules should be skipped for the sake of the
program.
A programmer may leverage Parsers to indicate business-tailored rules if he or she wants this utility to perform those safety checks behind the scenes.
A name exception intends to provide useful information about what causes the error and let the user take initiative on what happens next to the given name: reconstructing it or skipping it.
- Implemented types
- Implementers
Constructors
- NameException([String message, Object? src])
-
Creates a concrete
NameException
with an optional errormessage
.constfactory - NameException.input({required Object source, String message})
-
Creates a new
InputException
with an optional errormessage
.constfactory - NameException.notAllowed({required Object source, String message, String operation})
-
Creates a new
NotAllowedException
with an optional errormessage
.constfactory - NameException.unknown({required Object source, StackTrace? stackTrace, Object? error, String message})
-
Creates a new
UnknownException
with an optional errormessage
.factory - NameException.validation({required Object source, required String nameType, String message})
-
Creates an error containing the invalid
nameType
and amessage
that briefly describes the problem if provided.constfactory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- message → String
-
The message describing the failure.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- source → dynamic
-
The actual source input which caused the error.
final
- sourceAsString → String
-
The string value from the name source input.
no setter
- type → NameExceptionType
-
The name exception type.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited