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

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

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

Event.isStartDocument介绍

[英]Convenience method to tell if this Event carries a StartDocument
[中]判断此事件是否包含StartDocument的便捷方法

代码示例

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

/**
 * Convenience method returns the {@link IResource} as a {@link StartDocument}. The
 * caller should confirm the {@link Event} type using isStartDocument before calling
 * this method.
 * 
 * @return the {@link StartDocument}
 * 
 * @throws OkapiUnexpectedResourceTypeException
 *             if the {@link IResource} is not a {@link StartDocument}
 */
public StartDocument getStartDocument() {
  if ( isStartDocument() ) {
    return (StartDocument) resource;
  }
  throw new OkapiUnexpectedResourceTypeException("Event resource is not a StartDocument");
}

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

@Override
public Event handleEvent(Event event) {
  if (event.isStartDocument()) {
    event.getStartDocument().setFilterParameters(params);
  }
  return delegate.handleEvent(event);
}

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

@Override
public Event next() {
  if (delegate != null) {
    Event e = delegate.next();
    if (e.isStartDocument()) {
      StartDocument sd = e.getStartDocument();
      sd.setFilterParameters(getParameters());
    }
    return e;
  }
  return null;
}

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

if (e == null) return;
if (e.isNoop()) continue; // Get next filter event
if (e.isStartDocument()) {
  StartDocument sd = e.getStartDocument();
  sd.setFilterParameters(this.getParameters()); // Replace internal filter's parameters with this one's

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

if ((skelEvent == null) || (!skelEvent.isStartDocument())) {
  throw new OkapiUnexpectedResourceTypeException(
      "The start document event can't be found in the skeleton file.");

相关文章