本文整理了Java中org.apache.juneau.http.annotation.Query
类的一些代码示例,展示了Query
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query
类的具体详情如下:
包路径:org.apache.juneau.http.annotation.Query
类名称:Query
暂无
代码示例来源:origin: org.apache.juneau/juneau-examples-rest
@RemoteMethod(method=GET, path="/pet/findByTags")
@Deprecated
public Collection<Pet> findPetsByTags(
@Query(
name="tags",
description="Tags to filter by",
required=true,
example="['tag1','tag2']"
)
String[] tags
) throws InvalidTag, NotAcceptable;
代码示例来源:origin: org.apache.juneau/juneau-marshall
/**
* Returns <jk>true</jk> if the specified annotation contains all default values.
*
* @param a The annotation to check.
* @return <jk>true</jk> if the specified annotation contains all default values.
*/
public static boolean empty(Query a) {
if (a == null)
return true;
return
allEmpty(a.description(), a._default(), a.example(), a.api())
&& allEmpty(a.name(), a.value(), a.type(), a.format(), a.pattern(), a.collectionFormat(), a.maximum(), a.minimum(), a.multipleOf())
&& allFalse(a.allowEmptyValue(), a.exclusiveMaximum(), a.exclusiveMinimum(), a.required(), a.uniqueItems())
&& allMinusOne(a.maxLength(), a.minLength(), a.maxItems(), a.minItems())
&& empty(a.items());
}
代码示例来源:origin: org.apache.juneau/juneau-marshall
HttpPartSchemaBuilder apply(Query a) {
name(a.value());
name(a.name());
required(a.required());
type(a.type());
format(a.format());
allowEmptyValue(a.allowEmptyValue());
items(a.items());
collectionFormat(a.collectionFormat());
_default(a._default().length == 0 ? null : joinnl(a._default()));
maximum(HttpPartSchema.toNumber(a.maximum()));
exclusiveMaximum(a.exclusiveMaximum());
minimum(HttpPartSchema.toNumber(a.minimum()));
exclusiveMinimum(a.exclusiveMinimum());
maxLength(a.maxLength());
minLength(a.minLength());
pattern(a.pattern());
maxItems(a.maxItems());
minItems(a.minItems());
uniqueItems(a.uniqueItems());
_enum(HttpPartSchema.toSet(a._enum()));
multipleOf(HttpPartSchema.toNumber(a.multipleOf()));
skipIfEmpty(a.skipIfEmpty());
parser(a.parser());
serializer(a.serializer());
return this;
}
代码示例来源:origin: org.apache.juneau/juneau-rest-server
} else if (a instanceof Query) {
Query q = (Query)a;
if (q._default().length > 0)
defaultQuery.put(firstNonEmpty(q.name(), q.value()), parseAnything(joinnl(q._default())));
} else if (a instanceof FormData) {
FormData f = (FormData)a;
代码示例来源:origin: apache/juneau
} else if (a instanceof Query) {
Query q = (Query)a;
if (q._default().length > 0)
defaultQuery.put(firstNonEmpty(q.name(), q.value()), parseAnything(joinnl(q._default())));
} else if (a instanceof FormData) {
FormData f = (FormData)a;
代码示例来源:origin: apache/juneau
/**
* Returns <jk>true</jk> if the specified annotation contains all default values.
*
* @param a The annotation to check.
* @return <jk>true</jk> if the specified annotation contains all default values.
*/
public static boolean empty(Query a) {
if (a == null)
return true;
return
allEmpty(a.description(), a._default(), a.example(), a.api())
&& allEmpty(a.name(), a.value(), a.type(), a.format(), a.pattern(), a.collectionFormat(), a.maximum(), a.minimum(), a.multipleOf())
&& allFalse(a.allowEmptyValue(), a.exclusiveMaximum(), a.exclusiveMinimum(), a.required(), a.uniqueItems())
&& allMinusOne(a.maxLength(), a.minLength(), a.maxItems(), a.minItems())
&& empty(a.items());
}
代码示例来源:origin: apache/juneau
HttpPartSchemaBuilder apply(Query a) {
name(a.value());
name(a.name());
required(a.required());
type(a.type());
format(a.format());
allowEmptyValue(a.allowEmptyValue());
items(a.items());
collectionFormat(a.collectionFormat());
_default(a._default().length == 0 ? null : joinnl(a._default()));
maximum(HttpPartSchema.toNumber(a.maximum()));
exclusiveMaximum(a.exclusiveMaximum());
minimum(HttpPartSchema.toNumber(a.minimum()));
exclusiveMinimum(a.exclusiveMinimum());
maxLength(a.maxLength());
minLength(a.minLength());
pattern(a.pattern());
maxItems(a.maxItems());
minItems(a.minItems());
uniqueItems(a.uniqueItems());
_enum(HttpPartSchema.toSet(a._enum()));
multipleOf(HttpPartSchema.toNumber(a.multipleOf()));
skipIfEmpty(a.skipIfEmpty());
parser(a.parser());
serializer(a.serializer());
return this;
}
代码示例来源:origin: apache/juneau
@Query("Q")
public static class SB03 extends LinkedList<String> {
private static final long serialVersionUID = 1L;
}
@RestMethod
代码示例来源:origin: apache/juneau
} else if (a instanceof Query) {
Query q = (Query)a;
if (q._default().length > 0)
defaultQuery.put(firstNonEmpty(q.name(), q.value()), parseAnything(joinnl(q._default())));
} else if (a instanceof FormData) {
FormData f = (FormData)a;
代码示例来源:origin: apache/juneau
/**
* Returns <jk>true</jk> if the specified annotation contains all default values.
*
* @param a The annotation to check.
* @return <jk>true</jk> if the specified annotation contains all default values.
*/
public static boolean empty(Query a) {
if (a == null)
return true;
return
allEmpty(a.description(), a._default(), a.example(), a.api())
&& allEmpty(a.name(), a.value(), a.type(), a.format(), a.pattern(), a.collectionFormat(), a.maximum(), a.minimum(), a.multipleOf())
&& allFalse(a.allowEmptyValue(), a.exclusiveMaximum(), a.exclusiveMinimum(), a.required(), a.uniqueItems())
&& allMinusOne(a.maxLength(), a.minLength(), a.maxItems(), a.minItems())
&& empty(a.items());
}
代码示例来源:origin: apache/juneau
HttpPartSchemaBuilder apply(Query a) {
name(a.value());
name(a.name());
required(a.required());
type(a.type());
format(a.format());
allowEmptyValue(a.allowEmptyValue());
items(a.items());
collectionFormat(a.collectionFormat());
_default(a._default().length == 0 ? null : joinnl(a._default()));
maximum(HttpPartSchema.toNumber(a.maximum()));
exclusiveMaximum(a.exclusiveMaximum());
minimum(HttpPartSchema.toNumber(a.minimum()));
exclusiveMinimum(a.exclusiveMinimum());
maxLength(a.maxLength());
minLength(a.minLength());
pattern(a.pattern());
maxItems(a.maxItems());
minItems(a.minItems());
uniqueItems(a.uniqueItems());
_enum(HttpPartSchema.toSet(a._enum()));
multipleOf(HttpPartSchema.toNumber(a.multipleOf()));
skipIfEmpty(a.skipIfEmpty());
parser(a.parser());
serializer(a.serializer());
return this;
}
代码示例来源:origin: apache/juneau
@RemoteMethod(method=GET, path="/pet/findByTags")
@Deprecated
public Collection<Pet> findPetsByTags(
@Query(
name="tags",
description="Tags to filter by",
required=true,
example="['tag1','tag2']"
)
String[] tags
) throws InvalidTag, NotAcceptable;
代码示例来源:origin: org.apache.juneau/juneau-rest-server
private ObjectMap merge(ObjectMap om, Query a) throws ParseException {
if (empty(a))
return om;
om = newMap(om);
if (a.api().length > 0)
om.putAll(parseMap(a.api()));
return om
.appendSkipFalse("allowEmptyValue", a.allowEmptyValue())
.appendSkipEmpty("collectionFormat", a.collectionFormat())
.appendSkipEmpty("default", joinnl(a._default()))
.appendSkipEmpty("description", resolve(a.description()))
.appendSkipEmpty("enum", toSet(a._enum()))
.appendSkipEmpty("x-example", resolve(a.example()))
.appendSkipFalse("exclusiveMaximum", a.exclusiveMaximum())
.appendSkipFalse("exclusiveMinimum", a.exclusiveMinimum())
.appendSkipEmpty("format", a.format())
.appendSkipEmpty("items", merge(om.getObjectMap("items"), a.items()))
.appendSkipEmpty("maximum", a.maximum())
.appendSkipMinusOne("maxItems", a.maxItems())
.appendSkipMinusOne("maxLength", a.maxLength())
.appendSkipEmpty("minimum", a.minimum())
.appendSkipMinusOne("minItems", a.minItems())
.appendSkipMinusOne("minLength", a.minLength())
.appendSkipEmpty("multipleOf", a.multipleOf())
.appendSkipEmpty("pattern", a.pattern())
.appendSkipFalse("required", a.required())
.appendSkipEmpty("type", a.type())
.appendSkipFalse("uniqueItems", a.uniqueItems())
;
}
代码示例来源:origin: apache/juneau
@Query(
name="Q",
api={
"description: 'a\nb',",
"type:'string'"
}
)
public static class SA02 {
public SA02(String x) {}
}
@RestMethod
代码示例来源:origin: apache/juneau
private ObjectMap merge(ObjectMap om, Query a) throws ParseException {
if (empty(a))
return om;
om = newMap(om);
if (a.api().length > 0)
om.putAll(parseMap(a.api()));
return om
.appendSkipFalse("allowEmptyValue", a.allowEmptyValue())
.appendSkipEmpty("collectionFormat", a.collectionFormat())
.appendSkipEmpty("default", joinnl(a._default()))
.appendSkipEmpty("description", resolve(a.description()))
.appendSkipEmpty("enum", toSet(a._enum()))
.appendSkipEmpty("x-example", resolve(a.example()))
.appendSkipFalse("exclusiveMaximum", a.exclusiveMaximum())
.appendSkipFalse("exclusiveMinimum", a.exclusiveMinimum())
.appendSkipEmpty("format", a.format())
.appendSkipEmpty("items", merge(om.getObjectMap("items"), a.items()))
.appendSkipEmpty("maximum", a.maximum())
.appendSkipMinusOne("maxItems", a.maxItems())
.appendSkipMinusOne("maxLength", a.maxLength())
.appendSkipEmpty("minimum", a.minimum())
.appendSkipMinusOne("minItems", a.minItems())
.appendSkipMinusOne("minLength", a.minLength())
.appendSkipEmpty("multipleOf", a.multipleOf())
.appendSkipEmpty("pattern", a.pattern())
.appendSkipFalse("required", a.required())
.appendSkipEmpty("type", a.type())
.appendSkipFalse("uniqueItems", a.uniqueItems())
;
}
代码示例来源:origin: apache/juneau
@Query("Q")
public static class SB02 {
public String f1;
}
@RestMethod
代码示例来源:origin: apache/juneau
private ObjectMap merge(ObjectMap om, Query a) throws ParseException {
if (empty(a))
return om;
om = newMap(om);
if (a.api().length > 0)
om.putAll(parseMap(a.api()));
return om
.appendSkipFalse("allowEmptyValue", a.allowEmptyValue())
.appendSkipEmpty("collectionFormat", a.collectionFormat())
.appendSkipEmpty("default", joinnl(a._default()))
.appendSkipEmpty("description", resolve(a.description()))
.appendSkipEmpty("enum", toSet(a._enum()))
.appendSkipEmpty("x-example", resolve(a.example()))
.appendSkipFalse("exclusiveMaximum", a.exclusiveMaximum())
.appendSkipFalse("exclusiveMinimum", a.exclusiveMinimum())
.appendSkipEmpty("format", a.format())
.appendSkipEmpty("items", merge(om.getObjectMap("items"), a.items()))
.appendSkipEmpty("maximum", a.maximum())
.appendSkipMinusOne("maxItems", a.maxItems())
.appendSkipMinusOne("maxLength", a.maxLength())
.appendSkipEmpty("minimum", a.minimum())
.appendSkipMinusOne("minItems", a.minItems())
.appendSkipMinusOne("minLength", a.minLength())
.appendSkipEmpty("multipleOf", a.multipleOf())
.appendSkipEmpty("pattern", a.pattern())
.appendSkipFalse("required", a.required())
.appendSkipEmpty("type", a.type())
.appendSkipFalse("uniqueItems", a.uniqueItems())
;
}
代码示例来源:origin: apache/juneau
@Query(
name="Q",
description= {"a","b"},
type="string"
)
public static class SA01 {
public SA01(String x) {}
}
@RestMethod
代码示例来源:origin: apache/juneau
@Query(name="Q", example={"{f1:'a'}"})
public static class SC01 {
public String f1;
}
@RestMethod
代码示例来源:origin: apache/juneau
@Query(
name="Q",
api={
"description: 'b\nc',",
"type:'string'"
},
description= {"a","b"},
type="string"
)
public static class SA03 {
public SA03(String x) {}
}
@RestMethod
内容来源于网络,如有侵权,请联系作者删除!