Class: DatatypeMappingText

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

Constant Summary collapse

MATCHING_UML_NAME =
['string','shorttext','text']

Instance Attribute Summary

Attributes inherited from DatatypeMapping

#maxStringLength

Instance Method Summary collapse

Methods inherited from DatatypeMapping

#getMapping, #getMappings, #getValidationRegexp, #register

Constructor Details

#initializeDatatypeMappingText

default string length



132
133
134
135
# File 'lib/ontomde-uml2/UMLdatatypeMapping.rb', line 132

def initialize 
  super
  @maxStringLength=255 # aligned with mysql default
end

Instance Method Details

#appliesTo?(datatype) ⇒ Boolean

Returns:

  • (Boolean)


140
141
142
143
144
# File 'lib/ontomde-uml2/UMLdatatypeMapping.rb', line 140

def appliesTo?(datatype)
  return true if MATCHING_UML_NAME.include?(datatype.uml_name_one.downcase)
  #return true if MATCHING_JAVA_NAME.include?(datatype.java_qualifiedName)
  return false
end

#getHelpObject



146
147
148
# File 'lib/ontomde-uml2/UMLdatatypeMapping.rb', line 146

def getHelp
  return "any string of any length and any content displayable on one line."
end

#prot_getProtegeTypeObject



8
9
10
# File 'lib/ontomde-uml2/kb/datatypeMapping.rb', line 8

def prot_getProtegeType
  return Muml_PrimitiveType::PROTEGE_STRING_DATATYPE
end