
com.github.dennisit.vplus.mvc.vstrap.VplusMvcBootstrap Maven / Gradle / Ivy
The newest version!
/*--------------------------------------------------------------------------
* Copyright (c) 2010-2020, Elon.su All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* Neither the name of the elon developer nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
* Author: Elon.su, you can also mail [email protected]
*--------------------------------------------------------------------------
*/
package com.github.dennisit.vplus.mvc.vstrap;
import com.github.dennisit.vplus.core.apis.impl.TemplateLoadApiImpl;
import com.github.dennisit.vplus.core.bean.VdbBean;
import com.github.dennisit.vplus.core.config.Vsetting;
import com.github.dennisit.vplus.core.parser.HTableClassNameParser;
import com.github.dennisit.vplus.core.parser.HTableClassTableParser;
import com.github.dennisit.vplus.data.utils.PathViewUtils;
import com.github.dennisit.vplus.mvc.plugin.VPlusMvcBornApiImpl;
import org.apache.commons.lang3.StringUtils;
/**
* Created by Elon.su on 17/3/7.
*/
public class VplusMvcBootstrap {
/**
* born with anno
* @param scanPackage
* @param bornPath
*/
public static void anoBorn(String scanPackage, String bornPath){
Vsetting vsetting = new Vsetting();
if(StringUtils.isNotBlank(scanPackage)){
vsetting.setScanPackage(scanPackage);
}
if(StringUtils.isNoneBlank(bornPath)){
vsetting.setBornPath(bornPath);
}
vsetting.setLocationPattern("classpath:/vplus-mvc/**");
annBorn(vsetting);
}
/**
* born with anno
* @param vsetting
*/
public static void annBorn(Vsetting vsetting){
new VPlusMvcBornApiImpl().vBorn(new HTableClassNameParser(), new TemplateLoadApiImpl(), vsetting);
PathViewUtils.open(vsetting.getBornPath());
}
/**
* born with database
* @param vdbBean
* @param bornPackage
*/
public static void dbBorn(VdbBean vdbBean, String bornPackage, String bornPath){
Vsetting vsetting = new Vsetting();
vsetting.setVdbBean(vdbBean);
if(StringUtils.isNotBlank(bornPackage)){
vsetting.setBornPackage(bornPackage);
}
if(StringUtils.isNoneBlank(bornPath)){
vsetting.setBornPath(bornPath);
}
vsetting.setLocationPattern("classpath:/vplus-mvc/**");
dbBorn(vsetting);
}
/**
* born with database
* @param vsetting
*/
public static void dbBorn(Vsetting vsetting){
new VPlusMvcBornApiImpl().vBorn(new HTableClassTableParser(), new TemplateLoadApiImpl(), vsetting);
PathViewUtils.open(vsetting.getBornPath());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy