Module: Muml_Interface

Defined in:
lib/ontomde-java/jpa/redefined.rb,
lib/ontomde-java/jpa/jpa.rb,
lib/ontomde-java/java/xsd.rb,
lib/ontomde-java/java/java.rb,
lib/ontomde-java/vmware/vso.rb,
lib/ontomde-java/struts/validation.rb

Overview

This file includes methods redefinitions

Instance Method Summary collapse

Instance Method Details

#java_makeSerializable!Object



1401
1402
1403
1404
1405
# File 'lib/ontomde-java/java/java.rb', line 1401

def java_makeSerializable!
  #java_implements_add("java.io.Serializable");
  s=umlx_getOrCreateClass("java.io.Serializable")
  umlx_createAndAddGeneralization(s)
end

#java_writeImplementsObject

does nothing



1390
1391
# File 'lib/ontomde-java/java/java.rb', line 1390

def java_writeImplements
end

#java_writeMetaClassNameObject

write java interface keyword and interface name

Example:

  • interface Interface1



1397
1398
1399
# File 'lib/ontomde-java/java/java.rb', line 1397

def java_writeMetaClassName
  write("interface #{java_Name}")
end

#jpa_addPersistenceIdAnnnotation!(p) ⇒ Object



538
539
540
# File 'lib/ontomde-java/jpa/jpa.rb', line 538

def jpa_addPersistenceIdAnnnotation!(p)
  #nop
end

#jpa_daoClassObject

returns implementing class dao name (if only one exists) def db_daoClassName jpa_daoClassName end

Raises:

  • (Warning.new)


8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/ontomde-java/jpa/redefined.rb', line 8

def jpa_daoClass
  #log.debug { "Muml_Interface::jpa_daoClassName #{self}" }
  found=nil
  ext_isReferencedBy.each { |i|
    next unless i.kind_of?(Muml_Implementation)
    s=i.uml_supplier_one
    next if s!=self
    c=i.uml_client_one
    raise Warning.new,"Too many jpa_daoClassName found for interface #{self}" unless found.nil? || found==c
    found=c
  }
  raise Warning.new,"No jpa_daoClassName found for interface #{self}" if found.nil?
  return found #.jpa_daoClassName
end

#jpa_hasPersistenceId?Boolean

Returns:

  • (Boolean)


530
531
532
533
534
535
536
537
# File 'lib/ontomde-java/jpa/jpa.rb', line 530

def jpa_hasPersistenceId?
  uml_ownedAttribute.each { |a|
    next unless a.umlx_isComposite?
    next if a.uml_type_one.db_isTransient?
    return true ;
  }
  return false
end

#jpa_isPersistent?Boolean

JPA does not support persistent interface

Returns:

  • (Boolean)


527
528
529
# File 'lib/ontomde-java/jpa/jpa.rb', line 527

def jpa_isPersistent?
  return false
end

#struts_validation_writeField(field) ⇒ Object



113
114
115
# File 'lib/ontomde-java/struts/validation.rb', line 113

def struts_validation_writeField(field)
	write "<!-- TODO -->"
end

#vso_writeObjectMapping(tab2) ⇒ Object



296
297
298
299
300
301
# File 'lib/ontomde-java/vmware/vso.rb', line 296

def vso_writeObjectMapping(tab2)
	vso_writeObject(tab,"") { |tab2|
		vso_writeConstructors(tab2)
		vso_writeMethods(tab2)
	}
end

#xsd_makeSerializable!Object

write java interface keyword and interface name

Example:

  • interface Interface1

def xsd_writeMetaClassName
  write("interface #{xsd_Name}")
end


1375
1376
1377
1378
1379
# File 'lib/ontomde-java/java/xsd.rb', line 1375

def xsd_makeSerializable!
  #xsd_implements_add("java.io.Serializable");
  s=umlx_getOrCreateClass("java.io.Serializable")
  umlx_createAndAddGeneralization(s)
end

#xsd_writeImplementsObject

does nothing



1364
1365
# File 'lib/ontomde-java/java/xsd.rb', line 1364

def xsd_writeImplements
end