io.github.mmm.marshall.StructuredFormatProvider Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mmm-marshall Show documentation
Show all versions of mmm-marshall Show documentation
API for marshalling and unmarshalling data.
The newest version!
/* 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;
/**
* Factory to create instances of {@link StructuredFormat}.
*
* @since 1.0.0
*/
public interface StructuredFormatProvider {
/**
* @return the {@link StructuredFormat#getId() ID} of the {@link StructuredFormat} to {@link #create()}. E.g.
* {@link StructuredFormat#ID_JSON JSON}, {@link StructuredFormat#ID_XML XML}, {@link StructuredFormat#ID_YAML
* YAML}, or {@link StructuredFormat#ID_PROTOBUF}.
* @see StructuredFormat#getId()
*/
String getId();
/**
* @return a new {@link StructuredFormat} for {@link #getId() this} format using default configuration.
*/
StructuredFormat create();
/**
* @param config the {@link MarshallingConfig} to customize the format.
* @return a new {@link StructuredFormat} for {@link #getId() this} format using the given {@code config}.
*/
StructuredFormat create(MarshallingConfig config);
}