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

com.wesleyhome.dao.processor.DAOInterfaceProcessor Maven / Gradle / Ivy

/*
 * @(#)DAOInterfaceProcessor.java
 * 
 * (C) Copyright 2014 by Travelers
 * All Rights Reserved.
 * 
 * This software is the confidential and proprietary information
 * of the Travelers Corporation. ("Confidential Information").
 * Redistribution of the source code or binary form is not permitted
 * without prior authorization from Travelers.
 */
package com.wesleyhome.dao.processor;

import java.io.Serializable;
import com.sun.codemodel.JClass;
import com.sun.codemodel.JCodeModel;
import com.sun.codemodel.JDefinedClass;
import com.wesleyhome.dao.processor.model.EntityInfo;

/**
 * The DAOInterfaceProcessor class is a
 * 
 * @author
 * @since
 */
public class DAOInterfaceProcessor extends DAOAnnotationProcessor {

	/**
	 * @param entityInfo
	 * @param generatedClass
	 * @param model
	 */
	@Override
	protected void generateConstuctor(final EntityInfo entityInfo, final JDefinedClass generatedClass, final JCodeModel model) {
		// No constructor for interface
	}

	@Override
	protected void defineClass(final EntityInfo entityInfo, final JCodeModel model, final JClass entityClassRef, final JDefinedClass generatedClass) {
		super.defineClass(entityInfo, model, entityClassRef, generatedClass);
		generatedClass._implements(Serializable.class);
	}

	/* (non-Javadoc)
	 * @see com.travelers.smart.dao.generator.processor.DAOAnnotationProcessor#defineGeneratedClassName(com.travelers.smart.dao.generator.processor.model.GeneratedQueryInfo)
	 */
	@Override
	protected String defineGeneratedClassName(final EntityInfo entityInfo) {
		return String.format("%sDAO", entityInfo.entityName);
	}

	/**
	 * @return
	 */
	@Override
	protected String getExtensionClass() {
		return "com.travelers.smart.model.dao.DAO";
	}

	/**
	 * @return
	 */
	@Override
	protected boolean isInterface() {
		return true;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy