/** * Method to test whether the passed in framework name is relevant to this extension. * * @param dbFrameworkName * @return Returns boolean. */ protected boolean testFallThrough(String dbFrameworkName) { Map extensionsMap = ConfigPropertyFileLoader.getDatabindingFrameworkNameToExtensionMap(); String mappedExtension = extensionsMap.get(dbFrameworkName) != null ? extensionsMap.get(dbFrameworkName).toString() : ""; return !(getClass().getName().equals(mappedExtension)); }
/** * Finds the file name extension. * * @param language * @return Returns the file extension. */ protected String getFileExtensionForLanguage(String language) { Map languageSpecificPropertyMap = (Map)ConfigPropertyFileLoader.getLanguageSpecificPropertiesMap().get(this.language); Iterator keys = languageSpecificPropertyMap.keySet().iterator(); String key; String extension = null; while (keys.hasNext()) { //check for template entries key = keys.next().toString(); if (key.endsWith(EXTENSION_SUFFIX)) { extension = languageSpecificPropertyMap.get(key).toString(); //add a . to the front extension = "." + extension; } } return extension; }
String[] schemaNames = ConfigPropertyFileLoader.getThirdPartySchemaNames(); Element[] schemaElements;
/** * Loads the relevant preExtensions * * @throws CodeGenerationException */ private void loadExtensions() throws CodeGenerationException { //load pre extensions String[] extensions = ConfigPropertyFileLoader.getExtensionClassNames(); if (extensions != null) { for (int i = 0; i < extensions.length; i++) { //load the Extension class addPreExtension((CodeGenExtension)getObjectFromClassName(extensions[i].trim())); } } //load post extensions String[] postExtensions = ConfigPropertyFileLoader.getPostExtensionClassNames(); if (postExtensions != null) { for (int i = 0; i < postExtensions.length; i++) { //load the Extension class addPostExtension( (CodeGenExtension)getObjectFromClassName(postExtensions[i].trim())); } } }
Map dbSupporterMap = ConfigPropertyFileLoader.getDbSupporterTemplatesMap(); String key; for (Iterator keys = dbSupporterMap.keySet().iterator(); keys.hasNext();) { return getSourceFromTemplateName(ConfigPropertyFileLoader.getTestObjectTemplateName());
if (!ConfigPropertyFileLoader.getUnwrapSupportedFrameworkNames(). contains(configuration.getDatabindingType())) { throw new CodeGenerationException( CodegenMessages.getMessage("extension.unsupportedforunwrapping")); } else if (!ConfigPropertyFileLoader.getUnwrapDirectFrameworkNames(). contains(configuration.getDatabindingType())) {
Map emitterMap = ConfigPropertyFileLoader.getLanguageEmitterMap(); String className = (String)emitterMap.get(configuration.getOutputLanguage()); if (className != null) {
/** Loads the template. */ public void loadTemplate() throws CodeGenerationException { // the default behavior for the class writers is to use the property map from the languge specific types // The properties are arranged in the following order // <lang-name>.* .template=<write-class>,<template-name> //first get the language specific property map Class clazz = this.getClass(); Map languageSpecificPropertyMap = (Map)ConfigPropertyFileLoader.getLanguageSpecificPropertiesMap().get(this.language); if (languageSpecificPropertyMap == null) { throw new CodeGenerationException( CodegenMessages.getMessage("writer.noLangPropertiesExtension")); } String templateName = findTemplate(languageSpecificPropertyMap); if (templateName != null) { this.xsltStream = clazz.getResourceAsStream(templateName); } else { throw new CodeGenerationException(CodegenMessages.getMessage("writer.templateMissing")); } }
String[] schemaNames = ConfigPropertyFileLoader.getThirdPartySchemaNames(); Element[] schemaElements;