/*
* Copyright (c) 2005
* XDoclet Team
* All rights reserved.
*/
package org.xdoclet.plugin.ejb.interfaces;
import org.generama.MergeableVelocityTemplateEngine;
import org.generama.WriterMapper;
import org.xdoclet.plugin.ejb.EjbConfig;
import org.xdoclet.plugin.ejb.EjbJavaGeneratingPlugin;
import org.xdoclet.plugin.ejb.EjbUtils;
import com.thoughtworks.qdox.model.JavaClass;
/**
* DOCUMENT ME!
*
* @author Diogo Quintela
*
* TODO: Support @ejb.interface to help decide if we are going to generate or not
*/
public abstract class LocalInterfaceBase extends EjbJavaGeneratingPlugin {
/**
* DOCUMENT ME!
*
* @param templateEngine
* @param metadataProvider
* @param writerMapper
*
* @throws ClassNotFoundException
*/
public LocalInterfaceBase(MergeableVelocityTemplateEngine templateEngine,
WriterMapper writerMapper, EjbConfig config) {
super(templateEngine, writerMapper, config);
}
/**
* TODO: DOCUMENT ME!
*
* @param metadata TODO: DOCUMENT ME!
*
* @return TODO: DOCUMENT ME!
*/
public boolean shouldGenerate(Object metadata) {
JavaClass javaClass = (JavaClass) metadata;
boolean generate = ejbUtils.shouldGenerate(metadata);
generate = generate && EjbUtils.hasFlag(ejbUtils.getViewType(javaClass), EjbUtils.LOCAL);
generate = generate && !ejbUtils.isMessageDrivenBean(javaClass);
return generate;
}
}