test_class.declarator: topicmap
test_class.modifier: private
test_class.original_string: private TopicMapIF topicmap;
test_class.type: TopicMapIF
test_class.var_name: topicmap
test_class.declarator: testdataDirectory = "cxtm"
test_class.modifier: private final static
test_class.original_string: private final static String testdataDirectory = "cxtm";
test_class.type: String
test_class.var_name: testdataDirectory
test_class.file: ontopia-engine/src/test/java/net/ontopia/topicmaps/xml/CanonicalXTMWriterTest.java
test_class.identifier: CanonicalXTMWriterTest
test_class.superclass: extends AbstractXMLTestCase
test_case.body: @Test
    public void testWriter() throws IOException {
      String baseline = TestFileUtils.getTestInputFile(testdataDirectory, "baseline", "writer.cxtm");
      File out = TestFileUtils.getTestOutputFile(testdataDirectory, "out", "writer.cxtm");
  
      Writer outw = new OutputStreamWriter(new FileOutputStream(out), "utf-8");
      new CanonicalXTMWriter(outw).write(topicmap);
      outw.close();
  
      Assert.assertTrue("OutputStream export gives incorrect output",
                 TestFileUtils.compareFileToResource(out, baseline));
    }
test_case.class_method_signature: CanonicalXTMWriterTest.testWriter()
test_case.full_signature: @Test public void testWriter()
test_case.identifier: testWriter
test_case.invocations: getTestInputFile getTestOutputFile write close assertTrue compareFileToResource
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testWriter()
focal_class.declarator: EL_SUBJECTLOCATORS = "subjectLocators"
focal_class.modifier: private static final
focal_class.original_string: private static final String EL_SUBJECTLOCATORS = "subjectLocators";
focal_class.type: String
focal_class.var_name: EL_SUBJECTLOCATORS
focal_class.declarator: EL_SUBJECTIDENTIFIERS = "subjectIdentifiers"
focal_class.modifier: private static final
focal_class.original_string: private static final String EL_SUBJECTIDENTIFIERS = "subjectIdentifiers";
focal_class.type: String
focal_class.var_name: EL_SUBJECTIDENTIFIERS
focal_class.declarator: EL_ITEMIDENTIFIERS = "itemIdentifiers"
focal_class.modifier: private static final
focal_class.original_string: private static final String EL_ITEMIDENTIFIERS = "itemIdentifiers";
focal_class.type: String
focal_class.var_name: EL_ITEMIDENTIFIERS
focal_class.declarator: EL_SCOPE = "scope"
focal_class.modifier: private static final
focal_class.original_string: private static final String EL_SCOPE = "scope";
focal_class.type: String
focal_class.var_name: EL_SCOPE
focal_class.declarator: EL_ROLE = "role"
focal_class.modifier: private static final
focal_class.original_string: private static final String EL_ROLE = "role";
focal_class.type: String
focal_class.var_name: EL_ROLE
focal_class.declarator: EL_ASSOCIATION = "association"
focal_class.modifier: private static final
focal_class.original_string: private static final String EL_ASSOCIATION = "association";
focal_class.type: String
focal_class.var_name: EL_ASSOCIATION
focal_class.declarator: EL_OCCURRENCE = "occurrence"
focal_class.modifier: private static final
focal_class.original_string: private static final String EL_OCCURRENCE = "occurrence";
focal_class.type: String
focal_class.var_name: EL_OCCURRENCE
focal_class.declarator: EL_VARIANT = "variant"
focal_class.modifier: private static final
focal_class.original_string: private static final String EL_VARIANT = "variant";
focal_class.type: String
focal_class.var_name: EL_VARIANT
focal_class.declarator: EL_NAME = "name"
focal_class.modifier: private static final
focal_class.original_string: private static final String EL_NAME = "name";
focal_class.type: String
focal_class.var_name: EL_NAME
focal_class.declarator: EL_TOPIC = "topic"
focal_class.modifier: private static final
focal_class.original_string: private static final String EL_TOPIC = "topic";
focal_class.type: String
focal_class.var_name: EL_TOPIC
focal_class.declarator: EL_TOPICMAP = "topicMap"
focal_class.modifier: private static final
focal_class.original_string: private static final String EL_TOPICMAP = "topicMap";
focal_class.type: String
focal_class.var_name: EL_TOPICMAP
focal_class.declarator: AT_NUMBER = "number"
focal_class.modifier: private static final
focal_class.original_string: private static final String AT_NUMBER = "number";
focal_class.type: String
focal_class.var_name: AT_NUMBER
focal_class.declarator: out
focal_class.modifier: private
focal_class.original_string: private CanonicalPrinter out;
focal_class.type: CanonicalPrinter
focal_class.var_name: out
focal_class.declarator: EMPTY
focal_class.modifier: private
focal_class.original_string: private AttributesImpl EMPTY;
focal_class.type: AttributesImpl
focal_class.var_name: EMPTY
focal_class.declarator: tmIndex
focal_class.modifier: private
focal_class.original_string: private Map tmIndex;
focal_class.type: Map
focal_class.var_name: tmIndex
focal_class.declarator: extraRoles
focal_class.modifier: private
focal_class.original_string: private Map extraRoles;
focal_class.type: Map
focal_class.var_name: extraRoles
focal_class.declarator: base
focal_class.modifier: private
focal_class.original_string: private String base;
focal_class.type: String
focal_class.var_name: base
focal_class.declarator: strippedBase
focal_class.modifier: private
focal_class.original_string: private String strippedBase;
focal_class.type: String
focal_class.var_name: strippedBase
focal_class.declarator: typeInstance
focal_class.modifier: private
focal_class.original_string: private TopicIF typeInstance;
focal_class.type: TopicIF
focal_class.var_name: typeInstance
focal_class.declarator: instance
focal_class.modifier: private
focal_class.original_string: private TopicIF instance;
focal_class.type: TopicIF
focal_class.var_name: instance
focal_class.declarator: type
focal_class.modifier: private
focal_class.original_string: private TopicIF type;
focal_class.type: TopicIF
focal_class.var_name: type
focal_class.declarator: tmForFake
focal_class.modifier: private static
focal_class.original_string: private static TopicMapIF tmForFake;
focal_class.type: TopicMapIF
focal_class.var_name: tmForFake
focal_class.declarator: associationComparator = 
            new AssociationComparator()
