format.InternationalizedEmailAddress Extends goog.format.EmailAddress
Formats an email address string for display, and allows for extraction of the individual components of the address.

Inheritance

Constructor

goog.format.InternationalizedEmailAddress(opt_addressopt_name)

Parameters

opt_address : string=
The email address.
opt_name : string=
The name associated with the email address.

Instance Methods

Public Protected Private
isValid()
No description.
code »
getAddress() string
Get the email address.
Returns: string  The email address.
code »
getName() string
Get the name associated with the email address.
Returns: string  The name or personal portion of the address.
code »
isValid() boolean
Determines is the current object is a valid email address.
Returns: boolean  Whether the email address is valid.
code »
setAddress(address)
Set the email address.
Arguments:
address : string
The email address.
code »
setName(name)
Set the name associated with the email address.
Arguments:
name : string
The name to associate.
code »
toString() string
Return the address in a standard format: - remove extra spaces. - Surround name with quotes if it contains special characters.
Returns: string  The cleaned address.
code »

Instance Properties

constructor :
No description.
Code »
address :
The email address.
Code »
name_ :
The name or personal string associated with the address.
Code »

Static Methods

goog.format.InternationalizedEmailAddress.isValidAddrSpec(str) boolean
Checks if the provided string is a valid address spec (local@domain.com).
Arguments:
str : string
The email address to check.
Returns: boolean  Whether the provided string is a valid address spec.
code »
goog.format.InternationalizedEmailAddress.isValidAddress(str) boolean
Checks if the provided string is a valid email address. Supports both simple email addresses (address specs) and addresses that contain display names.
Arguments:
str : string
The email address to check.
Returns: boolean  Whether the provided string is a valid address.
code »
goog.format.InternationalizedEmailAddress.isValidDomainPartSpec(str) boolean
Checks if the provided string is a valid domain part (part after the '@') of an EAI email address.
Arguments:
str : string
The domain part to check.
Returns: boolean  Whether the provided string is a valid domain part.
code »
goog.format.InternationalizedEmailAddress.isValidLocalPartSpec(str) boolean
Checks if the provided string is a valid local part (part before the '@') of an EAI email address.
Arguments:
str : string
The local part to check.
Returns: boolean  Whether the provided string is a valid local part.
code »
goog.format.InternationalizedEmailAddress.parse(addr) !goog.format.EmailAddress
Parses an email address of the form "name" <address> into an email address.
Arguments:
addr : string
The address string.
Returns: !goog.format.EmailAddress  The parsed address.
code »
goog.format.InternationalizedEmailAddress.parseList(str) !Array.<!goog.format.EmailAddress>
Parses a string containing email addresses of the form "name" <address> into an array of email addresses.
Arguments:
str : string
The address list.
Returns: !Array.<!goog.format.EmailAddress>  The parsed emails.
code »

Static Properties

goog.format.InternationalizedEmailAddress.EAI_DOMAIN_PART_ :
A RegExp to match the domain part of an EAI email address.
Code »
goog.format.InternationalizedEmailAddress.EAI_DOMAIN_PART_REGEXP_STR_ :
A string representing the RegExp for the domain part of an EAI email address.
Code »
goog.format.InternationalizedEmailAddress.EAI_EMAIL_ADDRESS_ :
A RegExp to match an EAI email address.
Code »
goog.format.InternationalizedEmailAddress.EAI_LOCAL_PART_ :
A RegExp to match the local part of an EAI email address.
Code »
goog.format.InternationalizedEmailAddress.EAI_LOCAL_PART_REGEXP_STR_ :
A string representing the RegExp for the local part of an EAI email address.
Code »
goog.format.InternationalizedEmailAddress.superClass_ :
No description.
Code »

Package format

Package Reference