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


Java FullQualifiedName.getName方法代码示例

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


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

示例1: getEntityType

import org.apache.olingo.commons.api.edm.FullQualifiedName; //导入方法依赖的package包/类
@Override
public CsdlEntityType getEntityType(final FullQualifiedName edmFQName) throws ODataException {

	String nameSpace = edmFQName.getNamespace();
	try {
		for (CsdlSchema schema : this.rdfEdmModelProvider.getEdmMetadata().getSchemas()) {
			if (nameSpace.equals(schema.getNamespace())) {
				String entityTypeName = edmFQName.getName();
				for (CsdlEntityType entityType : schema.getEntityTypes()) {
					if (entityTypeName.equals(entityType.getName())) {
						return entityType;
					}
				}
			}
		}
	} catch (NullPointerException e) {
		log.error("NullPointerException getEntityType " + edmFQName);
		throw new ODataException("NullPointerException getEntityType " + edmFQName);
	}
	return null;
}
 
开发者ID:peterjohnlawrence,项目名称:com.inova8.odata2sparql.v4,代码行数:22,代码来源:RdfEdmProvider.java

示例2: getComplexType

import org.apache.olingo.commons.api.edm.FullQualifiedName; //导入方法依赖的package包/类
@Override
public CsdlComplexType getComplexType(final FullQualifiedName edmFQName) throws ODataException {

	String nameSpace = edmFQName.getNamespace();
	try {
		for (CsdlSchema schema : this.rdfEdmModelProvider.getEdmMetadata().getSchemas()) {
			if (nameSpace.equals(schema.getNamespace())) {
				String complexTypeName = edmFQName.getName();
				for (CsdlComplexType complexType : schema.getComplexTypes()) {
					if (complexTypeName.equals(complexType.getName())) {
						return complexType;
					}
				}
			}
		}
	} catch (NullPointerException e) {
		log.error("NullPointerException getComplexType " + edmFQName);
		throw new ODataException("NullPointerException getComplexType " + edmFQName);
	}
	return null;
}
 
开发者ID:peterjohnlawrence,项目名称:com.inova8.odata2sparql.v4,代码行数:22,代码来源:RdfEdmProvider.java

示例3: fetchNavigationProperty

import org.apache.olingo.commons.api.edm.FullQualifiedName; //导入方法依赖的package包/类
/**
 * fetch the actual navigation property from the remaning path
 * @param remainingPath
 * @param strNavProperty
 * @param sourceTypeHavingNavProp
 * @return CsdlNavigationProperty
 */
