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


Java EdmProperty.newBuilder方法代码示例

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


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

示例1: getComplexTypeProperties

import org.odata4j.edm.EdmProperty; //导入方法依赖的package包/类
private static List<EdmProperty.Builder> getComplexTypeProperties(
        String nodeId,
        String name,
        List<OEntity> complexPropEntities,
        List<OEntity> complexEntities) {

    List<EdmProperty.Builder> list = new ArrayList<EdmProperty.Builder>();
    for (OEntity oe : complexPropEntities) {
        if (!name.equals(
                oe.getProperty(ComplexTypeProperty.P_COMPLEXTYPE_NAME.getName()).getValue().toString())) {
            continue;
        }
        Object propValue = oe.getProperty(ComplexTypeProperty.P_NAME.getName().toString()).getValue();
        EdmProperty.Builder property = EdmProperty.newBuilder((String) propValue);
        setTypeProperty(nodeId, ComplexTypeProperty.P_TYPE.getName().toString(), oe, complexEntities, property);
        propValue = oe.getProperty(ComplexTypeProperty.P_NULLABLE.getName().toString());
        if (propValue != null) {
            propValue = ((OProperty<?>) propValue).getValue();
            property.setNullable((Boolean) propValue);
        }
        propValue = oe.getProperty(ComplexTypeProperty.P_DEFAULT_VALUE.getName().toString()).getValue();
        property.setDefaultValue((String) propValue);
        propValue = oe.getProperty(ComplexTypeProperty.P_COLLECTION_KIND.getName().toString()).getValue();
        if (propValue == null || "None".equals(propValue)) {
            property.setCollectionKind(CollectionKind.NONE);
        } else {
            property.setCollectionKind(CollectionKind.valueOf((String) propValue));
        }
        list.add(property);
    }
    return list;
}
 
开发者ID:personium,项目名称:personium-core,代码行数:33,代码来源:CtlSchema.java

示例2: edmPropertyMimeType

import org.odata4j.edm.EdmProperty; //导入方法依赖的package包/类
@Test
public void edmPropertyMimeType() {
  EdmProperty.Builder builder = EdmProperty.newBuilder("Name");
  EdmProperty property = builder.setMimeType(MIMETYPE).setType(EdmSimpleType.STRING).build();
  assertEquals(MIMETYPE, property.getMimeType());

}
 
开发者ID:teiid,项目名称:oreva,代码行数:8,代码来源:EdmPropertyTest.java

示例3: getProperties

import org.odata4j.edm.EdmProperty; //导入方法依赖的package包/类
private static List<EdmProperty.Builder> getProperties(
        String nodeId,
        String name,
        List<OEntity> propEntities,
        List<OEntity> complexEntities) {

    List<EdmProperty.Builder> list = new ArrayList<EdmProperty.Builder>();
    for (OEntity oe : propEntities) {
        if (!name.equals(oe.getProperty(Property.P_ENTITYTYPE_NAME.getName()).getValue().toString())) {
            continue;
        }
        Object propValue = oe.getProperty(Property.P_NAME.getName().toString()).getValue();
        EdmProperty.Builder property = EdmProperty.newBuilder((String) propValue);
        setTypeProperty(nodeId, Property.P_TYPE.getName().toString(), oe, complexEntities, property);
        propValue = oe.getProperty(Property.P_NULLABLE.getName().toString());
        if (propValue != null) {
            propValue = ((OProperty<?>) propValue).getValue();
            property.setNullable((Boolean) propValue);
        }

        propValue = oe.getProperty(Property.P_IS_DECLARED.getName().toString());
        if (propValue != null) {
            propValue = ((OProperty<?>) propValue).getValue();
            if (!(Boolean) propValue) {
                List<EdmAnnotation<?>> isDecleard = createIsDecleardAnnotation(propValue.toString());
                property.setAnnotations(isDecleard);
            }
        }

        propValue = oe.getProperty(Property.P_DEFAULT_VALUE.getName().toString()).getValue();
        property.setDefaultValue((String) propValue);
        propValue = oe.getProperty(Property.P_COLLECTION_KIND.getName().toString()).getValue();
        if (propValue == null || "None".equals(propValue)) {
            property.setCollectionKind(CollectionKind.NONE);
        } else {
            property.setCollectionKind(CollectionKind.valueOf((String) propValue));
        }
        // TODO IsKey、UniqueKeyはPCSの拡張項目のため、EdmPropertyでは扱えない。
        list.add(property);
    }
    return list;
}
 
开发者ID:personium,项目名称:personium-core,代码行数:43,代码来源:CtlSchema.java

示例4: edmPropertyConcurrencyMode

import org.odata4j.edm.EdmProperty; //导入方法依赖的package包/类
@Test
public void edmPropertyConcurrencyMode() {
  EdmProperty.Builder builder = EdmProperty.newBuilder("Name");
  EdmProperty property = builder.setConcurrencyMode(CONCURRENCYMODE).setType(EdmSimpleType.STRING).build();
  assertEquals(CONCURRENCYMODE, property.getConcurrencyMode());
}
 
开发者ID:teiid,项目名称:oreva,代码行数:7,代码来源:EdmPropertyTest.java

示例5: edmPropertyFCNsUri

import org.odata4j.edm.EdmProperty; //导入方法依赖的package包/类
@Test
public void edmPropertyFCNsUri() {
  EdmProperty.Builder builder = EdmProperty.newBuilder("Name");
  EdmProperty property = builder.setFcNsUri(NSURI).setType(EdmSimpleType.STRING).build();
  assertEquals(NSURI, property.getFcNsUri());
}
 
开发者ID:teiid,项目名称:oreva,代码行数:7,代码来源:EdmPropertyTest.java

示例6: edmPropertyFCNsPrefix

import org.odata4j.edm.EdmProperty; //导入方法依赖的package包/类
@Test
public void edmPropertyFCNsPrefix() {
  EdmProperty.Builder builder = EdmProperty.newBuilder("Name");
  EdmProperty property = builder.setFcNsPrefix(NSPREFIX).setType(EdmSimpleType.STRING).build();
  assertEquals(NSPREFIX, property.getFcNsPrefix());
}
 
开发者ID:teiid,项目名称:oreva,代码行数:7,代码来源:EdmPropertyTest.java


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