configpropertyfileloader.java

来自「开源的axis2框架的源码。用于开发WEBSERVER」· Java 代码 · 共 445 行 · 第 1/2 页

JAVA
445
字号
                throw new Exception(CodegenMessages.getMessage("propfileload.unknownFramework"));
            }
            defaultDBFrameworkName = tempString;
            //load the third party schema names
            tempString = props.getProperty(THIRD_PARTY_SCHEMA_KEY_PREFIX);
            if (tempString != null) {
                thirdPartySchemaNames = tempString.split(SEPARATOR_CHAR);

            }

            //populate the db supporter template names.
            dbSupporterTemplateNameMap = new HashMap();
            String key;
            for (Iterator allProperties = props.keySet().iterator();
                 allProperties.hasNext();) {
                key = (String)allProperties.next();
                if (key.startsWith(DATA_BINDING_TEMPLATE_NAME_KEY_PREFIX) &&
                        key.endsWith(DATA_BINDING_TEMPLATE_NAME_KEY_SUFFIX)) {
                    dbSupporterTemplateNameMap.put(key,
                                                   props.getProperty(key));
                }

            }

            testObjectTemplateName = props.getProperty(DATA_BINDING_TEST_OBJECT_TEMPLATE_NAME_KEY);

            //load the language names
            tempString = props.getProperty(LANGUAGE_TYPE_KEY_PREFIX);
            if (tempString != null) {
                languageTypes = tempString.split(SEPARATOR_CHAR);

                //load the language emitter map
                tempString = props.getProperty(EMITTER_CLASS_KEY);
                if (tempString == null) {
                    throw new Exception(CodegenMessages.getMessage("propfileload.emitterMissing"));
                } else {
                    String[] tempClassNames = tempString.split(SEPARATOR_CHAR);
                    //populate the map
                    languageEmitterMap = new HashMap();
                    for (int i = 0; i < tempClassNames.length; i++) {
                        languageEmitterMap.put(languageTypes[i], tempClassNames[i]);
                    }

                }
            }

            // load the default language
            tempString = props.getProperty(DEFAULT_LANGUAGE_TYPE_KEY);
            if (null == tempString || !languageEmitterMap.containsKey(tempString)) {
                throw new Exception(CodegenMessages.getMessage("propfileload.unknownDefaultLang"));
            }
            defaultLanguage = tempString;

            // run through the language specific properties and populate the
            // language specific property map
            //
            String languageType;
            String tempkey;
            HashMap langSpecificMap;
            for (int i = 0; i < languageTypes.length; i++) {
                languageType = languageTypes[i];
                langSpecificMap = new HashMap();
                Enumeration keyEnum = props.keys();
                while (keyEnum.hasMoreElements()) {
                    tempkey = keyEnum.nextElement().toString();
                    if (tempkey.startsWith(languageType + ".")) {
                        langSpecificMap.put(tempkey, props.get(tempkey));
                    }
                }
                //now add this to the lang specific properties map
                languageSpecificPropertiesMap.put(languageType, langSpecificMap);
            }


        } catch (IOException e) {
            throw new RuntimeException(e);
        } catch (Exception e) {
            throw new RuntimeException(CodegenMessages.getMessage("propfileload.generalException"),
                                       e);
        }
    }

    /** @return the source folder name */
    public static String getResourceFolderName() {
        return resourceFolderName;
    }


    /** @return the resource folder name */
    public static String getSrcFolderName() {
        return srcFolderName;
    }

    /**
     * Gets the test object support template. This is used in the generated test class.
     *
     * @return Returns String.
     */
    public static String getTestObjectTemplateName() {
        return testObjectTemplateName;
    }

    /**
     * Gets the databinder template names. This is the template that has the logic for creating the
     * databind supporters.
     *
     * @return Returns String.
     */
    public static Map getDbSupporterTemplatesMap() {
        return dbSupporterTemplateNameMap;
    }

    /**
     * Gets the extension class names.
     *
     * @return Returns String[].
     */
    public static String[] getExtensionClassNames() {
        return extensionClassNames;
    }

    /**
     * get the post extension class names
     *
     * @return Returns String[].
     */
    public static String[] getPostExtensionClassNames() {
        return postExtensionClassNames;
    }

    /**
     * Gets the third party schema names list.
     *
     * @return Returns String[].
     */
    public static String[] getThirdPartySchemaNames() {
        return thirdPartySchemaNames;
    }

    /**
     * Gets the language type names.
     *
     * @return Returns String[].
     */
    public static String[] getLanguageTypes() {
        return languageTypes;
    }

    /**
     * Gets the emitter names map keys with the language name.
     *
     * @return Returns Map.
     */
    public static Map getLanguageEmitterMap() {
        return languageEmitterMap;
    }

    /**
     * Get the list of unwrap supported data binding frameworks
     *
     * @return list
     */
    public static List getUnwrapSupportedFrameworkNames() {
        return Arrays.asList(unwrapSuppoerteddatabindingFrameworkNames);
    }

    /**
     * Get the list of data binding frameworks that handle unwrapping directly.
     *
     * @return names
     */
    public static List getUnwrapDirectFrameworkNames() {
        return Arrays.asList(unwrapDirectdatabindingFrameworkNames);
    }

    /**
     * Gets the default language name.
     *
     * @return Returns String.
     */
    public static String getDefaultLanguage() {
        return defaultLanguage;
    }

    /**
     * Gets the language specific properties.
     *
     * @return Returns Map.
     */
    public static Map getLanguageSpecificPropertiesMap() {
        return languageSpecificPropertiesMap;
    }

    /**
     * Gets the databinding framework names.
     *
     * @return Returns String[].
     */
    public static String[] getDatabindingFrameworkNames() {
        return databindingFrameworkNames;
    }

    /**
     * Gets the extensions map for the databinding frameworks. The entries are keys by the framework
     * name.
     *
     * @return Returns Map.
     */
    public static Map getDatabindingFrameworkNameToExtensionMap() {
        return databindingFrameworkNameToExtensionMap;
    }

    /**
     * Gets the default DB framwork name.
     *
     * @return Returns String.
     */
    public static String getDefaultDBFrameworkName() {
        return defaultDBFrameworkName;
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?