本文整理汇总了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;
}
示例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());
}
示例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;
}
示例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());
}
示例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());
}
示例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());
}