当前位置: 首页>>代码示例>>Java>>正文


Java DataTypeUtil.determineFieldDataType方法代码示例

本文整理汇总了Java中org.kuali.rice.krad.util.DataTypeUtil.determineFieldDataType方法的典型用法代码示例。如果您正苦于以下问题:Java DataTypeUtil.determineFieldDataType方法的具体用法?Java DataTypeUtil.determineFieldDataType怎么用?Java DataTypeUtil.determineFieldDataType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.kuali.rice.krad.util.DataTypeUtil的用法示例。


在下文中一共展示了DataTypeUtil.determineFieldDataType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: buildRemotableFieldFromAttributeDefinition

import org.kuali.rice.krad.util.DataTypeUtil; //导入方法依赖的package包/类
@Override
public RemotableAttributeField buildRemotableFieldFromAttributeDefinition(String componentClassName,
        String attributeName) {
    AttributeDefinition baseDefinition;
    Class<?> componentClass;
    // try to resolve the component name - if not possible - try to pull the definition from the app mediation service
    try {
        componentClass = Class.forName(componentClassName);
        baseDefinition = getDataDictionaryService().getDataDictionary().getDictionaryObjectEntry(componentClassName)
                .getAttributeDefinition(attributeName);
    } catch (ClassNotFoundException ex) {
        throw new RiceRuntimeException("Unable to find attribute definition for attribute : " + attributeName);
    }

    RemotableAttributeField.Builder definition = RemotableAttributeField.Builder.create(baseDefinition.getName());

    definition.setLongLabel(baseDefinition.getLabel());
    definition.setShortLabel(baseDefinition.getShortLabel());
    definition.setMaxLength(baseDefinition.getMaxLength());

    if (baseDefinition.isRequired() != null) {
        definition.setRequired(baseDefinition.isRequired().booleanValue());
    }

    definition.setForceUpperCase(baseDefinition.getForceUppercase().booleanValue());

    //set the datatype - needed for successful custom doc searches
    String dataType = DataTypeUtil.determineFieldDataType((Class<? extends BusinessObject>) componentClass,
            attributeName);
    definition.setDataType(DataType.valueOf(dataType.toUpperCase()));

    RemotableAbstractControl.Builder control = createControl(baseDefinition);
    if (control != null) {
        definition.setControl(control);
    }

    RemotableQuickFinder.Builder qf = createQuickFinder(componentClass, attributeName);
    if (qf != null) {
        definition.setWidgets(Collections.<RemotableAbstractWidget.Builder>singletonList(qf));
    }

    return definition.build();
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:44,代码来源:DataDictionaryRemoteFieldServiceImpl.java

示例2: determineFieldDataType

import org.kuali.rice.krad.util.DataTypeUtil; //导入方法依赖的package包/类
public String determineFieldDataType(Class<? extends BusinessObject> businessObjectClass, String attributeName) {
    return DataTypeUtil.determineFieldDataType(businessObjectClass, attributeName);
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:4,代码来源:WorkflowAttributePropertyResolutionServiceImpl.java

示例3: buildRemotableFieldFromAttributeDefinition

import org.kuali.rice.krad.util.DataTypeUtil; //导入方法依赖的package包/类
/**
 * @see org.kuali.rice.krad.service.DataDictionaryRemoteFieldService#buildRemotableFieldFromAttributeDefinition(java.lang.String,
 *      java.lang.String)
 */
public RemotableAttributeField buildRemotableFieldFromAttributeDefinition(String componentClassName,
        String attributeName) {
    AttributeDefinition baseDefinition;
    Class<?> componentClass;
    // try to resolve the component name - if not possible - try to pull the definition from the app mediation service
    try {
        componentClass = (Class<? extends BusinessObject>) Class.forName(componentClassName);
        baseDefinition = getDataDictionaryService().getDataDictionary().getDictionaryObjectEntry(componentClassName)
                .getAttributeDefinition(attributeName);
    } catch (ClassNotFoundException ex) {
        throw new RiceRuntimeException("Unable to find attribute definition for attribute : " + attributeName);
    }

    RemotableAttributeField.Builder definition = RemotableAttributeField.Builder.create(baseDefinition.getName());

    definition.setLongLabel(baseDefinition.getLabel());
    definition.setShortLabel(baseDefinition.getShortLabel());
    definition.setMaxLength(baseDefinition.getMaxLength());

    if (baseDefinition.isRequired() != null) {
        definition.setRequired(baseDefinition.isRequired());
    }

    definition.setForceUpperCase(baseDefinition.getForceUppercase());

    //set the datatype - needed for successful custom doc searches
    String dataType = DataTypeUtil.determineFieldDataType((Class<? extends BusinessObject>) componentClass,
            attributeName);
    definition.setDataType(DataType.valueOf(dataType.toUpperCase()));

    RemotableAbstractControl.Builder control = createControl(baseDefinition);
    if (control != null) {
        definition.setControl(control);
    }

    RemotableQuickFinder.Builder qf = createQuickFinder(componentClass, attributeName);
    if (qf != null) {
        definition.setWidgets(Collections.<RemotableAbstractWidget.Builder>singletonList(qf));
    }

    return definition.build();
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:47,代码来源:DataDictionaryRemoteFieldServiceImpl.java


注:本文中的org.kuali.rice.krad.util.DataTypeUtil.determineFieldDataType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。