org.tentackle.maven.wizard.OperationTemplateModel Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of tentackle-wizard-maven-plugin Show documentation
Show all versions of tentackle-wizard-maven-plugin Show documentation
Maven Plugin for Tentackle Wizards
/*
* Tentackle - http://www.tentackle.org
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
package org.tentackle.maven.wizard;
import java.util.HashMap;
/**
* Freemarker model for the operation templates.
*/
public class OperationTemplateModel extends HashMap {
/**
* Creates the model from the generator.
*
* @param generator the operation generator
*/
public OperationTemplateModel(OperationGenerator generator) {
putValue("profile", generator.getProfile().getName());
putValue("operationPackage", generator.getProfile().getOperationPackage());
putValue("domainPackage", generator.getProfile().getDomainPackage());
putValue("persistencePackage", generator.getProfile().getPersistencePackage());
putValue("domainImplPackage", generator.getProfile().getDomainImplPackage());
putValue("persistenceImplPackage", generator.getProfile().getPersistenceImplPackage());
putValue("superOperationInterface", generator.getSuperOperationInterface());
putValue("operationInterface", generator.getOperationName());
putValue("domainInterface", generator.getDomainInterface());
putValue("persistenceInterface", generator.getPersistenceInterface());
putValue("domainImplementation", generator.getDomainImplementation());
putValue("persistenceImplementation", generator.getPersistenceImplementation());
putValue("superDomainInterface", generator.getSuperDomainInterface());
putValue("superPersistenceInterface", generator.getSuperPersistenceInterface());
putValue("superDomainImplementation", generator.getSuperDomainImplementation());
putValue("superPersistenceImplementation", generator.getSuperPersistenceImplementation());
putValue("shortDescription", generator.getShortDescription());
putValue("longDescription", generator.getLongDescription());
putValue("abstractOperation", generator.isAbstractOperation());
putValue("remoteEnabled", generator.isRemoteEnabled());
}
private void putValue(String key, Object value) {
put(key, value == null ? "" : value.toString());
}
}