focal_class.modifier: private final
focal_class.original_string: private final AssociationComparator associationComparator = 
            new AssociationComparator();
focal_class.type: AssociationComparator
focal_class.var_name: associationComparator
focal_class.declarator: associationRoleComparator = 
            new AssociationRoleComparator()
focal_class.modifier: private final
focal_class.original_string: private final AssociationRoleComparator associationRoleComparator = 
            new AssociationRoleComparator();
focal_class.type: AssociationRoleComparator
focal_class.var_name: associationRoleComparator
focal_class.declarator: nameComparator = 
            new NameComparator()
focal_class.modifier: private final
focal_class.original_string: private final NameComparator nameComparator = 
            new NameComparator();
focal_class.type: NameComparator
focal_class.var_name: nameComparator
focal_class.declarator: occurrenceComparator = 
            new OccurrenceComparator()
focal_class.modifier: private final
focal_class.original_string: private final OccurrenceComparator occurrenceComparator = 
            new OccurrenceComparator();
focal_class.type: OccurrenceComparator
focal_class.var_name: occurrenceComparator
focal_class.declarator: locatorComparator = 
            new LocatorComparator()
focal_class.modifier: private final
focal_class.original_string: private final LocatorComparator locatorComparator = 
            new LocatorComparator();
focal_class.type: LocatorComparator
focal_class.var_name: locatorComparator
focal_class.declarator: topicComparator = new TopicComparator()
focal_class.modifier: private final
focal_class.original_string: private final TopicComparator topicComparator = new TopicComparator();
focal_class.type: TopicComparator
focal_class.var_name: topicComparator
focal_class.declarator: variantComparator = 
            new VariantComparator()
