base_evaluator.rb revision 5891cd95214be47d8b6c34e8aeb6c6534b130a81
# - Meta component
# This is the base class of the Node Evaluator It should not be used
# directly but instead be subclassed. This is necessary since we usually
# want to register specific callbacks. See Hets::NodeEvaluator for the
# actual evaluator.
]
# - Meta method
# registers a callback-method for a specific node (with node meaning a
# denominator for an element which occurs in the Hets DGXML output)
# - The (node_type, order) pair is the signature
# of a registration. Multiple callback methods can
# be registered for one signature.
# - to: is the symbol-designator of the method.
end
@registrations ||= {}
end
end
end
# - Meta method
# This is the main method that is being called during the
# parsing process. It decides which actual method will
# be called in order to process the parse step. This may
# be a no-op.
# If there is a registered method which corresponds to
# the signature (node_type, order) this will be called.
# Otherwise it falls back to the default naming schema of
# 'nodetype_order' as method name. This default method
# will only be called if it is defined, thus resulting
# in a no-op as fallback.
if registered?(node_type, order)
end
else
default_method_name = :"#{node_type}_#{order}"
end
raise e
end
if method_name
else
end
end
end
# As concurrency handling is usually performed across
# multiple method calls during the parsing-chain,
# we will need to initialize and finish concurrency
# handling manually. A block-approach is just not
# feasible.
dgnode_stack << ontohub_iri
end
def finish_concurrency_handling
all_dgnodes_parsed = next_dgnode_stack_id == hets_evaluator.dgnode_count
concurrency.mark_as_finished_processing(dgnode_stack.last) if all_dgnodes_parsed
end
def cancel_concurrency_handling_on_error
dgnode_stack.reverse_each do |dgnode|
concurrency.unmark_as_processing_on_error(dgnode)
end
end
end
end