/** Creates the location definitions */ private void createLocations() { ArrayList<DictionaryFileRef> files = new ArrayList<DictionaryFileRef>(); LocationStore.startLocations(); for (TraceGroup group : dictionaryFile.getOwner().getModel()) { for (Trace trace : group) { writeLocation(files, trace); } } // Build XML and assign ID's to refs Collections.sort(files, new FileRefComparator()); String lastpath = null; for (DictionaryFileRef ref : files) { if (!ref.path.equals(lastpath)) { if (lastpath != null) { LocationStore.endPath(); } LocationStore.startPath(ref.path); lastpath = ref.path; } LocationStore.writeFile(++fileref, ref.file); ref.refid = fileref; } if (lastpath != null) { LocationStore.endPath(); } LocationStore.endLocations(); }
/** * Creates a trace definition * * @param trace the trace */ private void createTrace(Trace trace) { DictionaryDefRef defref = trace.getExtension(DictionaryDefRef.class); if (defref != null) { DictionaryFileRef fileref = trace.getExtension(DictionaryFileRef.class); com.nokia.tracecompiler.decodeplugins.dictionary.encoder.TraceGroup.startTrace( defref.getRefId(), trace.getName()); if (fileref != null) { writeTraceWithLocation(fileref.getRefId(), trace); } else { com.nokia.tracecompiler.decodeplugins.dictionary.encoder.Trace.writeInstance( trace.getID(), 0, 0, "", //$NON-NLS-1$ ""); //$NON-NLS-1$ } com.nokia.tracecompiler.decodeplugins.dictionary.encoder.TraceGroup.endTrace(); } trace.removeExtensions(DictionaryRef.class); }