focal_class.modifier: private final
focal_class.original_string: private final VariantComparator variantComparator = 
            new VariantComparator();
focal_class.type: VariantComparator
focal_class.var_name: variantComparator
focal_class.declarator: indexComparator
focal_class.modifier: private
focal_class.original_string: private Comparator indexComparator;
focal_class.type: Comparator
focal_class.var_name: indexComparator
focal_class.declarator: startNewlineElem
focal_class.modifier: private
focal_class.original_string: private Set startNewlineElem;
focal_class.type: Set
focal_class.var_name: startNewlineElem
focal_class.declarator: LINEBREAK = { (char) 0x0A }
focal_class.modifier: private static final
focal_class.original_string: private static final char[] LINEBREAK = { (char) 0x0A };
focal_class.type: char[]
focal_class.var_name: LINEBREAK
focal_class.file: ontopia-engine/src/main/java/net/ontopia/topicmaps/xml/CanonicalXTMWriter.java
focal_class.identifier: CanonicalXTMWriter
focal_class.interfaces: implements TopicMapWriterIF
focal_class.class_method_signature: CanonicalXTMWriter.CanonicalXTMWriter(File file)
focal_class.full_signature: public  CanonicalXTMWriter(File file)
focal_class.identifier: CanonicalXTMWriter
focal_class.modifiers: public
focal_class.parameters: (File file)
focal_class.signature:  CanonicalXTMWriter(File file)
focal_class.class_method_signature: CanonicalXTMWriter.CanonicalXTMWriter(OutputStream out)
focal_class.full_signature: public  CanonicalXTMWriter(OutputStream out)
focal_class.identifier: CanonicalXTMWriter
focal_class.modifiers: public
focal_class.parameters: (OutputStream out)
focal_class.signature:  CanonicalXTMWriter(OutputStream out)
focal_class.class_method_signature: CanonicalXTMWriter.CanonicalXTMWriter(Writer out)
focal_class.full_signature: public  CanonicalXTMWriter(Writer out)
focal_class.identifier: CanonicalXTMWriter
focal_class.modifiers: public
focal_class.parameters: (Writer out)
focal_class.signature:  CanonicalXTMWriter(Writer out)
focal_class.class_method_signature: CanonicalXTMWriter.init()
focal_class.full_signature: private void init()
focal_class.identifier: init
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void init()
focal_class.class_method_signature: CanonicalXTMWriter.write(TopicMapIF topicmap)
focal_class.full_signature: @Override public void write(TopicMapIF topicmap)
focal_class.identifier: write
focal_class.modifiers: @Override public
focal_class.parameters: (TopicMapIF topicmap)
focal_class.return: void
focal_class.signature: void write(TopicMapIF topicmap)
focal_class.class_method_signature: CanonicalXTMWriter.recordIndexes(Object[] topics, Object[] associations)
focal_class.full_signature: private void recordIndexes(Object[] topics, Object[] associations)
focal_class.identifier: recordIndexes
focal_class.modifiers: private
focal_class.parameters: (Object[] topics, Object[] associations)
focal_class.return: void
focal_class.signature: void recordIndexes(Object[] topics, Object[] associations)
focal_class.class_method_signature: CanonicalXTMWriter.write(TopicIF topic)
focal_class.full_signature: private void write(TopicIF topic)
focal_class.identifier: write
focal_class.modifiers: private
focal_class.parameters: (TopicIF topic)
focal_class.return: void
focal_class.signature: void write(TopicIF topic)
focal_class.class_method_signature: CanonicalXTMWriter.write(TopicNameIF basename, int number)
focal_class.full_signature: private void write(TopicNameIF basename, int number)
focal_class.identifier: write
focal_class.modifiers: private
focal_class.parameters: (TopicNameIF basename, int number)
focal_class.return: void
focal_class.signature: void write(TopicNameIF basename, int number)
focal_class.class_method_signature: CanonicalXTMWriter.write(VariantNameIF variant, int number)
focal_class.full_signature: private void write(VariantNameIF variant, int number)
focal_class.identifier: write
focal_class.modifiers: private
focal_class.parameters: (VariantNameIF variant, int number)
focal_class.return: void
focal_class.signature: void write(VariantNameIF variant, int number)
focal_class.class_method_signature: CanonicalXTMWriter.makeFakes(Object[] occs)
focal_class.full_signature: private Object[] makeFakes(Object[] occs)
focal_class.identifier: makeFakes
focal_class.modifiers: private
focal_class.parameters: (Object[] occs)
focal_class.return: Object[]
focal_class.signature: Object[] makeFakes(Object[] occs)
focal_class.class_method_signature: CanonicalXTMWriter.write(OccurrenceIF occurrence, int number)
focal_class.full_signature: private void write(OccurrenceIF occurrence, int number)
focal_class.identifier: write
focal_class.modifiers: private
focal_class.parameters: (OccurrenceIF occurrence, int number)
focal_class.return: void
focal_class.signature: void write(OccurrenceIF occurrence, int number)
focal_class.class_method_signature: CanonicalXTMWriter.write(AssociationIF association, int number)
focal_class.full_signature: private void write(AssociationIF association, int number)
focal_class.identifier: write
focal_class.modifiers: private
focal_class.parameters: (AssociationIF association, int number)
focal_class.return: void
focal_class.signature: void write(AssociationIF association, int number)
focal_class.class_method_signature: CanonicalXTMWriter.write(AssociationRoleIF role, int number)
focal_class.full_signature: private void write(AssociationRoleIF role, int number)
focal_class.identifier: write
focal_class.modifiers: private
focal_class.parameters: (AssociationRoleIF role, int number)
focal_class.return: void
focal_class.signature: void write(AssociationRoleIF role, int number)
focal_class.class_method_signature: CanonicalXTMWriter.write(Collection scope)
focal_class.full_signature: private void write(Collection scope)
focal_class.identifier: write
focal_class.modifiers: private
focal_class.parameters: (Collection scope)
focal_class.return: void
focal_class.signature: void write(Collection scope)
focal_class.class_method_signature: CanonicalXTMWriter.writeType(TypedIF object)
focal_class.full_signature: private void writeType(TypedIF object)
focal_class.identifier: writeType
focal_class.modifiers: private
focal_class.parameters: (TypedIF object)
focal_class.return: void
focal_class.signature: void writeType(TypedIF object)
focal_class.class_method_signature: CanonicalXTMWriter.write(String value)
focal_class.full_signature: private void write(String value)
focal_class.identifier: write
focal_class.modifiers: private
focal_class.parameters: (String value)
focal_class.return: void
focal_class.signature: void write(String value)
focal_class.class_method_signature: CanonicalXTMWriter.write(LocatorIF uri, String element)
focal_class.full_signature: private void write(LocatorIF uri, String element)
focal_class.identifier: write
focal_class.modifiers: private
focal_class.parameters: (LocatorIF uri, String element)
focal_class.return: void
focal_class.signature: void write(LocatorIF uri, String element)
focal_class.class_method_signature: CanonicalXTMWriter.write(LocatorIF locator)
focal_class.full_signature: private void write(LocatorIF locator)
focal_class.identifier: write
focal_class.modifiers: private
focal_class.parameters: (LocatorIF locator)
focal_class.return: void
focal_class.signature: void write(LocatorIF locator)
focal_class.class_method_signature: CanonicalXTMWriter.writeLocators(Collection locators, String elementName)
focal_class.full_signature: private void writeLocators(Collection locators, String elementName)
focal_class.identifier: writeLocators
focal_class.modifiers: private
focal_class.parameters: (Collection locators, String elementName)
focal_class.return: void
focal_class.signature: void writeLocators(Collection locators, String elementName)
focal_class.class_method_signature: CanonicalXTMWriter.startElement(String element, Attributes atts)
focal_class.full_signature: private void startElement(String element, Attributes atts)
focal_class.identifier: startElement
focal_class.modifiers: private
focal_class.parameters: (String element, Attributes atts)
focal_class.return: void
focal_class.signature: void startElement(String element, Attributes atts)
focal_class.class_method_signature: CanonicalXTMWriter.endElement(String element)
focal_class.full_signature: private void endElement(String element)
focal_class.identifier: endElement
focal_class.modifiers: private
focal_class.parameters: (String element)
focal_class.return: void
focal_class.signature: void endElement(String element)
focal_class.class_method_signature: CanonicalXTMWriter.writeln()
focal_class.full_signature: private void writeln()
focal_class.identifier: writeln
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void writeln()
focal_class.class_method_signature: CanonicalXTMWriter.reifier(ReifiableIF reified)
focal_class.full_signature: private AttributesImpl reifier(ReifiableIF reified)
focal_class.identifier: reifier
focal_class.modifiers: private
focal_class.parameters: (ReifiableIF reified)
focal_class.return: AttributesImpl
focal_class.signature: AttributesImpl reifier(ReifiableIF reified)
focal_class.class_method_signature: CanonicalXTMWriter.topicRef(TopicIF topic)
focal_class.full_signature: private Attributes topicRef(TopicIF topic)
focal_class.identifier: topicRef
focal_class.modifiers: private
focal_class.parameters: (TopicIF topic)
focal_class.return: Attributes
focal_class.signature: Attributes topicRef(TopicIF topic)
focal_class.class_method_signature: CanonicalXTMWriter.getTopics(TopicMapIF topicmap)
focal_class.full_signature: private Object[] getTopics(TopicMapIF topicmap)
focal_class.identifier: getTopics
focal_class.modifiers: private
focal_class.parameters: (TopicMapIF topicmap)
focal_class.return: Object[]
focal_class.signature: Object[] getTopics(TopicMapIF topicmap)
focal_class.class_method_signature: CanonicalXTMWriter.getAssociations(TopicMapIF topicmap)
focal_class.full_signature: private Object[] getAssociations(TopicMapIF topicmap)
focal_class.identifier: getAssociations
focal_class.modifiers: private
focal_class.parameters: (TopicMapIF topicmap)
focal_class.return: Object[]
focal_class.signature: Object[] getAssociations(TopicMapIF topicmap)
focal_class.class_method_signature: CanonicalXTMWriter.recordRole(TopicIF topic, Collection roles)
focal_class.full_signature: private void recordRole(TopicIF topic, Collection roles)
focal_class.identifier: recordRole
focal_class.modifiers: private
focal_class.parameters: (TopicIF topic, Collection roles)
focal_class.return: void
focal_class.signature: void recordRole(TopicIF topic, Collection roles)
focal_class.class_method_signature: CanonicalXTMWriter.getTopic(TopicMapIF tm, LocatorIF indicator, 
                             Collection topics)
