Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  * Copyright 2014-2015 the original author or authors.
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
package org.dbflute.s2dao.metadata;

modified by jflute (originated in S2Dao)
    // ===================================================================================
    //                                                                             Provide
    //                                                                             =======
Provide value type for procedure from registered types.

pmbType The type of ProcdurePmb for the parameter. (NotNull)
paramName The name of parameter. (NotNull)
paramType The type of parameter. (NotNull)
keyName The key name for plug-in value type. (NullAllowed)
dbdef The current DB definition. (NotNull)
The instance of value type. (NotNull: if not found by (not-null) valueTypeName, exception)
    public ValueType provide(Class<?> pmbTypeString paramNameClass<?> paramTypeString keyNameDBDef dbdef) {
        if (keyName != null) {
            return findValueTypeByName(pmbTypeparamNameparamTypekeyName);
        if (List.class.isAssignableFrom(paramType)) { // is for out parameter cursor.
            return findCursorValueType(dbdef);
        return findValueTypeByType(paramType);
    // ===================================================================================
    //                                                                             By Name
    //                                                                             =======
    protected ValueType findValueTypeByName(Class<?> pmbTypeString paramNameClass<?> paramTypeString keyName) {
        final ValueType valueType = TnValueTypes.getPluginValueType(keyName);
        if (valueType != null) {
            return valueType;
        final ExceptionMessageBuilder br = new ExceptionMessageBuilder();
        br.addNotice("Not found a plug-in value type by the name.");
        br.addItem("Key Name");
        final String msg = br.buildExceptionMessage();
        throw new PluginValueTypeNotFoundException(msg);
    // ===================================================================================
    //                                                                              Cursor
    //                                                                              ======
    protected ValueType findCursorValueType(DBDef dbdef) {
        if (..equals(dbdef)) {
            return .;
        } else if (..equals(dbdef)) {
            return .;
        } else {
            return .;
    // ===================================================================================
    //                                                                             By Type
    //                                                                             =======
    protected ValueType findValueTypeByType(Class<?> paramType) {
        return TnValueTypes.getValueType(paramType);
New to GrepCode? Check out our FAQ X