# Copyright: Copyright 2009 Topic Maps Lab, University of Leipzig. # License: Apache License, Version 2.0 module Superiseable def superised @superised = true end def method_added(method_name) if @superised superising method_name end @superised = false end def superising method_name @to_superize ||= [] @to_superize << method_name end def superize @to_superize.each do |method_name| self::JavaImplementations[self].each do |c| # puts "Superising #{method_name} in #{self} (#{c})" c.class_eval do define_method(method_name) { |*args| super *args} end end end end # def superising method_name # start = Time.now # # puts self # puts self::JavaImplementations[self] # # todo = self # ## # TODO docu ## if todo == RTM::Scoped ## todo = [Java::OrgTmapiCore::Name, Java::OrgTmapiCore::Occurrence, Java::OrgTmapiCore::Association, Java::OrgTmapiCore::Variant] ## elsif todo == RTM::Reifiable ## todo = [Java::OrgTmapiCore::Association, Java::OrgTmapiCore::Name, Java::OrgTmapiCore::Occurrence, Java::OrgTmapiCore::Role, Java::OrgTmapiCore::TopicMap, Java::OrgTmapiCore::Variant] ## elsif todo == RTM::Construct ## todo = [Java::OrgTmapiCore::Association, Java::OrgTmapiCore::Name, Java::OrgTmapiCore::Occurrence, Java::OrgTmapiCore::Role, Java::OrgTmapiCore::TopicMap, Java::OrgTmapiCore::Variant, Java::OrgTmapiCore::Topic] ## elsif todo == RTM::Typed ## todo = [Java::OrgTmapiCore::Association, Java::OrgTmapiCore::Name, Java::OrgTmapiCore::Occurrence, Java::OrgTmapiCore::Role] ## end # todo = [todo].flatten # # # implFinder = ::ImplementationsForInterface.new # if $CLASSPATH # $CLASSPATH.to_a.each do |entry| # entry.slice!(/^file:/) # implFinder.addPathEntry(entry) # end # end # # todo.each do |i| # IMPLEMENTATIONS[i.java_class] ||= implFinder.classInformationsFor(i.java_class).select {|c| !c.getClassName.include? "$" }.map {|c| eval(c.getClassName) } # IMPLEMENTATIONS[i.java_class].each do |c| # c.class_eval do # define_method(method_name) { |*args| super *args} # end # end # end # #puts "Und so lange hat es gedauert:" + (Time.now - start).to_s # end end