本文整理匯總了Java中org.apache.olingo.odata2.api.uri.info.GetComplexPropertyUriInfo類的典型用法代碼示例。如果您正苦於以下問題:Java GetComplexPropertyUriInfo類的具體用法?Java GetComplexPropertyUriInfo怎麽用?Java GetComplexPropertyUriInfo使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
GetComplexPropertyUriInfo類屬於org.apache.olingo.odata2.api.uri.info包,在下文中一共展示了GetComplexPropertyUriInfo類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: readEntityComplexProperty
import org.apache.olingo.odata2.api.uri.info.GetComplexPropertyUriInfo; //導入依賴的package包/類
@Override
public ODataResponse readEntityComplexProperty(GetComplexPropertyUriInfo uri_info, String content_type)
throws ODataException
{
EdmProperty target = uri_info.getPropertyPath().get(uri_info.getPropertyPath().size() - 1);
String entityTarget = uri_info.getTargetEntitySet().getName();
Map<String, Object> values = Model.getEntitySet(entityTarget).getComplexProperty(uri_info);
return EntityProvider.writeProperty(content_type, target, values);
}
示例2: getComplexProperty
import org.apache.olingo.odata2.api.uri.info.GetComplexPropertyUriInfo; //導入依賴的package包/類
public Map<String, Object> getComplexProperty(
GetComplexPropertyUriInfo uri_info) throws ODataException
{
KeyPredicate startKP = uri_info.getKeyPredicates().get(0);
EdmProperty target
= uri_info.getPropertyPath()
.get(uri_info.getPropertyPath().size() - 1);
T t = Navigator.<T>navigate(uri_info.getStartEntitySet(), startKP,
uri_info.getNavigationSegments(), null);
return t.getComplexProperty(target.getName());
}
示例3: readEntityComplexProperty
import org.apache.olingo.odata2.api.uri.info.GetComplexPropertyUriInfo; //導入依賴的package包/類
@Override
public ODataResponse readEntityComplexProperty(final GetComplexPropertyUriInfo uriInfo, final String contentType)
throws ODataException {
Object data = retrieveData(
uriInfo.getStartEntitySet(),
uriInfo.getKeyPredicates(),
uriInfo.getFunctionImport(),
mapFunctionParameters(uriInfo.getFunctionImportParameters()),
uriInfo.getNavigationSegments());
if (data == null) {
throw new ODataNotFoundException(ODataNotFoundException.ENTITY);
}
final List<EdmProperty> propertyPath = uriInfo.getPropertyPath();
final EdmProperty property = propertyPath.get(propertyPath.size() - 1);
final Object value = property.isSimple() ?
property.getMapping() == null || property.getMapping().getMediaResourceMimeTypeKey() == null ?
getPropertyValue(data, propertyPath) : getSimpleTypeValueMap(data, propertyPath) :
getStructuralTypeValueMap(getPropertyValue(data, propertyPath), (EdmStructuralType) property.getType());
ODataContext context = getContext();
final int timingHandle = context.startRuntimeMeasurement("EntityProvider", "writeProperty");
final ODataResponse response = EntityProvider.writeProperty(contentType, property, value);
context.stopRuntimeMeasurement(timingHandle);
return ODataResponse.fromResponse(response).eTag(constructETag(uriInfo.getTargetEntitySet(), data)).build();
}
示例4: readEntityComplexProperty
import org.apache.olingo.odata2.api.uri.info.GetComplexPropertyUriInfo; //導入依賴的package包/類
@Override
public ODataResponse readEntityComplexProperty(final GetComplexPropertyUriInfo uriInfo, final String contentType)
throws ODataException {
Object data = retrieveData(
uriInfo.getStartEntitySet(),
uriInfo.getKeyPredicates(),
uriInfo.getFunctionImport(),
mapFunctionParameters(uriInfo.getFunctionImportParameters()),
uriInfo.getNavigationSegments());
// if (!appliesFilter(data, uriInfo.getFilter()))
if (data == null) {
throw new ODataNotFoundException(ODataNotFoundException.ENTITY);
}
final List<EdmProperty> propertyPath = uriInfo.getPropertyPath();
final EdmProperty property = propertyPath.get(propertyPath.size() - 1);
final Object value = property.isSimple() ?
property.getMapping() == null || property.getMapping().getMediaResourceMimeTypeKey() == null ?
getPropertyValue(data, propertyPath) : getSimpleTypeValueMap(data, propertyPath) :
getStructuralTypeValueMap(getPropertyValue(data, propertyPath), (EdmStructuralType) property.getType());
ODataContext context = getContext();
final int timingHandle = context.startRuntimeMeasurement("EntityProvider", "writeProperty");
final ODataResponse response = EntityProvider.writeProperty(contentType, property, value);
context.stopRuntimeMeasurement(timingHandle);
return ODataResponse.fromResponse(response).eTag(constructETag(uriInfo.getTargetEntitySet(), data)).build();
}
示例5: readEntitySimpleProperty
import org.apache.olingo.odata2.api.uri.info.GetComplexPropertyUriInfo; //導入依賴的package包/類
@Override
public ODataResponse readEntitySimpleProperty(final GetSimplePropertyUriInfo uriInfo, final String contentType)
throws ODataException {
return readEntityComplexProperty((GetComplexPropertyUriInfo) uriInfo, contentType);
}
示例6: readEntityComplexProperty
import org.apache.olingo.odata2.api.uri.info.GetComplexPropertyUriInfo; //導入依賴的package包/類
/**
* @see EntityComplexPropertyProcessor
*/
@Override
public ODataResponse readEntityComplexProperty(final GetComplexPropertyUriInfo uriInfo, final String contentType)
throws ODataException {
throw new ODataNotImplementedException();
}
示例7: readEntityComplexProperty
import org.apache.olingo.odata2.api.uri.info.GetComplexPropertyUriInfo; //導入依賴的package包/類
/**
* Reads a complex property of an entity.
* @param uriInfo information about the request URI
* @param contentType the content type of the response
* @return a {@link ODataResponse} object
* @throws ODataException
*/
ODataResponse readEntityComplexProperty(GetComplexPropertyUriInfo uriInfo, String contentType) throws ODataException;