當前位置: 首頁>>代碼示例>>Java>>正文


Java DocOpBuilder.annotationBoundary方法代碼示例

本文整理匯總了Java中org.waveprotocol.wave.model.document.operation.impl.DocOpBuilder.annotationBoundary方法的典型用法代碼示例。如果您正苦於以下問題:Java DocOpBuilder.annotationBoundary方法的具體用法?Java DocOpBuilder.annotationBoundary怎麽用?Java DocOpBuilder.annotationBoundary使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.waveprotocol.wave.model.document.operation.impl.DocOpBuilder的用法示例。


在下文中一共展示了DocOpBuilder.annotationBoundary方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: testAnnotationBoundary

import org.waveprotocol.wave.model.document.operation.impl.DocOpBuilder; //導入方法依賴的package包/類
public void testAnnotationBoundary() {
  DocOpBuilder m = new DocOpBuilder();

  Attributes a = new AttributesImpl(ImmutableMap.of("a1", "1", "a2", "2"));
  AnnotationBoundaryMap mapA = new AnnotationBoundaryMapImpl(
      new String[]{},new String[]{"a"},new String[]{null},new String[]{"b"});
  AnnotationBoundaryMap mapB = new AnnotationBoundaryMapImpl(
      new String[]{},new String[]{"a"},new String[]{"b"},new String[]{null});
  AnnotationBoundaryMap mapC = new AnnotationBoundaryMapImpl(
      new String[]{"a"},new String[]{},new String[]{},new String[]{});
  m.elementStart("a", a);
  m.annotationBoundary(mapA);
  m.characters("test");
  m.annotationBoundary(mapB);
  m.characters("text");
  m.annotationBoundary(mapC);
  m.elementEnd();

  assertReversible(makeBlipOp("annotationBoundary", m.build()));
}
 
開發者ID:jorkey,項目名稱:Wiab.pro,代碼行數:21,代碼來源:WaveletOperationSerializerTest.java

示例2: testEmptyAnnotationBoundary

import org.waveprotocol.wave.model.document.operation.impl.DocOpBuilder; //導入方法依賴的package包/類
public void testEmptyAnnotationBoundary() {
  DocOpBuilder m = new DocOpBuilder();

  Attributes a = new AttributesImpl(ImmutableMap.of("a1", "1", "a2", "2"));
  m.elementStart("a", a);
  m.annotationBoundary(AnnotationBoundaryMapImpl.EMPTY_MAP);
  m.characters("text");
  m.annotationBoundary(AnnotationBoundaryMapImpl.EMPTY_MAP);
  m.elementEnd();

  assertReversible(makeBlipOp("emptyAnnotationBoundary", m.build()));
}
 
開發者ID:jorkey,項目名稱:Wiab.pro,代碼行數:13,代碼來源:WaveletOperationSerializerTest.java

示例3: testScrubs

import org.waveprotocol.wave.model.document.operation.impl.DocOpBuilder; //導入方法依賴的package包/類
public void testScrubs() {
  DocOpBuilder b1 = new DocOpBuilder();
  DocOpBuilder b2 = new DocOpBuilder();

  b1.characters(VALID);
  b2.characters(VALID_SCRUBBED);

  b1.deleteCharacters(VALID);
  b2.deleteCharacters(VALID_SCRUBBED);

  b1.characters(INVALID);
  b2.characters(INVALID_SCRUBBED);

  b1.deleteCharacters(INVALID);
  b2.deleteCharacters(INVALID_SCRUBBED);

  b1.elementStart("abc", ATTRS);
  b2.elementStart("abc", ATTRS_SCRUBBED);

  b1.elementEnd();
  b2.elementEnd();

  b1.deleteElementStart("abc", ATTRS);
  b2.deleteElementStart("abc", ATTRS_SCRUBBED);

  b1.deleteElementEnd();
  b2.deleteElementEnd();

  b1.retain(5);
  b2.retain(5);

  b1.replaceAttributes(ATTRS, ATTRS);
  b2.replaceAttributes(ATTRS_SCRUBBED, ATTRS_SCRUBBED);

  b1.updateAttributes(ATTRSUP);
  b2.updateAttributes(ATTRSUP_SCRUBBED);

  b1.annotationBoundary(ANNO);
  b2.annotationBoundary(ANNO_SCRUBBED);

  DocOp o1 = DocOpScrub.scrub(b1.buildUnchecked());
  DocOp o2 = b2.buildUnchecked();
  assertTrue("\n" + o1 + "\n but expected \n" + o2,
      OpComparators.SYNTACTIC_IDENTITY.equal(o1, o2));
}
 
開發者ID:jorkey,項目名稱:Wiab.pro,代碼行數:46,代碼來源:DocOpScrubTest.java


注:本文中的org.waveprotocol.wave.model.document.operation.impl.DocOpBuilder.annotationBoundary方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。