private CsdlNavigationProperty fetchNavigationProperty(String remainingPath,
    String strNavProperty, CsdlStructuralType sourceTypeHavingNavProp) {
  String[] paths = remainingPath.split("/");
  for (String path : paths) {
    FullQualifiedName fqName = null;
    if (sourceTypeHavingNavProp instanceof CsdlComplexType) {
      fqName = ((CsdlComplexType)sourceTypeHavingNavProp).getProperty(path).getTypeAsFQNObject();
    } else if (sourceTypeHavingNavProp instanceof CsdlEntityType) {
      fqName = ((CsdlEntityType)sourceTypeHavingNavProp).getProperty(path).getTypeAsFQNObject();
    }
    if (fqName != null) {
      String namespace = aliasNamespaceMap.get(fqName.getNamespace());
      fqName = namespace != null ? new FullQualifiedName(namespace, fqName.getName()) : fqName;
    }
    
    sourceTypeHavingNavProp = csdlEntityTypesMap.get(fqName) != null ? 
        csdlEntityTypesMap.get(fqName) : 
          csdlComplexTypesMap.get(fqName);
  }
  return sourceTypeHavingNavProp.getNavigationProperty(strNavProperty);
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:29,代码来源:CsdlTypeValidator.java

示例4: fetchNavigationProperty

import org.apache.olingo.commons.api.edm.FullQualifiedName; //导入方法依赖的package包/类
/**
 * Fetch the correct navigation property from the remaining path
 * @param remainingPath
 * @param strNavProperty
 * @param sourceTypeHavingNavProp
 * @return EdmNavigationProperty
 */
private EdmNavigationProperty fetchNavigationProperty(String remainingPath,
    String strNavProperty, EdmStructuredType sourceTypeHavingNavProp) {
  String[] paths = remainingPath.split("/");
  for (String path : paths) {
    FullQualifiedName fqName = null;
    if (sourceTypeHavingNavProp instanceof EdmComplexType) {
      fqName = ((EdmComplexType)sourceTypeHavingNavProp).getProperty(path).getType().getFullQualifiedName();
    } else if (sourceTypeHavingNavProp instanceof EdmEntityType) {
      fqName = ((EdmEntityType)sourceTypeHavingNavProp).getProperty(path).getType().getFullQualifiedName();
    }
    if (fqName != null) {
      String namespace = aliasNamespaceMap.get(fqName.getNamespace());
      fqName = namespace != null ? new FullQualifiedName(namespace, fqName.getName()) : fqName;
    }
    
    sourceTypeHavingNavProp = edmEntityTypesMap.containsKey(fqName) ? 
        edmEntityTypesMap.get(fqName) : 
          edmComplexTypesMap.get(fqName);
  }
  return sourceTypeHavingNavProp.getNavigationProperty(strNavProperty);
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:29,代码来源:EdmTypeValidator.java

示例5: getEntityType

import org.apache.olingo.commons.api.edm.FullQualifiedName; //导入方法依赖的package包/类
@Override
public CsdlEntityType getEntityType(FullQualifiedName entityTypeName) throws ODataException {
    CsdlEntityType entityType = new CsdlEntityType();

    switch (entityTypeName.getName()) {
        case "Car":  entityType.setName(entityTypeName.getName())
                            .setKey(Arrays.asList(new CsdlPropertyRef().setName("Id")))
                            .setProperties(Arrays.asList(
                                    new CsdlProperty().setName("Id").setType(EdmPrimitiveTypeKind.Int16.getFullQualifiedName()),
                                    new CsdlProperty().setName("Model").setType(EdmPrimitiveTypeKind.String.getFullQualifiedName())
                            ));
                     break;
    }
    return entityType;
}
 
开发者ID:sbcd90,项目名称:olingo-jersey,代码行数:16,代码来源:CarsEdmProvider.java

示例6: EdmEntityContainerImpl

import org.apache.olingo.commons.api.edm.FullQualifiedName; //导入方法依赖的package包/类
public EdmEntityContainerImpl(final Edm edm, final CsdlEdmProvider provider, final FullQualifiedName containerFQN,
    final CsdlEntityContainer entityContainer) {
  super(edm, containerFQN.getName(), entityContainer);
  this.provider = provider;
  container = entityContainer;
  entityContainerName = containerFQN;
  parentContainerName = entityContainer.getExtendsContainerFQN();
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:9,代码来源:EdmEntityContainerImpl.java

示例7: appendFunctionImports

import org.apache.olingo.commons.api.edm.FullQualifiedName; //导入方法依赖的package包/类
private void appendFunctionImports(final JsonGenerator json, final List<EdmFunctionImport> functionImports,
    final String containerNamespace) throws SerializerException, IOException {
  for (EdmFunctionImport functionImport : functionImports) {
    json.writeObjectFieldStart(functionImport.getName());

    json.writeStringField(KIND, Kind.FunctionImport.name());
    String functionFQNString;
    FullQualifiedName functionFqn = functionImport.getFunctionFqn();
    if (namespaceToAlias.get(functionFqn.getNamespace()) != null) {
      functionFQNString = namespaceToAlias.get(functionFqn.getNamespace()) + "." + functionFqn.getName();
    } else {
      functionFQNString = functionFqn.getFullQualifiedNameAsString();
    }
    json.writeStringField(DOLLAR + Kind.Function.name(), functionFQNString);

    EdmEntitySet returnedEntitySet = functionImport.getReturnedEntitySet();
    if (returnedEntitySet != null) {
      json.writeStringField(DOLLAR + Kind.EntitySet.name(), 
          containerNamespace + "." + returnedEntitySet.getName());
    }
    // Default is false and we do not write the default
    if (functionImport.isIncludeInServiceDocument()) {
      json.writeBooleanField(INCLUDE_IN_SERV_DOC, functionImport.isIncludeInServiceDocument());
    }
    appendAnnotations(json, functionImport, null);
    json.writeEndObject();
  }
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:29,代码来源:MetadataDocumentJsonSerializer.java

示例8: getAliasedFullQualifiedName

import org.apache.olingo.commons.api.edm.FullQualifiedName; //导入方法依赖的package包/类
private String getAliasedFullQualifiedName(final FullQualifiedName fqn) {
  final String name;
  if (namespaceToAlias.get(fqn.getNamespace()) != null) {
    name = namespaceToAlias.get(fqn.getNamespace()) + "." + fqn.getName();
  } else {
    name = fqn.getFullQualifiedNameAsString();
  }

  return name;
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:11,代码来源:MetadataDocumentJsonSerializer.java

示例9: appendFunctionImports

import org.apache.olingo.commons.api.edm.FullQualifiedName; //导入方法依赖的package包/类
private void appendFunctionImports(final XMLStreamWriter writer, final List<EdmFunctionImport> functionImports,
    final String containerNamespace) throws XMLStreamException {
  for (EdmFunctionImport functionImport : functionImports) {
    writer.writeStartElement(XML_FUNCTION_IMPORT);
    writer.writeAttribute(XML_NAME, functionImport.getName());

    String functionFQNString;
    FullQualifiedName functionFqn = functionImport.getFunctionFqn();
    if (namespaceToAlias.get(functionFqn.getNamespace()) != null) {
      functionFQNString = namespaceToAlias.get(functionFqn.getNamespace()) + "." + functionFqn.getName();
    } else {
      functionFQNString = functionFqn.getFullQualifiedNameAsString();
    }
    writer.writeAttribute(XML_FUNCTION, functionFQNString);

    EdmEntitySet returnedEntitySet = functionImport.getReturnedEntitySet();
    if (returnedEntitySet != null) {
      writer.writeAttribute(XML_ENTITY_SET, containerNamespace + "." + returnedEntitySet.getName());
    }
    // Default is false and we do not write the default
    if (functionImport.isIncludeInServiceDocument()) {
      writer.writeAttribute(XML_INCLUDE_IN_SERVICE_DOCUMENT, "" + functionImport.isIncludeInServiceDocument());
    }
    appendAnnotations(writer, functionImport);
    writer.writeEndElement();
  }
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:28,代码来源:MetadataDocumentXmlSerializer.java

示例10: getAliasedFullQualifiedName

import org.apache.olingo.commons.api.edm.FullQualifiedName; //导入方法依赖的package包/类
private String getAliasedFullQualifiedName(final FullQualifiedName fqn, final boolean isCollection) {
  final String name;
  if (namespaceToAlias.get(fqn.getNamespace()) != null) {
    name = namespaceToAlias.get(fqn.getNamespace()) + "." + fqn.getName();
  } else {
    name = fqn.getFullQualifiedNameAsString();
  }

  return isCollection ? "Collection(" + name + ")" : name;
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:11,代码来源:MetadataDocumentXmlSerializer.java

示例11: validateCsdlEntityTypeWithAlias

import org.apache.olingo.commons.api.edm.FullQualifiedName; //导入方法依赖的package包/类
/**
 * This validates the namespace to alias mapping
 * @param fQName
 * @return FullQualifiedName
 */
private FullQualifiedName validateCsdlEntityTypeWithAlias(FullQualifiedName fQName) {
  String namespace = aliasNamespaceMap.get(fQName.getNamespace());
  FullQualifiedName fqName = new FullQualifiedName(namespace, fQName.getName());
  if (!csdlEntityTypesMap.containsKey(fqName)) {
    throw new RuntimeException("Invalid Entity Type " + fQName);
  }
  return fqName;
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:14,代码来源:CsdlTypeValidator.java

示例12: validateCsdlComplexTypeWithAlias

import org.apache.olingo.commons.api.edm.FullQualifiedName; //导入方法依赖的package包/类
/**
 * This validates the namespace to alias mapping
 * @param aliasName
 * @return
 */
private FullQualifiedName validateCsdlComplexTypeWithAlias(FullQualifiedName aliasName) {
  String namespace = aliasNamespaceMap.get(aliasName.getNamespace());
  FullQualifiedName fqName = new FullQualifiedName(namespace, aliasName.getName());
  if (!csdlComplexTypesMap.containsKey(fqName)) {
    throw new RuntimeException("Invalid Complex BaseType " + aliasName);
  }
  return fqName;
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:14,代码来源:CsdlTypeValidator.java

示例13: validateCsdlActionsWithAlias

import org.apache.olingo.commons.api.edm.FullQualifiedName; //导入方法依赖的package包/类
/**
 * This validates the namespace to alias mapping
 * @param aliasName
 * @return FullQualifiedName
 */
private FullQualifiedName validateCsdlActionsWithAlias(FullQualifiedName aliasName) {
  String namespace = aliasNamespaceMap.get(aliasName.getNamespace());
  FullQualifiedName fqName = new FullQualifiedName(namespace, aliasName.getName());
  if (!csdlActionsMap.containsKey(fqName)) {
    throw new RuntimeException("Invalid Action " + aliasName);
  }
  return fqName;
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:14,代码来源:CsdlTypeValidator.java

示例14: validateCsdlFunctionsWithAlias

import org.apache.olingo.commons.api.edm.FullQualifiedName; //导入方法依赖的package包/类
/**
 * This validates the namespace to alias mapping
 * @param aliasName
 * @return FullQualifiedName
 */
private FullQualifiedName validateCsdlFunctionsWithAlias(FullQualifiedName aliasName) {
  String namespace = aliasNamespaceMap.get(aliasName.getNamespace());
  FullQualifiedName fqName = new FullQualifiedName(namespace, aliasName.getName());
  if (!csdlFunctionsMap.containsKey(fqName)) {
    throw new RuntimeException("Invalid Function " + aliasName);
  }
  return fqName;
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:14,代码来源:CsdlTypeValidator.java

示例15: validateEdmFunctionsWithAlias

import org.apache.olingo.commons.api.edm.FullQualifiedName; //导入方法依赖的package包/类
/**
 * This validates the namespace to alias mapping
 * @param aliasName
 * @return FullQualifiedName
 */
private FullQualifiedName validateEdmFunctionsWithAlias(FullQualifiedName aliasName) {
  String namespace = aliasNamespaceMap.get(aliasName.getNamespace());
  FullQualifiedName fqName = new FullQualifiedName(namespace, aliasName.getName());
  if (!edmFunctionsMap.containsKey(fqName)) {
    throw new RuntimeException("Invalid Function " + aliasName);
  }
  return fqName;
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:14,代码来源:EdmTypeValidator.java


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