net.sf.okapi.common.Event.getDocumentPart()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(3.1k)|赞(0)|评价(0)|浏览(102)

本文整理了Java中net.sf.okapi.common.Event.getDocumentPart()方法的一些代码示例,展示了Event.getDocumentPart()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Event.getDocumentPart()方法的具体详情如下:
包路径:net.sf.okapi.common.Event
类名称:Event
方法名:getDocumentPart

Event.getDocumentPart介绍

[英]Convenience method returns the IResource as a DocumentPart. The caller should confirm the Event type using isDocumentPart before calling this method.
[中]便利方法将IResource作为DocumentPart返回。调用方应在调用此方法之前使用isDocumentPart确认事件类型。

代码示例

代码示例来源:origin: net.sf.okapi.steps/okapi-step-rainbowkit

@Override
protected void processDocumentPart (Event event) {
  DocumentPart dp = event.getDocumentPart();
  if ( dp.isReferent() ) {
    storeReferent(dp);
  }
}

代码示例来源:origin: net.sf.okapi.filters/okapi-filter-idml

private boolean isStyledReferenceableEvent(ReferenceableEvent referenceableEvent) {
  switch (referenceableEvent.getEvent().getEventType()) {
    case TEXT_UNIT:
      return true;
    case DOCUMENT_PART:
      return referenceableEvent.getEvent().getDocumentPart().getSkeleton() instanceof StyledTextSkeleton;
    default:
      throw new IllegalStateException(UNEXPECTED_STRUCTURE);
  }
}

代码示例来源:origin: net.sf.okapi.filters/okapi-filter-idml

private void writeDocumentPartReferenceableEvent(ReferenceableEvent referenceableEvent) {

    ISkeleton skeleton = referenceableEvent.getEvent().getDocumentPart().getSkeleton();

    if (skeleton instanceof MarkupSkeleton) {
      Markup markup = ((MarkupSkeleton) skeleton).getMarkup();
      events.addAll(markup.getEvents());

      return;

    } else if (skeleton instanceof StyledTextSkeleton) {
      events.addAll(storyChildElementsWriter.write(((StyledTextSkeleton) skeleton).getStoryChildElements()));

      return;
    }

    throw new IllegalStateException(UNEXPECTED_STRUCTURE);
  }
}

代码示例来源:origin: net.sf.okapi.filters/okapi-filter-idml

private void handleDocumentPartEvent(Event event) {
  ReferenceableEvent referenceableEvent = new ReferenceableEvent(event.getDocumentPart().getId(), event);
  addReferenceableEvent(referenceableEvent);
}

代码示例来源:origin: net.sf.okapi/okapi-core

DocumentPart dp = e.getDocumentPart();
sb.append(" { id:").append(nqs(dp.getId())).append(",\n\t");
printINameable(sb, "\t", dp);

代码示例来源:origin: net.sf.okapi.steps/okapi-step-rainbowkit

break;
case DOCUMENT_PART:
  writer.write(skelWriter.processDocumentPart(event.getDocumentPart()));
  break;
case TEXT_UNIT:

代码示例来源:origin: net.sf.okapi.steps/okapi-step-common

return verificationUtil.compareIResources(event1.getEnding(), event2.getEnding());
case DOCUMENT_PART:
  return verificationUtil.compareBaseReferenceable(event1.getDocumentPart(), event2.getDocumentPart());
case CANCELED:
case CUSTOM:

代码示例来源:origin: net.sf.okapi.filters/okapi-filter-idml

ISkeleton skeleton = referentEvent.getEvent().getDocumentPart().getSkeleton();

代码示例来源:origin: net.sf.okapi/okapi-core

skeletonWriter.processDocumentPart(event.getDocumentPart());
return Event.NOOP_EVENT;

代码示例来源:origin: net.sf.okapi.filters/okapi-filter-abstractmarkup

switch(e.getEventType()) {
case DOCUMENT_PART:
  DocumentPart dp = e.getDocumentPart();
  dp.setSkeleton(new GenericSkeleton(Util.escapeToXML(dp.getSkeleton().toString(), 0, true, null)));
  break;

代码示例来源:origin: net.sf.okapi/okapi-core

break;
case DOCUMENT_PART:
  processDocumentPart(event.getDocumentPart());
  break;
case MULTI_EVENT:

相关文章