# Copyright: Copyright 2009 Topic Maps Lab, University of Leipzig. # License: Apache License, Version 2.0 module Java::OrgTmapiCore::Construct include RTM::Construct extend Superiseable # Returns the TopicMap instance this Construct belongs to. # # :call-seq: # topic_map -> TopicMap # def topic_map getTopicMap end # Returns the parent construct this construct belongs to. # # :call-seq: # parent -> a construct (TopicMap, Topic, Association or Name) # def parent getParent end # Returns true if the construct fulfills all constraints defined in the TMDM def valid? # This is defined in RTM::AR and we test it. I guess from the API perspective, in TMAPI the validness of an object is guaranteed. true end unless self.method_defined?(:valid?) # Returns the item identifiers assigned to the current construct. # # :call-seq: # item_identifiers -> Set of Locators # def item_identifiers getItemIdentifiers end superised # Adds an item identifier to this construct. # Identifier may be a String or Locator. # # :call-seq: # item_identifiers=(identifier) # def add_item_identifier(identifier) # TODO Spec begin if identifier.is_a? Java::OrgTmapiCore::Locator addItemIdentifier(identifier) else addItemIdentifier(topic_map.create_locator(identifier)) end rescue Java::OrgTmapiCore::IdentityConstraintException => ice # TODO add condition to switch off automerge self.mergeIn(self.topic_map.get(identifier)) end end alias :item_identifiers= :add_item_identifier # FIXME ii= is not add! it's set. superised # Removes an item identifer from this construct, # if present. # # Identifier may be a String or Locator. # # :call-seq: # remove_item_identifier(identifier) # def remove_item_identifier(identifier) identifier = topic_map.create_locator(identifier) if identifier.is_a? String removeItemIdentifier(identifier) if identifier.is_a? Java::OrgTmapiCore::Locator end # Returns the identifier of this construct. # This property has no representation in the Topic Maps - Data Model. # The ID can be anything, so long as no other Construct in the # same topic map has the same ID. # # :call_spec: # id -> String # def id getId end end