/** * Adds to this skeleton a reference to an existing resource send before the one to * which this skeleton is attached to. * @param referent the resource to refer to. */ public void addReference (IReferenceable referent) { GenericSkeletonPart part = new GenericSkeletonPart( TextFragment.makeRefMarker(((IResource)referent).getId())); part.locId = null; part.parent = null; // This is a reference to a real referent list.add(part); // Flag that the next append() should start a new part createNew = true; }
private MultiEvent assignIDs(MultiEvent me, IResource resource) { int counter = 0; for (Event event : me) { if (event.isNoop()) continue; IResource res = event.getResource(); String resId = resource.getId(); if (res instanceof DocumentPart && !(resource instanceof DocumentPart)) { String id = ""; if (counter++ == 0) id = resId; else id = String.format("%s_%d", resId, counter++); res.setId("" + String.format("dp_%s", id)); } else { res.setId(resId); if (res instanceof BaseNameable && resource instanceof BaseNameable) { ResourceUtil.copyProperties((BaseNameable) resource, (BaseNameable) res); } } } return me; }
} else { IResource res = e.getResource(); sb.append(" { id:").append(nqs(res.getId())).append(",\n\t"); printSkeleton(sb, "\t", res); sb.append("}");
LOGGER.trace("{}: ", etyp); if (event.getResource() != null) { LOGGER.trace("({})", event.getResource().getId()); if (event.getResource() instanceof DocumentPart) { setter = ((DocumentPart) event.getResource()).getSourcePropertyNames();
@Override protected Event handleTextUnit(Event event) { String id = event.getResource().getId();