本文整理汇总了Java中org.waveprotocol.wave.model.document.operation.impl.DocOpBuilder.characters方法的典型用法代码示例。如果您正苦于以下问题:Java DocOpBuilder.characters方法的具体用法?Java DocOpBuilder.characters怎么用?Java DocOpBuilder.characters使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.waveprotocol.wave.model.document.operation.impl.DocOpBuilder
的用法示例。
在下文中一共展示了DocOpBuilder.characters方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testCharactersAndElements
import org.waveprotocol.wave.model.document.operation.impl.DocOpBuilder; //导入方法依赖的package包/类
public void testCharactersAndElements() {
DocOpBuilder m = new DocOpBuilder();
Attributes a = new AttributesImpl(ImmutableMap.of("a1", "1", "a2", "2"));
Attributes b = new AttributesImpl();
Attributes c = new AttributesImpl(ImmutableMap.of("c1", "1", "c2", "2", "c3", "3"));
m.elementStart("a", a);
m.characters("hello");
m.elementStart("b", b);
m.characters("world");
m.elementStart("c", c);
m.elementEnd();
m.characters("blah");
m.elementEnd();
m.elementEnd();
assertReversible(makeBlipOp("charactersAndElements", m.build()));
}
示例2: 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()));
}
示例3: testManyCharacters
import org.waveprotocol.wave.model.document.operation.impl.DocOpBuilder; //导入方法依赖的package包/类
public void testManyCharacters() {
DocOpBuilder m = new DocOpBuilder();
m.characters("hello");
m.characters("world");
m.characters("foo");
m.characters("bar");
assertReversible(makeBlipOp("many", m.build()));
}
示例4: testRetain
import org.waveprotocol.wave.model.document.operation.impl.DocOpBuilder; //导入方法依赖的package包/类
public void testRetain() {
DocOpBuilder m = new DocOpBuilder();
m.characters("hello");
m.retain(5);
m.characters("world");
m.retain(10);
m.characters("foo");
m.retain(13);
m.characters("bar");
m.retain(16);
assertReversible(makeBlipOp("retain", m.build()));
}
示例5: testDeleteCharacters
import org.waveprotocol.wave.model.document.operation.impl.DocOpBuilder; //导入方法依赖的package包/类
public void testDeleteCharacters() {
DocOpBuilder m = new DocOpBuilder();
m.characters("hello");
m.retain(1);
m.deleteCharacters("ab");
m.characters("world");
m.retain(2);
m.deleteCharacters("cd");
assertReversible(makeBlipOp("deleteCharacters", m.build()));
}
示例6: 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()));
}
示例7: 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));
}
示例8: testSingleCharacters
import org.waveprotocol.wave.model.document.operation.impl.DocOpBuilder; //导入方法依赖的package包/类
public void testSingleCharacters() {
DocOpBuilder m = new DocOpBuilder();
m.characters("hello");
assertReversible(makeBlipOp("single", m.build()));
}