本文整理汇总了Java中org.raml.model.parameter.QueryParameter类的典型用法代码示例。如果您正苦于以下问题:Java QueryParameter类的具体用法?Java QueryParameter怎么用?Java QueryParameter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
QueryParameter类属于org.raml.model.parameter包,在下文中一共展示了QueryParameter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getRAMLParameters
import org.raml.model.parameter.QueryParameter; //导入依赖的package包/类
@Override
public Map<? extends String, ? extends QueryParameter> getRAMLParameters() {
Map<String, QueryParameter> parameters = new HashMap<>();
// role
QueryParameter pageParameter = new QueryParameter();
pageParameter.setDescription(
"The _role_ query parameter take a UUID of a role and may be used to add permission information to the response via the _rolePerm_ property which lists the permissions for the specified role on the element.\n"
+ "This may be useful when you are logged in as admin but you want to retrieve the editor role permissions on a given node.\n"
+ "Endpoint: */api/v1/:projectName/nodes?role=:roleUuid*");
pageParameter.setExample("24cf92691c7641158f92691c76c115ef");
pageParameter.setRequired(false);
pageParameter.setType(ParamType.STRING);
parameters.put(ROLE_PERMISSION_QUERY_PARAM_KEY, pageParameter);
return parameters;
}
示例2: getRAMLParameters
import org.raml.model.parameter.QueryParameter; //导入依赖的package包/类
@Override
public Map<? extends String, ? extends QueryParameter> getRAMLParameters() {
Map<String, QueryParameter> parameters = new HashMap<>();
// release
QueryParameter pageParameter = new QueryParameter();
pageParameter.setDescription(
"Specifies the release to be used for loading data. The latest project release will be used if this parameter is omitted.");
pageParameter.setExample("24cf92691c7641158f92691c76c115ef");
pageParameter.setRequired(false);
pageParameter.setType(ParamType.STRING);
parameters.put(RELEASE_QUERY_PARAM_KEY, pageParameter);
// version
QueryParameter versionParameter = new QueryParameter();
versionParameter.setDefaultValue("draft");
versionParameter.setDescription(
"Specifies the version to be loaded. Can either be published/draft or version number. e.g.: _0.1_, _1.0_, _draft_, _published_.");
versionParameter.setExample("1.1");
versionParameter.setRequired(false);
versionParameter.setType(ParamType.STRING);
parameters.put(VERSION_QUERY_PARAM_KEY, versionParameter);
return parameters;
}
示例3: getRAMLParameters
import org.raml.model.parameter.QueryParameter; //导入依赖的package包/类
@Override
public Map<? extends String, ? extends QueryParameter> getRAMLParameters() {
Map<String, QueryParameter> parameters = new HashMap<>();
// includeAll
QueryParameter includeAllParameter = new QueryParameter();
includeAllParameter.setDescription(
"If set to true all nodes will be included in the response. By default only container nodes are included in a navigation response.");
includeAllParameter.setExample("true");
includeAllParameter.setRequired(false);
includeAllParameter.setType(ParamType.BOOLEAN);
parameters.put(INCLUDE_ALL_QUERY_PARAM_KEY, includeAllParameter);
// maxDepth
QueryParameter maxDepthParameter = new QueryParameter();
maxDepthParameter.setDescription("Specifies the maximum depth for the requested navigation tree structure.");
maxDepthParameter.setExample("5");
maxDepthParameter.setDefaultValue("10");
maxDepthParameter.setRequired(false);
maxDepthParameter.setType(ParamType.NUMBER);
parameters.put(MAX_DEPTH_QUERY_PARAM_KEY, maxDepthParameter);
return parameters;
}
示例4: getRAMLParameters
import org.raml.model.parameter.QueryParameter; //导入依赖的package包/类
@Override
public Map<? extends String, ? extends QueryParameter> getRAMLParameters() {
Map<String, QueryParameter> parameters = new HashMap<>();
QueryParameter updateAssigned = new QueryParameter();
updateAssigned.setDescription("Update the schema version for all releases which already utilize the schema.");
updateAssigned.setDefaultValue("true");
updateAssigned.setType(ParamType.BOOLEAN);
updateAssigned.setDefaultValue("true");
parameters.put(UPDATE_ASSIGNED_RELEASES_QUERY_PARAM_KEY, updateAssigned);
QueryParameter releaseNames = new QueryParameter();
releaseNames.setDescription(
"List of release names which should be included in the update process. By default all releases which use the schema will be updated. You can thus use this parameter to only include a subset of release in the update.");
releaseNames.setType(ParamType.STRING);
releaseNames.setExample("summerRelease,winterRelease");
parameters.put(UPDATE_RELEASE_NAMES_QUERY_PARAM_KEY, releaseNames);
return parameters;
}
示例5: getRAMLParameters
import org.raml.model.parameter.QueryParameter; //导入依赖的package包/类
@Override
public Map<? extends String, ? extends QueryParameter> getRAMLParameters() {
Map<String, QueryParameter> parameters = new HashMap<>();
// lang
QueryParameter langParameter = new QueryParameter();
langParameter.setDescription(
"ISO 639-1 language tag of the language which should be loaded. Fallback handling can be applied by specifying multiple languages in a comma-separated list. The first matching language will be returned. If omitted or the requested language is not available then the _defaultLanguage_ as configured in _mesh.yml_ will be returned.");
langParameter.setExample("en,de");
langParameter.setRequired(false);
langParameter.setType(ParamType.STRING);
parameters.put(LANGUAGES_QUERY_PARAM_KEY, langParameter);
// resolveLinks
QueryParameter resolveLinksParameter = new QueryParameter();
resolveLinksParameter.setDescription(
"The resolve links parameter can be set to either _short_, _medium_ or _full_. Stored mesh links will automatically be resolved and replaced by the resolved webroot link. With the parameter set the _path_ property as well as the _languagesPath_ property (for available language variants) will be included in the response. Gentics Mesh links in any HTML-typed field will automatically be resolved and replaced by the resolved link:features.html#_link_resolving[WebRoot path]. No resolving occurs if no link has been specified.");
resolveLinksParameter.setExample("medium");
resolveLinksParameter.setRequired(false);
resolveLinksParameter.setType(ParamType.STRING);
parameters.put(RESOLVE_LINKS_QUERY_PARAM_KEY, resolveLinksParameter);
return parameters;
}
示例6: getRAMLParameters
import org.raml.model.parameter.QueryParameter; //导入依赖的package包/类
@Override
public Map<? extends String, ? extends QueryParameter> getRAMLParameters() {
Map<String, QueryParameter> parameters = new HashMap<>();
// page
QueryParameter pageParameter = new QueryParameter();
pageParameter.setDefaultValue(String.valueOf(DEFAULT_PAGE));
pageParameter.setDescription("Number of page to be loaded.");
pageParameter.setExample("42");
pageParameter.setRequired(false);
pageParameter.setType(ParamType.NUMBER);
parameters.put(PAGE_PARAMETER_KEY, pageParameter);
// perPage
QueryParameter perPageParameter = new QueryParameter();
perPageParameter.setDefaultValue(String.valueOf(DEFAULT_PAGE_SIZE));
perPageParameter.setDescription("Number of elements per page.");
perPageParameter.setExample("42");
perPageParameter.setRequired(false);
perPageParameter.setType(ParamType.NUMBER);
parameters.put(PER_PAGE_PARAMETER_KEY, perPageParameter);
return parameters;
}
示例7: addQueryParameters
import org.raml.model.parameter.QueryParameter; //导入依赖的package包/类
private void addQueryParameters(Action action, DCMethod method)
{
Map<String, QueryParameter> params = action.getQueryParameters();
for (String paramName : params.keySet())
{
QueryParameter param = params.get(paramName);
DCMethodParameter methodParam = new DCMethodParameter();
methodParam.setPathParam(false);
methodParam.setName(paramName);
ParamType paramType = param.getType();
String type = paramType != null? paramType.name(): "string";
Class javaType = typeMapping.get(type);
if (javaType==null)
{
javaType = String.class;
methodParam.setJavaType(javaType.getName());
}
method.addParam(methodParam);
}
}
示例8: getRAMLParameters
import org.raml.model.parameter.QueryParameter; //导入依赖的package包/类
@Override
public Map<? extends String, ? extends QueryParameter> getRAMLParameters() {
Map<String, QueryParameter> parameters = new HashMap<>();
// token
QueryParameter pageParameter = new QueryParameter();
pageParameter.setDescription(
"Token code which can be used to update the user even if the connection is not authenticated. This can be used to implement a password recovery feature.");
pageParameter.setExample(TokenUtil.randomToken());
pageParameter.setRequired(false);
pageParameter.setType(ParamType.STRING);
parameters.put(TOKEN_PARAMETER_KEY, pageParameter);
return parameters;
}
示例9: getRAMLParameters
import org.raml.model.parameter.QueryParameter; //导入依赖的package包/类
@Override
public Map<? extends String, ? extends QueryParameter> getRAMLParameters() {
Map<String, QueryParameter> parameters = new HashMap<>();
// recursive
QueryParameter recursiveParameter = new QueryParameter();
recursiveParameter.setDefaultValue("false");
recursiveParameter.setDescription("Specifiy whether the invoked action should be applied recursively.");
recursiveParameter.setExample("true");
recursiveParameter.setRequired(false);
recursiveParameter.setType(ParamType.BOOLEAN);
parameters.put(RECURSIVE_PARAMETER_KEY, recursiveParameter);
return parameters;
}
示例10: getRAMLParameters
import org.raml.model.parameter.QueryParameter; //导入依赖的package包/类
@Override
public Map<? extends String, ? extends QueryParameter> getRAMLParameters() {
Map<String, QueryParameter> parameters = new HashMap<>();
// recursive
QueryParameter recursiveParameter = new QueryParameter();
recursiveParameter.setDefaultValue("false");
recursiveParameter.setDescription("Specifiy whether deletion should also be applied recursively");
recursiveParameter.setExample("true");
recursiveParameter.setRequired(false);
recursiveParameter.setType(ParamType.BOOLEAN);
parameters.put(RECURSIVE_PARAMETER_KEY, recursiveParameter);
return parameters;
}
示例11: renderParameterTable
import org.raml.model.parameter.QueryParameter; //导入依赖的package包/类
private String renderParameterTable(Class<?> clazz) throws Exception {
System.out.println(clazz.getName());
AbstractParameters parameterObj = (AbstractParameters) clazz.newInstance();
Map<? extends String, ? extends QueryParameter> ramlParameters = parameterObj.getRAMLParameters();
Map<String, Object> context = new HashMap<>();
List<Map<String, String>> list = new ArrayList<>();
for (Entry<? extends String, ? extends QueryParameter> entry : ramlParameters.entrySet()) {
String name = entry.getKey();
QueryParameter value = entry.getValue();
Map<String, String> paramDescription = new HashMap<>();
paramDescription.put("name", name);
paramDescription.put("type", value.getType().name().toLowerCase());
paramDescription.put("default", value.getDefaultValue());
paramDescription.put("example", value.getExample());
paramDescription.put("description", value.getDescription());
paramDescription.put("required", String.valueOf(value.isRequired()));
list.add(paramDescription);
}
// Order list by field parameter name
Collections.sort(list, new Comparator<Map<String, String>>() {
@Override
public int compare(Map<String, String> a1, Map<String, String> a2) {
return a1.get("name").compareTo(a2.get("name"));
}
});
context.put("entries", list);
context.put("name", parameterObj.getName());
return renderTable(context, paramTableTemplateSource);
}
示例12: apply
import org.raml.model.parameter.QueryParameter; //导入依赖的package包/类
@Override
public void apply(QueryParameter param, ResourceClassBuilder resourceClassBuilder) {
resourceClassBuilder.getApiClass().withMethod(
new AddQueryParamMethod(param, param.getDisplayName(), resourceClassBuilder.getReq(),
resourceClassBuilder.getApiClass()));
resourceClassBuilder.getDefaultsMethod().forParamDefaults(param.getDisplayName(), param);
}
示例13: getParameters
import org.raml.model.parameter.QueryParameter; //导入依赖的package包/类
@Override
protected Map<String, ? extends AbstractParam> getParameters() {
if (!expectation().hasValidAction())
return new HashMap<>();
Map<String, QueryParameter> parameters = expectation().getAction().get().getQueryParameters();
return parameters == null ? new HashMap<>() : parameters;
}
示例14: queryTokenParameters
import org.raml.model.parameter.QueryParameter; //导入依赖的package包/类
private Map<String, QueryParameter> queryTokenParameters() {
Map<String, QueryParameter> parameters = new HashMap<>();
QueryParameter parameter = new QueryParameter();
parameter.setRequired(true);
parameter.setRepeat(false);
parameter.setType(ParamType.INTEGER);
parameters.put("token", parameter);
return parameters;
}
示例15: queryParameter
import org.raml.model.parameter.QueryParameter; //导入依赖的package包/类
private Map<String, QueryParameter> queryParameter(boolean required, boolean repeatable) {
QueryParameter parameter = new QueryParameter();
parameter.setRequired(required);
parameter.setRepeat(repeatable);
parameter.setType(ParamType.INTEGER);
Map<String, QueryParameter> parameters = new HashMap<>();
parameters.put("ttl", parameter);
return parameters;
}