@Override public void consume(DocOp op) throws OperationException { consume(op, performValidation); }
@Override public IndexedDocument<N, E, T> build(DocInitialization operation, DocumentSchema schema) { AnnotationTree<Object> annotations = new AnnotationTree<Object>(ONE_OBJECT, ANOTHER_OBJECT, null); IndexedDocumentImpl<N, E, T, ?> doc = new IndexedDocumentImpl<N, E, T, Void>( substrateProvider.create("doc", Attributes.EMPTY_MAP), annotations, schema); try { doc.consume(operation); } catch (OperationException e) { throw new OperationRuntimeException("Invalid initialization", e); } return doc; }
private static IndexedDocumentImpl<Node, Element, Text, ?> doCopyDocument( IndexedDocumentImpl<Node, Element, Text, ?> other) { IndexedDocumentImpl<Node, Element, Text, ?> doc = new IndexedDocumentImpl<Node, Element, Text, Void>( RawDocumentImpl.PROVIDER.create("doc", Attributes.EMPTY_MAP), null, DocumentSchema.NO_SCHEMA_CONSTRAINTS); try { doc.consume(other.asOperation()); } catch (OperationException e) { throw new OperationRuntimeException("Copy should not fail", e); } return doc; }
private static IndexedDocumentImpl<Node, Element, Text, ?> doCopyDocument( IndexedDocumentImpl<Node, Element, Text, ?> other) { IndexedDocumentImpl<Node, Element, Text, ?> doc = new IndexedDocumentImpl<Node, Element, Text, Void>( RawDocumentImpl.PROVIDER.create("doc", Attributes.EMPTY_MAP), null, DocumentSchema.NO_SCHEMA_CONSTRAINTS); try { doc.consume(other.asOperation()); } catch (OperationException e) { throw new OperationRuntimeException("Copy should not fail", e); } return doc; }
RawDocumentImpl.PROVIDER.parse("<doc><p></p></doc>"), annotations, DocumentSchema.NO_SCHEMA_CONSTRAINTS); doc.consume(new DocOpBuilder().annotationBoundary( new AnnotationBoundaryMapBuilder().change("a", null, "0").build()) .characters(b.toString()).retain(2)
RawDocumentImpl.PROVIDER.parse("<doc><p></p></doc>"), annotations, DocumentSchema.NO_SCHEMA_CONSTRAINTS); doc.consume(new DocOpBuilder().annotationBoundary( new AnnotationBoundaryMapBuilder().change("a", null, "0").build()) .characters(b.toString()).retain(2)