All Downloads are FREE. Search and download functionalities are using the official Maven repository.

zserio.extension.python.ServiceEmitter Maven / Gradle / Ivy

The newest version!
package zserio.extension.python;

import zserio.ast.ServiceType;
import zserio.extension.common.OutputFileManager;
import zserio.extension.common.PackedTypesCollector;
import zserio.extension.common.ZserioExtensionException;

/**
 * Service emitter.
 */
final class ServiceEmitter extends PythonDefaultEmitter
{
    public ServiceEmitter(OutputFileManager outputFileManager, PythonExtensionParameters pythonParameters,
            PackedTypesCollector packedTypesCollector)
    {
        super(outputFileManager, pythonParameters, packedTypesCollector);
    }

    @Override
    public void beginService(ServiceType serviceType) throws ZserioExtensionException
    {
        if (!getWithServiceCode())
            return;

        final ServiceEmitterTemplateData templateData =
                new ServiceEmitterTemplateData(getTemplateDataContext(), serviceType);
        processSourceTemplate(TEMPLATE_SOURCE_NAME, templateData, serviceType);
    }

    static final String TEMPLATE_SOURCE_NAME = "Service.py.ftl";
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy