Module: Muml_Property

Includes:
Mjava_Annotation
Defined in:
lib/ontomde-uml2-java/security.rb,
lib/ontomde-uml2-java/java.rb,
lib/ontomde-uml2-java/java.rb,
lib/ontomde-uml2-java/javadoc.rb,
lib/ontomde-uml2-java/accessorSignature.rb,
lib/ontomde-uml2-java/enumCompatibilityLayer.rb

Overview

Authentification and security model enhancements.

Instance Method Summary collapse

Methods included from Mjava_Annotation

#java_writeAnnotation

Instance Method Details

#java_addEnumStringAttribute!Object

add string as enum compatibility layer string



61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/ontomde-uml2-java/enumCompatibilityLayer.rb', line 61

def java_addEnumStringAttribute!
	return unless uml_type_one.kind_of?(Muml_Enumeration)
	c=umlx_owner_one
	a=self
	#log.debug { "adding attribute for #{self} #{c}" }
	rr=c.umlx_createAndAddProperty(a.rdf_uri+"_asString",a.uml_name_one+"AsString")
	rr.uml_type=c.umlx_dataType_string
	rr.uml_visibility=::Cuml_VisibilityKind::Private

	rr.umlx_stringMappingForEnum=a
	rr.uml_isDerived=RDF_TRUE
	rr.uml_upperValue=a.uml_upperValue
	rr.uml_lowerValue=a.uml_lowerValue
end

returns a javadoc link suitable for @see and @link.



40
41
42
43
44
45
46
47
48
49
50
# File 'lib/ontomde-uml2-java/javadoc.rb', line 40

def java_javadocLink(location=nil)
  o=umlx_owner_one
  if location==o
    #same class
    return "##{java_Name}"
  else
    #different class
    return "#{o.java_qualifiedName}##{java_Name}"
  end

end

#java_writeObject

write java attribute variable (Uses java_writePropertyComment, java_writePropertyModifiers ,java_propertyRoleType,java_NameProperty)

NOTE:

  • getter/setter/… methods are handled by model transformation



995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
# File 'lib/ontomde-uml2-java/java.rb', line 995

def java_write
  if !uml_isDerived?
    java_writePropertyComment
    java_writeAnnotation
    write("  ");
    java_writePropertyModifiers
    write("#{java_propertyAssociationType}")
    write(" #{java_NameProperty}")

    if !java_code.empty?
      write"= #{java_code}"
    elsif(context[:java_generateSetAttributeInitializer])
      if (!umlx_upperValueIsOne?) && uml_qualifier.empty? && java_use_Arrays?
        write("= new ");
        write(uml_type_one.java_qualifiedName)
        write("[1]")
      elsif (!umlx_upperValueIsOne?) && uml_qualifier.empty?
        write("= new ");
        write(java_propertyAssociationConcreteType)
        write("()")
      elsif umlx_upperValueIsOne? && !uml_qualifier.empty?
        write("= new ");
        write(java_propertyAssociationConcreteType)
        write("()")
      elsif !umlx_upperValueIsOne? && !uml_qualifier.empty?
        #write("= new ");
        #write(java_propertyAssociationConcreteType)
        #write("()")
      end
    end
    write(";\n")
  end
end

#java_writeFinalModifierObject



1041
1042
1043
1044
# File 'lib/ontomde-uml2-java/java.rb', line 1041

def java_writeFinalModifier
  return unless java_isFinal?
  write "final "
end

#java_writeGetterCommentObject

Methode vide



984
985
# File 'lib/ontomde-uml2-java/java.rb', line 984

def java_writeGetterComment
end

#java_writePropertyCommentObject

Methode vide



981
982
# File 'lib/ontomde-uml2-java/java.rb', line 981

def java_writePropertyComment
end

#java_writePropertyModifiersObject

write java modifiers if needed (public, static, …) (Uses java_visibilityModifiers, java_writeStaticModifier) example: private static final transient long



1032
1033
1034
1035
1036
1037
1038
1039
# File 'lib/ontomde-uml2-java/java.rb', line 1032

def java_writePropertyModifiers
  uml_visibility.each { |v|
    write(v.java_visibilityModifiers)
  }
  java_writeStaticModifier
  java_writeFinalModifier
  java_writeTransient
end

#java_writeSetterCommentObject

Methode vide



987
988
# File 'lib/ontomde-uml2-java/java.rb', line 987

def java_writeSetterComment
end

#java_writeTransientObject

write java transient modifier if needed.



1047
1048
1049
1050
# File 'lib/ontomde-uml2-java/java.rb', line 1047

def java_writeTransient
  return unless java_isTransient?
  write("transient ")
end

#umlx_isSecured?Boolean

return true if element is marked as secured.

Returns:

  • (Boolean)


6
7
8
# File 'lib/ontomde-uml2-java/security.rb', line 6

def umlx_isSecured?
  return umlx_hasStereotype?("Secured")
end