focal_class.full_signature: private TopicIF getTopic(TopicMapIF tm, LocatorIF indicator, 
                             Collection topics)
focal_class.identifier: getTopic
focal_class.modifiers: private
focal_class.parameters: (TopicMapIF tm, LocatorIF indicator, 
                             Collection topics)
focal_class.return: TopicIF
focal_class.signature: TopicIF getTopic(TopicMapIF tm, LocatorIF indicator, 
                             Collection topics)
focal_class.class_method_signature: CanonicalXTMWriter.normalizeNumber(String number)
focal_class.full_signature: private String normalizeNumber(String number)
focal_class.identifier: normalizeNumber
focal_class.modifiers: private
focal_class.parameters: (String number)
focal_class.return: String
focal_class.signature: String normalizeNumber(String number)
focal_class.class_method_signature: CanonicalXTMWriter.normalizeInteger(final String value)
focal_class.full_signature: private static String normalizeInteger(final String value)
focal_class.identifier: normalizeInteger
focal_class.modifiers: private static
focal_class.parameters: (final String value)
focal_class.return: String
focal_class.signature: String normalizeInteger(final String value)
focal_class.class_method_signature: CanonicalXTMWriter.normalizeDecimal(final String value)
focal_class.full_signature: private static String normalizeDecimal(final String value)
focal_class.identifier: normalizeDecimal
focal_class.modifiers: private static
focal_class.parameters: (final String value)
focal_class.return: String
focal_class.signature: String normalizeDecimal(final String value)
focal_class.class_method_signature: CanonicalXTMWriter.normaliseLocatorReference(String reference)
focal_class.full_signature: private String normaliseLocatorReference(String reference)
focal_class.identifier: normaliseLocatorReference
focal_class.modifiers: private
focal_class.parameters: (String reference)
focal_class.return: String
focal_class.signature: String normaliseLocatorReference(String reference)
focal_class.class_method_signature: CanonicalXTMWriter.longestCommonPath(String source1, String source2)
focal_class.full_signature: private String longestCommonPath(String source1, String source2)
focal_class.identifier: longestCommonPath
focal_class.modifiers: private
focal_class.parameters: (String source1, String source2)
focal_class.return: String
focal_class.signature: String longestCommonPath(String source1, String source2)
focal_class.class_method_signature: CanonicalXTMWriter.stripLocator(String locatorString)
focal_class.full_signature: private String stripLocator(String locatorString)
focal_class.identifier: stripLocator
focal_class.modifiers: private
focal_class.parameters: (String locatorString)
focal_class.return: String
focal_class.signature: String stripLocator(String locatorString)
focal_class.class_method_signature: CanonicalXTMWriter.setAdditionalProperties(Map<String, Object> properties)
focal_class.full_signature: @Override public void setAdditionalProperties(Map<String, Object> properties)
focal_class.identifier: setAdditionalProperties
focal_class.modifiers: @Override public
focal_class.parameters: (Map<String, Object> properties)
focal_class.return: void
focal_class.signature: void setAdditionalProperties(Map<String, Object> properties)
focal_class.class_method_signature: CanonicalXTMWriter.sort(Collection collection, Comparator comparator)
focal_class.full_signature: private SortedSet sort(Collection collection, Comparator comparator)
focal_class.identifier: sort
focal_class.modifiers: private
focal_class.parameters: (Collection collection, Comparator comparator)
focal_class.return: SortedSet
focal_class.signature: SortedSet sort(Collection collection, Comparator comparator)
focal_method.body: @Override
    public void write(TopicMapIF topicmap) {
      DuplicateSuppressionUtils.removeDuplicates(topicmap);
      tmForFake = topicmap;
    
      base = topicmap.getStore().getBaseAddress().getAddress();
      strippedBase = stripLocator(base);
  
      Object[] topics = getTopics(topicmap);
      Object[] associations = getAssociations(topicmap);
      recordIndexes(topics, associations);
          
      out.startDocument();
      startElement(EL_TOPICMAP, reifier(topicmap));
      writeLocators(topicmap.getItemIdentifiers(), EL_ITEMIDENTIFIERS);
      
      for (int ix = 0; ix < topics.length; ix++)
        write((TopicIF) topics[ix]);
  
      for (int ix = 0; ix < associations.length; ix++)
        write((AssociationIF) associations[ix], ix + 1);
  
      endElement(EL_TOPICMAP);
      out.endDocument();
    }
focal_method.class_method_signature: CanonicalXTMWriter.write(TopicMapIF topicmap)
focal_method.full_signature: @Override public void write(TopicMapIF topicmap)
focal_method.identifier: write
focal_method.invocations: removeDuplicates getAddress getBaseAddress getStore stripLocator getTopics getAssociations recordIndexes startDocument startElement reifier writeLocators getItemIdentifiers write write endElement endDocument
focal_method.modifiers: @Override public
focal_method.parameters: (TopicMapIF topicmap)
focal_method.return: void
focal_method.signature: void write(TopicMapIF topicmap)