protected MCollectionType readCollectionType(JsonObject items, SwaggerExtension ex) { return new MCollectionType(readType(items, ex)); }
protected void addQueryResponse(RestdContext ctx, SqlCommand sc, FuncActionBuilder action, MApiOperationBuilder mo) { //todo: MApiResponseBuilder r = new MApiResponseBuilder(); r.setStatus(200); r.setType(new MCollectionType(MDictionaryType.INSTANCE)); r.setDescription("Success"); /* MApiHeaderBuilder header = new MApiHeaderBuilder(); header.setName("X-Total-Count"); header.setType(MSimpleTypes.BIGINT); header.setDescription("The total count of query records."); r.addHeader(header); */ mo.addResponse(r); }
return new MCollectionType(elementType); return new MCollectionType(MObjectType.TYPE); throw new IllegalStateException("Invalid array type '" + typeName + "'"); return new MCollectionType(resolveType(api, elementType));
return new MCollectionType(root.getMType(declaringType, type.getComponentType(), null, context)); return new MCollectionType(elementType);
private static MType doResolveType(MetaApi api, MType type) { if(type instanceof MUnresolvedTypeRef) { return resolveType(api, ((MUnresolvedTypeRef) type).getRefTypeName()); } if(type instanceof MCollectionType) { return new MCollectionType(doResolveType(api, type.asCollectionType().getElementType())); } if(type instanceof MDictionaryType) { return new MDictionaryType(type.asDictionaryType().getKeyType(), doResolveType(api, type.asDictionaryType().getValueType())); } throw new IllegalStateException("Unsupported type '" + type + "'"); }
private MApiResponseBuilder newModelQueryResponse(RestdModel model) { MApiResponseBuilder r = new MApiResponseBuilder(); r.setStatus(200); r.setType(new MCollectionType(new MComplexTypeRef(model.getName()))); r.setDescription("Success"); MApiHeaderBuilder header = new MApiHeaderBuilder(); header.setName("X-Total-Count"); header.setType(MSimpleTypes.BIGINT); header.setDescription("The total count of query records."); r.addHeader(header); return r; }
p.setExpandable(r.getExpandable()); if(r.isOneToMany() || r.isManyToMany()) { p.setType(new MCollectionType(new MComplexTypeRef(r.getTargetEntity()))); }else { p.setType(new MComplexTypeRef(r.getTargetEntity()));
p.setType(new MCollectionType(new MComplexTypeRef(targetEntity.getEntityName()))); }else{ p.setType(new MComplexTypeRef(targetEntity.getEntityName()));