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


Java ModelType.BOOLEAN属性代码示例

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


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

示例1: getAttributeDefinitions

public AttributeDefinition[] getAttributeDefinitions() {
	ObjectListAttributeDefinition properties = ObjectListAttributeDefinition.Builder.of(PROPERTIES, PropertyMetaDataMapper.INSTANCE.getAttributeDefinition()).build();
	ObjectListAttributeDefinition vdbimports = ObjectListAttributeDefinition.Builder.of(IMPORT_VDBS, VDBImportMapper.INSTANCE.getAttributeDefinition()).build();
	ObjectListAttributeDefinition models = ObjectListAttributeDefinition.Builder.of(MODELS, ModelMetadataMapper.INSTANCE.getAttributeDefinition()).build();
	ObjectListAttributeDefinition translators = ObjectListAttributeDefinition.Builder.of(OVERRIDE_TRANSLATORS, VDBTranslatorMetaDataMapper.INSTANCE.getAttributeDefinition()).build();
	ObjectListAttributeDefinition policies = ObjectListAttributeDefinition.Builder.of(DATA_POLICIES, DataPolicyMetadataMapper.INSTANCE.getAttributeDefinition()).build();
	
	return new AttributeDefinition[] {
			new SimpleAttributeDefinition(VDBNAME, ModelType.STRING, false),
			new SimpleAttributeDefinition(CONNECTIONTYPE, ModelType.INT, false),
			new SimpleAttributeDefinition(STATUS, ModelType.BOOLEAN, false),
			new SimpleAttributeDefinition(VERSION, ModelType.BOOLEAN, false),
			new SimpleAttributeDefinition(VDB_DESCRIPTION, ModelType.BOOLEAN, true),
			new SimpleAttributeDefinition(XML_DEPLOYMENT, ModelType.BOOLEAN, true),
			properties,
			vdbimports,
			models,
			translators,
			policies
		};
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:21,代码来源:VDBMetadataMapper.java

示例2: resolveModelType

public static ModelType resolveModelType(Class<?> javaType) {

        ModelType type = null;

        if(String.class.equals(javaType))
            type = ModelType.STRING;
        else if(Enum.class.isAssignableFrom(javaType))
            type = ModelType.STRING;
        else if(Integer.class.equals(javaType))
            type = ModelType.INT;
        else if(Long.class.equals(javaType))
            type = ModelType.LONG;
        else if(Boolean.class.equals(javaType))
            type = ModelType.BOOLEAN;
        else if(Double.class.equals(javaType))
            type = ModelType.DOUBLE;
        else if(BigDecimal.class.equals(javaType))
            type = ModelType.BIG_DECIMAL;
        else if(List.class.isAssignableFrom(javaType))
            type = ModelType.LIST;
        else if(Map.class.isAssignableFrom(javaType))
            type = ModelType.OBJECT;
        else {
            throw new RuntimeException("Failed to resolve ModelType for '"+ javaType.getName()+"'");
        }

        return type;
    }
 
开发者ID:wildfly-swarm,项目名称:wildfly-config-api,代码行数:28,代码来源:Types.java

示例3: resolveJavaTypeName

public static Optional<String> resolveJavaTypeName(ModelType modelType, ModelNode value) {

        Optional<String> result = Optional.empty();

        if(ModelType.STRING == modelType)
        {
            result = Optional.of("java.lang.String");
        }
        else if(ModelType.INT == modelType)
        {
            result = Optional.of("java.lang.Integer");
        }
        else if(ModelType.LONG == modelType)
        {
            result = Optional.of("java.lang.Long");
        }
        else if(ModelType.BOOLEAN == modelType)
        {
            result = Optional.of("java.lang.Boolean");
        }
        else if(ModelType.DOUBLE == modelType)
        {
            result = Optional.of("java.lang.Double");
        }
        else if(ModelType.BIG_DECIMAL == modelType )
        {
            result = Optional.of("java.math.BigDecimal");
        }
        else if (ModelType.OBJECT == modelType) {
            result = Optional.of("java.util.Map");
        }
        else if (ModelType.LIST == modelType) {
            result = Optional.of("java.util.List<" + resolveValueType(value) +">");
        }
        else
        {
            logger.warning("Unsupported type "+modelType);
        }

        return result;
    }
 
开发者ID:wildfly-swarm,项目名称:wildfly-config-api,代码行数:41,代码来源:Types.java


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