Package org.waveprotocol.wave.model.document.operation.automaton

Examples of org.waveprotocol.wave.model.document.operation.automaton.DocumentSchema


    return doc = cxt.document();
  }

  private MutableDocument<Node, Element, Text> getDocWithSchema(String innerXml) {
    cxt = ContextProviders.createTestPojoContext(innerXml, null, null, null,
        new DocumentSchema() {
          @Override
          public List<String> getRequiredInitialChildren(String typeOrNull) {
            return SCHEMA.getRequiredInitialChildren(typeOrNull);
          }
View Full Code Here


  /** For performance testing
   * @throws OperationException */
  public static void main(String[] argv) throws OperationException {
    RandomProvider random = new RandomProviderImpl(1);
    RandomDocOpGenerator.Parameters params = PARAM_SETS[0];
    DocumentSchema constraints = DocumentSchema.NO_SCHEMA_CONSTRAINTS;
    IndexedDocument<Node, Element, Text> doc =
      new IndexedDocumentImpl<Node, Element, Text, Void>(RawDocumentImpl.PROVIDER.parse("<a></a>"),
          new AnnotationTree<Object>("a", "b", null), constraints);
    AutomatonDocument autoDoc = Automatons.fromReadable(doc);

View Full Code Here

    private Factory(SchemaProvider schemas) {
      this.schemas = schemas;
    }

    private DocumentSchema getSchemaForId(WaveletId waveletId, String documentId) {
      DocumentSchema result = schemas.getSchemaForId(waveletId, documentId);
      return (result != null) ? result : DocumentSchema.NO_SCHEMA_CONSTRAINTS;
    }
View Full Code Here

   * be the result.  If none return a value null will be returned; if more than
   * one does an {@link IllegalStateException} will be thrown.
   */
  @Override
  public DocumentSchema getSchemaForId(WaveletId waveletId, String documentId) {
    DocumentSchema result = null;
    for (SchemaProvider provider : providers) {
      // TODO(user): Change the way providers (or individual schemas) are
      //   registered to catch ambiguities earlier.
      DocumentSchema value = provider.getSchemaForId(waveletId, documentId);
      assert value != null;
      if (value != DocumentSchema.NO_SCHEMA_CONSTRAINTS) {
        // Check that only one schema matches.  This ensures that the ordering of
        // resolvers doesn't influence which schema is used which could lead to
        // some pretty horrible bugs.
View Full Code Here

        logger.error().log("Error", e);
      }
      return;
    }

    DocumentSchema schema = getSchema();

    ViolationCollector vc = new ViolationCollector();
    if (!DocOpValidator.validate(vc, schema, op).isValid()) {
      logger.error().log("That content does not conform to the schema", vc);
      return;
View Full Code Here

    private Factory(SchemaProvider schemas) {
      this.schemas = schemas;
    }

    private DocumentSchema getSchemaForId(WaveletId waveletId, String documentId) {
      DocumentSchema result = schemas.getSchemaForId(waveletId, documentId);
      return (result != null) ? result : DocumentSchema.NO_SCHEMA_CONSTRAINTS;
    }
View Full Code Here

        logger.error().log("Error", e);
      }
      return;
    }

    DocumentSchema schema = getSchema();

    ViolationCollector vc = new ViolationCollector();
    if (!DocOpValidator.validate(vc, schema, op).isValid()) {
      logger.error().log("That content does not conform to the schema", vc);
      return;
View Full Code Here

   * be the result.  If none return a value null will be returned; if more than
   * one does an {@link IllegalStateException} will be thrown.
   */
  @Override
  public DocumentSchema getSchemaForId(WaveletId waveletId, String documentId) {
    DocumentSchema result = null;
    for (SchemaProvider provider : providers) {
      // TODO(user): Change the way providers (or individual schemas) are
      //   registered to catch ambiguities earlier.
      DocumentSchema value = provider.getSchemaForId(waveletId, documentId);
      assert value != null;
      if (value != DocumentSchema.NO_SCHEMA_CONSTRAINTS) {
        // Check that only one schema matches.  This ensures that the ordering of
        // resolvers doesn't influence which schema is used which could lead to
        // some pretty horrible bugs.
View Full Code Here

TOP

Related Classes of org.waveprotocol.wave.model.document.operation.automaton.DocumentSchema

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.