Package com.esotericsoftware.yamlbeans

Examples of com.esotericsoftware.yamlbeans.Version


  Version defaultVersion, documentVersion;
  final Production[] table = new Production[46];
  Event peekedEvent;

  public Parser (Reader reader) {
    this(reader, new Version(1, 1));
  }
View Full Code Here


    documentVersion = null;
    while (tokenizer.peekNextTokenType() == DIRECTIVE) {
      DirectiveToken token = (DirectiveToken)tokenizer.getNextToken();
      if (token.getDirective().equals("YAML")) {
        if (documentVersion != null) throw new ParserException("Duplicate YAML directive.");
        documentVersion = new Version(token.getValue());
        if (documentVersion.major != 1)
          throw new ParserException("Unsupported YAML version (1.x is required): " + documentVersion);
      } else if (token.getDirective().equals("TAG")) {
        String[] values = token.getValue().split(" ");
        String handle = values[0];
        String prefix = values[1];
        if (tagHandles.containsKey(handle)) throw new ParserException("Duplicate tag directive: " + handle);
        tagHandles.put(handle, prefix);
      }
    }

    Version version;
    if (documentVersion != null)
      version = documentVersion;
    else
      version = defaultVersion;
View Full Code Here

  Version defaultVersion, documentVersion;
  final Production[] table = new Production[46];
  Event peekedEvent;

  public Parser (Reader reader) {
    this(reader, new Version(1, 1));
  }
View Full Code Here

    documentVersion = null;
    while (tokenizer.peekNextTokenType() == DIRECTIVE) {
      DirectiveToken token = (DirectiveToken)tokenizer.getNextToken();
      if (token.getDirective().equals("YAML")) {
        if (documentVersion != null) throw new ParserException("Duplicate YAML directive.");
        documentVersion = new Version(token.getValue());
        if (documentVersion.major != 1)
          throw new ParserException("Unsupported YAML version (1.x is required): " + documentVersion);
      } else if (token.getDirective().equals("TAG")) {
        String[] values = token.getValue().split(" ");
        String handle = values[0];
        String prefix = values[1];
        if (tagHandles.containsKey(handle)) throw new ParserException("Duplicate tag directive: " + handle);
        tagHandles.put(handle, prefix);
      }
    }

    Version version;
    if (documentVersion != null)
      version = documentVersion;
    else
      version = defaultVersion;
View Full Code Here

TOP

Related Classes of com.esotericsoftware.yamlbeans.Version

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.