Search in sources :

Example 11 with YamlDeserializer

use of com.developmentontheedge.be5.metadata.serialization.yaml.YamlDeserializer in project be5 by DevelopmentOnTheEdge.

the class Serialization method reloadDaemons.

public static Daemons reloadDaemons(final Path file, final Module target) throws ReadException {
    checkProject(target.getProject());
    turnOffAutomaticSerialization();
    try {
        return new YamlDeserializer(new LoadContext()).reloadDaemons(file, target);
    } finally {
        turnOnAutomaticSerialization();
    }
}
Also used : YamlDeserializer(com.developmentontheedge.be5.metadata.serialization.yaml.YamlDeserializer)

Example 12 with YamlDeserializer

use of com.developmentontheedge.be5.metadata.serialization.yaml.YamlDeserializer in project be5 by DevelopmentOnTheEdge.

the class Serialization method load.

/**
 * @param root
 * @param fuseTemplates whether to fuse templates into entities (useful for modules loading)
 * @param loadContext
 * @return
 * @throws ProjectLoadException
 * @see Serialization#canBeLoaded(Path)
 */
public static Project load(final Path root, final boolean fuseTemplates, final LoadContext loadContext) throws ProjectLoadException {
    Objects.requireNonNull(root);
    turnOffAutomaticSerialization();
    try {
        return new YamlDeserializer(loadContext == null ? new LoadContext() : loadContext, fuseTemplates).readProject(root);
    } catch (final ReadException e) {
        throw new ProjectLoadException(root, e);
    } finally {
        turnOnAutomaticSerialization();
    }
}
Also used : ReadException(com.developmentontheedge.be5.metadata.exception.ReadException) ProjectLoadException(com.developmentontheedge.be5.metadata.exception.ProjectLoadException) YamlDeserializer(com.developmentontheedge.be5.metadata.serialization.yaml.YamlDeserializer)

Example 13 with YamlDeserializer

use of com.developmentontheedge.be5.metadata.serialization.yaml.YamlDeserializer in project be5 by DevelopmentOnTheEdge.

the class Serialization method reloadCustomizations.

public static PageCustomizations reloadCustomizations(final Path file, final Module target) throws ReadException {
    checkProject(target.getProject());
    turnOffAutomaticSerialization();
    try {
        return new YamlDeserializer(new LoadContext()).reloadCustomizations(file, target);
    } finally {
        turnOnAutomaticSerialization();
    }
}
Also used : YamlDeserializer(com.developmentontheedge.be5.metadata.serialization.yaml.YamlDeserializer)

Aggregations

YamlDeserializer (com.developmentontheedge.be5.metadata.serialization.yaml.YamlDeserializer)10 ReadException (com.developmentontheedge.be5.metadata.exception.ReadException)3 ProjectLoadException (com.developmentontheedge.be5.metadata.exception.ProjectLoadException)1 BeConnectionProfile (com.developmentontheedge.be5.metadata.model.BeConnectionProfile)1 Entity (com.developmentontheedge.be5.metadata.model.Entity)1 Query (com.developmentontheedge.be5.metadata.model.Query)1