Skip to content

Commit

Permalink
JavaDoc fix, added missing deps to mgmt
Browse files Browse the repository at this point in the history
  • Loading branch information
hohwille committed Apr 14, 2024
1 parent bd0ca19 commit 1696f78
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 86 deletions.
Original file line number Diff line number Diff line change
@@ -1,85 +1,86 @@
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0 */
package io.github.mmm.marshall.yaml.impl;

import java.io.Reader;

import io.github.mmm.marshall.MarshallingConfig;
import io.github.mmm.marshall.StructuredFormat;
import io.github.mmm.marshall.StructuredReader;
import io.github.mmm.marshall.StructuredWriter;
import io.github.mmm.marshall.spi.AbstractStructuredTextFormat;
import io.github.mmm.scanner.CharReaderScanner;
import io.github.mmm.scanner.CharSequenceScanner;

/**
* Implementation of {@link StructuredFormat} for JSON (JavaScript Object Notation).
*
* @since 1.0.0
*/
public class YamlFormat extends AbstractStructuredTextFormat {

private static final YamlFormat DEFAULT = of(MarshallingConfig.DEFAULTS);

/**
* The constructor.
*
* @param config the {@link MarshallingConfig}.
* @see io.github.mmm.marshall.StructuredFormatFactory#create(String, MarshallingConfig)
*/
public YamlFormat(MarshallingConfig config) {

super(config);
}

@Override
public String getId() {

return ID_YAML;
}

@Override
public StructuredReader reader(Reader reader) {

return new YamlReader(new CharReaderScanner(reader), this);
}

@Override
public StructuredReader reader(String data) {

return new YamlReader(new CharSequenceScanner(data), this);
}

@Override
public StructuredWriter writer(Appendable writer) {

return new YamlWriter(writer, this);
}

@Override
public boolean isSupportingComments() {

return true;
}

/**
* @return the default instance of {@link YamlFormat}.
*/
public static YamlFormat of() {

return DEFAULT;
}

/**
* @param config the {@link MarshallingConfig} for the JSON vendor implementation.
* @return the new instance of {@link YamlFormat} with the given {@code config}.
*/
public static YamlFormat of(MarshallingConfig config) {

if (config == null) {
return DEFAULT;
}
return new YamlFormat(config);
}

}
/* Copyright (c) The m-m-m Team, Licensed under the Apache License, Version 2.0
* http://www.apache.org/licenses/LICENSE-2.0 */
package io.github.mmm.marshall.yaml.impl;

import java.io.Reader;

import io.github.mmm.marshall.MarshallingConfig;
import io.github.mmm.marshall.StructuredFormat;
import io.github.mmm.marshall.StructuredReader;
import io.github.mmm.marshall.StructuredWriter;
import io.github.mmm.marshall.spi.AbstractStructuredTextFormat;
import io.github.mmm.scanner.CharReaderScanner;
import io.github.mmm.scanner.CharSequenceScanner;

/**
* Implementation of {@link StructuredFormat} for YAML (YAML Ain't Markup Language) that extends JSON with nice and
* advanced features.
*
* @since 1.0.0
*/
public class YamlFormat extends AbstractStructuredTextFormat {

private static final YamlFormat DEFAULT = of(MarshallingConfig.DEFAULTS);

/**
* The constructor.
*
* @param config the {@link MarshallingConfig}.
* @see io.github.mmm.marshall.StructuredFormatFactory#create(String, MarshallingConfig)
*/
public YamlFormat(MarshallingConfig config) {

super(config);
}

@Override
public String getId() {

return ID_YAML;
}

@Override
public StructuredReader reader(Reader reader) {

return new YamlReader(new CharReaderScanner(reader), this);
}

@Override
public StructuredReader reader(String data) {

return new YamlReader(new CharSequenceScanner(data), this);
}

@Override
public StructuredWriter writer(Appendable writer) {

return new YamlWriter(writer, this);
}

@Override
public boolean isSupportingComments() {

return true;
}

/**
* @return the default instance of {@link YamlFormat}.
*/
public static YamlFormat of() {

return DEFAULT;
}

/**
* @param config the {@link MarshallingConfig} for the JSON vendor implementation.
* @return the new instance of {@link YamlFormat} with the given {@code config}.
*/
public static YamlFormat of(MarshallingConfig config) {

if (config == null) {
return DEFAULT;
}
return new YamlFormat(config);
}

}
12 changes: 11 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,29 @@
<artifactId>mmm-marshall-jsonp</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>mmm-marshall-protobuf</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>mmm-marshall-stax</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>mmm-marshall-snakeyaml</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>mmm-marshall-tvm-xml</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>mmm-marshall-protobuf</artifactId>
<artifactId>mmm-marshall-yaml</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
Expand Down

0 comments on commit 1696f78

Please sign in to comment.