org.yaml.snakeyaml.DumperOptions.Version Java Examples

The following examples show how to use org.yaml.snakeyaml.DumperOptions.Version. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: DocumentStartEvent.java    From orion.server with Eclipse Public License 1.0 5 votes vote down vote up
public DocumentStartEvent(Mark startMark, Mark endMark, boolean explicit, Version version,
        Map<String, String> tags) {
    super(startMark, endMark);
    this.explicit = explicit;
    this.version = version;
    // TODO enforce not null
    // if (tags == null) {
    // throw new NullPointerException("Tags must be provided.");
    // }
    this.tags = tags;
}
 
Example #2
Source File: DocumentStartEvent.java    From snake-yaml with Apache License 2.0 5 votes vote down vote up
public DocumentStartEvent(Mark startMark, Mark endMark, boolean explicit, Version version,
        Map<String, String> tags) {
    super(startMark, endMark);
    this.explicit = explicit;
    this.version = version;
    // TODO enforce not null
    // if (tags == null) {
    // throw new NullPointerException("Tags must be provided.");
    // }
    this.tags = tags;
}
 
Example #3
Source File: CanonicalParser.java    From snake-yaml with Apache License 2.0 5 votes vote down vote up
private void parseDocument() {
    if (scanner.checkToken(Token.ID.Directive)) {
        scanner.getToken(Token.ID.Directive);
    }
    scanner.getToken(Token.ID.DocumentStart);
    events.add(new DocumentStartEvent(null, null, true, Version.V1_1, null));
    parseNode();
    events.add(new DocumentEndEvent(null, null, true));
}
 
Example #4
Source File: Emitter.java    From Diorite with MIT License 5 votes vote down vote up
String prepareVersion(Version version)
{
    if (version.major() != 1)
    {
        throw new EmitterException("unsupported YAML version: " + version);
    }
    return version.getRepresentation();
}
 
Example #5
Source File: VersionTagsTuple.java    From orion.server with Eclipse Public License 1.0 4 votes vote down vote up
public VersionTagsTuple(Version version, Map<String, String> tags) {
    this.version = version;
    this.tags = tags;
}
 
Example #6
Source File: VersionTagsTuple.java    From orion.server with Eclipse Public License 1.0 4 votes vote down vote up
public Version getVersion() {
    return version;
}
 
Example #7
Source File: Emitter.java    From orion.server with Eclipse Public License 1.0 4 votes vote down vote up
private String prepareVersion(Version version) {
    if (version.getArray()[0] != 1) {
        throw new EmitterException("unsupported YAML version: " + version);
    }
    return version.getRepresentation();
}
 
Example #8
Source File: VersionTagsTuple.java    From snake-yaml with Apache License 2.0 4 votes vote down vote up
public VersionTagsTuple(Version version, Map<String, String> tags) {
    this.version = version;
    this.tags = tags;
}
 
Example #9
Source File: VersionTagsTuple.java    From snake-yaml with Apache License 2.0 4 votes vote down vote up
public Version getVersion() {
    return version;
}
 
Example #10
Source File: Emitter.java    From snake-yaml with Apache License 2.0 4 votes vote down vote up
private String prepareVersion(Version version) {
    if (version.major() != 1) {
        throw new EmitterException("unsupported YAML version: " + version);
    }
    return version.getRepresentation();
}
 
Example #11
Source File: VersionTagsTupleTest.java    From snake-yaml with Apache License 2.0 4 votes vote down vote up
public void testToString() {
    VersionTagsTuple tuple = new VersionTagsTuple(Version.V1_1, new HashMap<String, String>());
    assertEquals("VersionTagsTuple<Version: 1.1, {}>", tuple.toString());
}
 
Example #12
Source File: DocumentStartEvent.java    From orion.server with Eclipse Public License 1.0 2 votes vote down vote up
/**
 * YAML version the document conforms to.
 * 
 * @return <code>null</code>if the document has no explicit
 *         <code>%YAML</code> directive. Otherwise an array with two
 *         components, the major and minor part of the version (in this
 *         order).
 */
public Version getVersion() {
    return version;
}
 
Example #13
Source File: DocumentStartEvent.java    From snake-yaml with Apache License 2.0 2 votes vote down vote up
/**
 * YAML version the document conforms to.
 * 
 * @return <code>null</code>if the document has no explicit
 *         <code>%YAML</code> directive. Otherwise an array with two
 *         components, the major and minor part of the version (in this
 *         order).
 */
public Version getVersion() {
    return version;
}