Parent

Class/Module Index [+]

Quicksearch

AbstractXMLInstantiator::Visitor

Public Class Methods

new(inst, gcSuspendCount) click to toggle source
# File lib/rgen/instantiator/abstract_xml_instantiator.rb, line 7
def initialize(inst, gcSuspendCount)
  @instantiator = inst
  @gcSuspendCount = gcSuspendCount
  @namespaces = {}
end

Public Instance Methods

characters(str) click to toggle source
# File lib/rgen/instantiator/abstract_xml_instantiator.rb, line 25
def characters(str)
  @instantiator.text(str)
end
controlGC() click to toggle source
# File lib/rgen/instantiator/abstract_xml_instantiator.rb, line 29
def controlGC
  return unless @gcSuspendCount > 0
  @gcCounter ||= 0
  @gcCounter += 1
  if @gcCounter == @gcSuspendCount
    @gcCounter = 0
    GC.enable
    ObjectSpace.garbage_collect
    GC.disable 
  end 
end
end_element_namespace(tag, prefix, uri) click to toggle source
# File lib/rgen/instantiator/abstract_xml_instantiator.rb, line 21
def end_element_namespace(tag, prefix, uri)
  @instantiator.end_tag(prefix, tag)
end
start_element_namespace(tag, attributes, prefix, uri, ns) click to toggle source
# File lib/rgen/instantiator/abstract_xml_instantiator.rb, line 13
def start_element_namespace(tag, attributes, prefix, uri, ns)
  controlGC
  ns.each{|n| @namespaces[n[0]] = n[1]}
  attrs = attributes.collect{|a| [a.prefix ? a.prefix+":"+a.localname : a.localname, a.value]}
  @instantiator.start_tag(prefix, tag, @namespaces, Hash[*(attrs.flatten)])
  attrs.each { |pair| @instantiator.set_attribute(pair[0], pair[1]) }
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.