use of org.dbflute.logic.generate.language.pkgstyle.DfLanguageClassPackage in project dbflute-core by dbflute.
the class DfBasicProperties method getCDefPureName.
public String getCDefPureName() {
// e.g. CDef
final String projectPrefix = getProjectPrefix();
final String allcommonPrefix = getAllcommonPrefix();
final DfLanguageClassPackage classPackage = getLanguageDependency().getLanguageClassPackage();
return classPackage.buildCDefPureClassName(projectPrefix, allcommonPrefix);
}
use of org.dbflute.logic.generate.language.pkgstyle.DfLanguageClassPackage in project dbflute-core by dbflute.
the class DfBqpOutsideSqlFile method doAnalyze.
protected void doAnalyze() {
final String exbhvMark;
{
final String exbhvPackage;
if (isApplicationBehaviorProject()) {
exbhvPackage = getLibraryBehaviorPackage();
} else {
exbhvPackage = getBasicProperties().getExtendedBehaviorPackage();
}
final String exbhvName = Srl.substringLastRear(exbhvPackage, ".");
final DfLanguageDependency lang = getBasicProperties().getLanguageDependency();
final DfLanguageClassPackage pkg = lang.getLanguageClassPackage();
final String sqlPackage;
if (getOutsideSqlProperties().isSqlPackageValid()) {
final String pureSqlPackage = getOutsideSqlProperties().getSqlPackage();
if (pureSqlPackage.endsWith(exbhvName)) {
// contains 'exbhv'
sqlPackage = Srl.substringLastFront(pureSqlPackage, ".");
} else {
sqlPackage = pureSqlPackage;
}
} else {
sqlPackage = Srl.substringLastFront(exbhvPackage, ".");
}
exbhvMark = pkg.buildExtendedBehaviorPackageMark(sqlPackage, exbhvName);
}
// both types are target
final String bhvSuffix = "Bhv";
final String bhvApSuffix = getApplicationBehaviorAdditionalSuffix();
final Pattern bqpPattern = Pattern.compile(".+" + exbhvMark + ".+" + bhvSuffix + "_.+.sql$");
final Pattern bqpApPattern = Pattern.compile(".+" + exbhvMark + ".+" + bhvApSuffix + "_.+.sql$");
final String path = getSlashPath(_outsideSqlFile.getPhysicalFile());
final Matcher matcher = bqpPattern.matcher(path);
final Matcher matcherAp = bqpApPattern.matcher(path);
final String foundSuffix;
if (matcher.matches()) {
foundSuffix = bhvSuffix;
} else if (matcherAp.matches()) {
foundSuffix = bhvApSuffix;
} else {
_bqp = false;
return;
}
_bqp = true;
String simpleFileName = path.substring(path.lastIndexOf(exbhvMark) + exbhvMark.length());
if (simpleFileName.contains("/")) {
_subDirectoryPath = simpleFileName.substring(0, simpleFileName.lastIndexOf("/"));
simpleFileName = simpleFileName.substring(simpleFileName.lastIndexOf("/") + "/".length());
}
final int behaviorNameMarkIndex = simpleFileName.indexOf(foundSuffix + "_");
final int behaviorNameEndIndex = behaviorNameMarkIndex + foundSuffix.length();
final int behaviorQueryPathStartIndex = behaviorNameMarkIndex + (foundSuffix + "_").length();
final int behaviorQueryPathEndIndex = simpleFileName.lastIndexOf(".sql");
_entityName = simpleFileName.substring(0, behaviorNameMarkIndex);
_behaviorName = simpleFileName.substring(0, behaviorNameEndIndex);
_behaviorQueryPath = simpleFileName.substring(behaviorQueryPathStartIndex, behaviorQueryPathEndIndex);
_filePath = path;
if (_outsideSqlFile.isSqlAp()) {
_sqlAp = true;
}
}
use of org.dbflute.logic.generate.language.pkgstyle.DfLanguageClassPackage in project dbflute-core by dbflute.
the class DfCommonColumnProperties method getAccessContextFqcn.
public String getAccessContextFqcn() {
if (_accessContextFqcn != null) {
return _accessContextFqcn;
}
final DfBasicProperties prop = getBasicProperties();
final boolean hibernate = prop.isFriendsHibernate();
final String baseCommonPackage = prop.getBaseCommonPackage();
final String projectPrefix = prop.getProjectPrefix();
final String accessContext;
if (hibernate) {
accessContext = baseCommonPackage + "." + projectPrefix + "AccessContext";
} else {
final DfLanguageClassPackage classPkg = prop.getLanguageDependency().getLanguageClassPackage();
accessContext = classPkg.buildAccessContextFqcn(baseCommonPackage, projectPrefix);
}
_accessContextFqcn = accessContext;
return _accessContextFqcn;
}
use of org.dbflute.logic.generate.language.pkgstyle.DfLanguageClassPackage in project dbflute-core by dbflute.
the class DfGapileProcess method createReflector.
protected DfGapileClassReflector createReflector(String gapileDirectory) {
final DfBasicProperties prop = getBasicProperties();
final String outputDirectory = prop.getGenerateOutputDirectory();
final String packageBase = prop.getPackageBase();
final DfLanguageDependency lang = prop.getLanguageDependency();
final DfLanguageClassPackage classPackage = lang.getLanguageClassPackage();
final DfLanguageGrammar grammar = lang.getLanguageGrammar();
return new DfGapileClassReflector(outputDirectory, packageBase, classPackage, grammar, gapileDirectory);
}
use of org.dbflute.logic.generate.language.pkgstyle.DfLanguageClassPackage in project dbflute-core by dbflute.
the class Database method createOldClassHandler.
protected DfOldClassHandler createOldClassHandler() {
final DfGenerator generator = getGeneratorInstance();
final DfLanguageDependency lang = getBasicProperties().getLanguageDependency();
final DfLanguageClassPackage pkg = lang.getLanguageClassPackage();
return new DfOldClassHandler(generator, pkg, getTableList());
}
Aggregations