Class: DatatypeMappingEmailAddress

Inherits:
DatatypeMappingText show all
Includes:
Singleton
Defined in:
lib/ontomde-uml2/UMLdatatypeMapping.rb,
lib/ontomde-uml2/kb/datatypeMapping.rb

Constant Summary collapse

MATCHING_UML_NAME =
["EmailAdress"]

Instance Attribute Summary

Attributes inherited from DatatypeMapping

#maxStringLength

Instance Method Summary collapse

Methods inherited from DatatypeMappingText

#prot_getProtegeType

Methods inherited from DatatypeMapping

#getMapping, #getMappings, #initialize, #prot_getProtegeType

Constructor Details

This class inherits a constructor from DatatypeMapping

Instance Method Details

#appliesTo?(datatype) ⇒ Boolean

Returns:

  • (Boolean)


403
404
405
406
# File 'lib/ontomde-uml2/UMLdatatypeMapping.rb', line 403

def appliesTo?(datatype)
  return true if MATCHING_UML_NAME.include?(datatype.uml_name_one)
  return false
end

#getHelpObject



414
415
416
# File 'lib/ontomde-uml2/UMLdatatypeMapping.rb', line 414

def getHelp
  return "any e-mail address"
end

#getValidationRegexpObject

EMAIL address regexp cf : www.regular-expressions.info/email.html



410
411
412
# File 'lib/ontomde-uml2/UMLdatatypeMapping.rb', line 410

def getValidationRegexp
  return /[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}/
end