/** * Set the current {@link TextUnit} type. If there is no defined type the type is the element name. * * @param type * - the TextUnit type. */ public void setTextUnitType(String type) { ITextUnit tu = peekMostRecentTextUnit(); if (tu != null) { tu.setType(type); } }
tu.setType("x-"+attr.getLocalName());
public ITextUnit convert (Unit unit) { ITextUnit tu = new TextUnit(unit.getId()); tu.setName(unit.getName()); tu.setType(unit.getType());
refTU.setPreserveWhitespaces(true); refTU.setSourceContent(tf); refTU.setType(resType); refTU.setIsReferent(true); refTU.setMimeType(MIFSTRING_MIME_TYPE);
tu.setSourceContent(new TextFragment(data)); tu.setMimeType(MimeTypeMapper.XML_MIME_TYPE); tu.setType("x-"+partName); queue.add(new Event(EventType.TEXT_UNIT, tu));
private ITextUnit embeddedTextUnit(PropertyTextUnitPlaceholder propOrText, String tag) { ITextUnit tu = new TextUnit(textUnitId.createId(), propOrText.getValue()); tu.setPreserveWhitespaces(this.preserveWhitespace); tu.setMimeType(propOrText.getMimeType()); tu.setIsReferent(true); tu.setType(propOrText.getElementType() == null ? propOrText.getName() : propOrText.getElementType()); GenericSkeleton skel = new GenericSkeleton(); skel.add(tag.substring(propOrText.getMainStartPos(), propOrText.getValueStartPos())); skel.addContentPlaceholder(tu); skel.add(tag.substring(propOrText.getValueEndPos(), propOrText.getMainEndPos())); tu.setSkeleton(skel); postProcessTextUnit(tu); return tu; }
if ( !Util.isEmpty(data) ) tu.setType(data); data = item.getMetadata().get(MetadataType.GROUP_NAME); if ( !Util.isEmpty(data) ) tu.setProperty(new Property("Txt::GroupName", data, false));