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

fr.ird.observe.toolkit.templates.services.GenerateReferentialSecondLevelDeepBehaviourClass Maven / Gradle / Ivy

package fr.ird.observe.toolkit.templates.services;

/*-
 * #%L
 * Toolkit :: Templates
 * %%
 * Copyright (C) 2017 - 2024 Ultreia.io
 * %%
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public
 * License along with this program.  If not, see
 * .
 * #L%
 */

import fr.ird.observe.services.service.referential.ReferentialSecondLevelDeepBehaviourModel;
import fr.ird.observe.toolkit.templates.TemplateContract;
import org.nuiton.eugene.java.ObjectModelTransformerToJava;
import org.nuiton.eugene.models.object.ObjectModel;
import org.nuiton.eugene.models.object.ObjectModelClass;
import org.nuiton.eugene.models.object.ObjectModelJavaModifier;
import org.nuiton.eugene.models.object.ObjectModelOperation;

/**
 * Created at 30/09/2024.
 *
 * @author Tony Chemit - [email protected]
 * @since 10.0.0
 */
public class GenerateReferentialSecondLevelDeepBehaviourClass  extends ObjectModelTransformerToJava implements TemplateContract {

    @Override
    public void transformFromModel(ObjectModel model) {
        String packageName = getDefaultPackageName().replace(".dto", ".services.service.referential");
        String modelName = model.getName();
        ObjectModelClass modelSupport = createClass(modelName + ReferentialSecondLevelDeepBehaviourModel.class.getSimpleName(), packageName);
        setSuperClass(modelSupport, ReferentialSecondLevelDeepBehaviourModel.class);
        addStaticFactory(modelSupport, modelSupport.getQualifiedName());
        ObjectModelOperation constructor = addConstructor(modelSupport, ObjectModelJavaModifier.PUBLIC);
        setOperationBody(constructor, ""+"\n"
+"        super(\""+modelName+"\");\n"
+"    ");
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy