You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@juneau.apache.org by ja...@apache.org on 2020/07/15 20:54:29 UTC
[juneau] branch master updated: org.apache.juneau.http.annotation
tests.
This is an automated email from the ASF dual-hosted git repository.
jamesbognar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/juneau.git
The following commit(s) were added to refs/heads/master by this push:
new fa7f845 org.apache.juneau.http.annotation tests.
fa7f845 is described below
commit fa7f8454106fdbfaac3be4d8fa25be542c1f7cc2
Author: JamesBognar <ja...@salesforce.com>
AuthorDate: Wed Jul 15 16:54:24 2020 -0400
org.apache.juneau.http.annotation tests.
---
.../java/org/apache/juneau/http/MediaRanges.java | 2 +-
.../java/org/apache/juneau/http/StringRange.java | 9 +-
.../java/org/apache/juneau/http/StringRanges.java | 16 +-
.../juneau/http/annotation/AnnotationUtils.java | 68 +-
.../juneau/http/annotation/BodyAnnotation.java | 208 ++++++
.../juneau/http/annotation/ContactAnnotation.java | 93 +++
.../annotation/FormDataAnnotation.java} | 779 ++++++++-----------
.../http/annotation/HasFormDataAnnotation.java | 76 ++
.../juneau/http/annotation/HasQueryAnnotation.java | 76 ++
.../annotation/HeaderAnnotation.java} | 779 ++++++++-----------
.../juneau/http/annotation/LicenseAnnotation.java | 77 ++
.../annotation/PathAnnotation.java} | 802 +++++++-------------
.../annotation/QueryAnnotation.java} | 779 ++++++++-----------
.../org/apache/juneau/http/annotation/Request.java | 4 +-
.../juneau/http/annotation/RequestAnnotation.java | 63 ++
.../apache/juneau/http/annotation/Response.java | 4 +-
.../juneau/http/annotation/ResponseAnnotation.java | 244 ++++++
.../http/annotation/ResponseBodyAnnotation.java | 26 +
.../annotation/ResponseHeaderAnnotation.java} | 821 +++++++--------------
.../http/annotation/ResponseStatusAnnotation.java | 26 +
.../juneau/http/annotation/TagAnnotation.java | 95 +++
.../java/org/apache/juneau/http/header/Accept.java | 2 +-
.../juneau/httppart/HttpPartSchemaBuilder.java | 4 +-
.../apache/juneau/httppart/HttpPartSerializer.java | 4 +-
.../juneau/httppart/bean/RequestBeanMeta.java | 8 +-
.../juneau/httppart/bean/ResponseBeanMeta.java | 8 +-
.../jsonschema/annotation/SchemaAnnotation.java | 5 +
.../apache/juneau/http/HttpMethodName_Test.java | 27 +
.../org/apache/juneau/http/StringRange_Test.java | 50 ++
.../org/apache/juneau/http/StringRanges_Test.java | 51 ++
.../http/annotation/AnnotationUtilsTest.java | 143 ----
.../http/annotation/AnnotationUtils_Test.java | 800 ++++++++++++++++++++
.../http/annotation/CollectionFormatType_Test.java | 26 +
.../juneau/http/annotation/FormatType_Test.java | 26 +
.../juneau/http/annotation/ParameterType_Test.java | 26 +
.../client2/Remote_FormDataAnnotation_Test.java | 8 +-
.../rest/client2/Remote_HeaderAnnotation_Test.java | 8 +-
.../rest/client2/Remote_PathAnnotation_Test.java | 8 +-
.../rest/client2/Remote_QueryAnnotation_Test.java | 8 +-
.../client2/Remote_RequestAnnotation_Test.java | 2 +-
40 files changed, 3478 insertions(+), 2783 deletions(-)
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/MediaRanges.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/MediaRanges.java
index 6258827..b18ad84 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/MediaRanges.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/MediaRanges.java
@@ -141,7 +141,7 @@ public class MediaRanges {
* @param mediaTypes The media types to match against.
* @return The index into the array of the best match, or <c>-1</c> if no suitable matches could be found.
*/
- public int findMatch(List<? extends MediaType> mediaTypes) {
+ public int match(List<? extends MediaType> mediaTypes) {
int matchQuant = 0, matchIndex = -1;
float q = 0f;
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/StringRange.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/StringRange.java
index 24f6b78..61a51e7 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/StringRange.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/StringRange.java
@@ -72,15 +72,16 @@ public class StringRange {
extensions.add(BasicNameValuePair.of(p.getName(), p.getValue()));
}
}
-
+
this.qValue = qValue;
this.extensions = extensions.toArray(new NameValuePair[extensions.size()]);
this.name = e.getName();
StringBuffer sb = new StringBuffer();
+ sb.append(name);
// '1' is equivalent to specifying no qValue. If there's no extensions, then we won't include a qValue.
- if (qValue.floatValue() == 1.0) {
+ if (Float.compare(qValue.floatValue(), 1f) == 0) {
if (this.extensions.length > 0) {
sb.append(";q=").append(qValue);
for (NameValuePair p : extensions)
@@ -135,7 +136,7 @@ public class StringRange {
}
/**
- * Returns <jk>true</jk> if the specified object is also a <c>MediaType</c>, and has the same qValue, type,
+ * Returns <jk>true</jk> if the specified object is also a <c>StringRange</c>, and has the same qValue, type,
* parameters, and extensions.
*
* @return <jk>true</jk> if object is equivalent.
@@ -174,7 +175,7 @@ public class StringRange {
private static HeaderElement parse(String value) {
HeaderElement[] elements = BasicHeaderValueParser.parseElements(emptyIfNull(trim(value)), null);
- return (elements.length > 0 ? elements[0] : new BasicHeaderElement("", ""));
+ return (elements.length > 0 ? elements[0] : new BasicHeaderElement("*", ""));
}
@Override /* Object */
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/StringRanges.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/StringRanges.java
index b87838f..6501b35 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/StringRanges.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/StringRanges.java
@@ -143,7 +143,7 @@ public class StringRanges {
* @param names The names to match against.
* @return The index into the array of the best match, or <c>-1</c> if no suitable matches could be found.
*/
- public int findMatch(List<String> names) {
+ public int match(List<String> names) {
int matchQuant = 0, matchIndex = -1;
float q = 0f;
@@ -183,16 +183,6 @@ public class StringRanges {
}
/**
- * Parses the specified header element part.
- *
- * @param value The header element part.
- * @return Thew parsed header element part. Never <jk>null</jk>.
- */
- protected static HeaderElement[] parse(String value) {
- return BasicHeaderValueParser.parseElements(emptyIfNull(trim(value)), null);
- }
-
- /**
* Returns the string ranges that make up this object.
*
* @return The string ranges that make up this object.
@@ -201,6 +191,10 @@ public class StringRanges {
return Collections.unmodifiableList(Arrays.asList(ranges));
}
+ private static HeaderElement[] parse(String value) {
+ return BasicHeaderValueParser.parseElements(emptyIfNull(trim(value)), null);
+ }
+
@Override /* Object */
public String toString() {
return value;
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/AnnotationUtils.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/AnnotationUtils.java
index 0274895..5d725f0 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/AnnotationUtils.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/AnnotationUtils.java
@@ -12,6 +12,8 @@
// ***************************************************************************************************************************
package org.apache.juneau.http.annotation;
+import org.apache.juneau.httppart.*;
+
/**
* Various reusable utility methods when working with annotations.
*/
@@ -31,11 +33,14 @@ public class AnnotationUtils {
if (a == null)
return true;
return
- allEmpty(a.description(), a.d(), a._default(), a.df(), a.example(), a.ex(), a.api())
+ allEmpty(a.description(), a.d(), a._default(), a.df(), a.example(), a.ex(), a.api(), a._enum(), a.e())
&& allEmpty(a.name(), a.n(), a.value(), a.type(), a.t(), a.format(), a.f(), a.pattern(), a.p(), a.collectionFormat(), a.cf(), a.maximum(), a.max(), a.minimum(), a.min(), a.multipleOf(), a.mo())
- && allFalse(a.allowEmptyValue(), a.aev(), a.exclusiveMaximum(), a.emax(), a.exclusiveMinimum(), a.emin(), a.required(), a.r(), a.uniqueItems(), a.ui())
+ && allFalse(a.multi(), a.allowEmptyValue(), a.aev(), a.exclusiveMaximum(), a.emax(), a.exclusiveMinimum(), a.emin(), a.required(), a.r(), a.uniqueItems(), a.ui(), a.skipIfEmpty(), a.sie())
&& allMinusOne(a.maxLength(), a.maxl(), a.minLength(), a.minl(), a.maxItems(), a.maxi(), a.minItems(), a.mini())
- && empty(a.items());
+ && empty(a.items())
+ && a.parser() == HttpPartParser.Null.class
+ && a.serializer() == HttpPartSerializer.Null.class
+ ;
}
/**
@@ -50,9 +55,12 @@ public class AnnotationUtils {
return
allEmpty(a.description(), a.d(), a._default(), a.df(), a._enum(), a.e(), a.example(), a.ex(), a.api())
&& allEmpty(a.name(), a.n(), a.value(), a.type(), a.t(), a.format(), a.f(), a.pattern(), a.p(), a.collectionFormat(), a.cf(), a.maximum(), a.max(), a.minimum(), a.min(), a.multipleOf(), a.mo())
- && allFalse(a.exclusiveMaximum(), a.emax(), a.exclusiveMinimum(), a.emin(), a.required(), a.r(), a.uniqueItems(), a.ui())
+ && allFalse(a.multi(), a.allowEmptyValue(), a.aev(), a.exclusiveMaximum(), a.emax(), a.exclusiveMinimum(), a.emin(), a.required(), a.r(), a.uniqueItems(), a.ui(), a.skipIfEmpty(), a.sie())
&& allMinusOne(a.maxLength(), a.maxl(), a.minLength(), a.minl(), a.maxItems(), a.maxi(), a.minItems(), a.mini())
- && empty(a.items());
+ && empty(a.items())
+ && a.parser() == HttpPartParser.Null.class
+ && a.serializer() == HttpPartSerializer.Null.class
+ ;
}
/**
@@ -67,9 +75,12 @@ public class AnnotationUtils {
return
allEmpty(a.description(), a.d(), a._default(), a.df(), a._enum(), a.e(), a.example(), a.ex(), a.api())
&& allEmpty(a.name(), a.value(), a.n(), a.type(), a.t(), a.format(), a.f(), a.pattern(), a.p(), a.collectionFormat(), a.cf(), a.maximum(), a.max(), a.minimum(), a.min(), a.multipleOf(), a.mo())
- && allFalse(a.allowEmptyValue(), a.aev(), a.exclusiveMaximum(), a.emax(), a.exclusiveMinimum(), a.emin(), a.required(), a.r(), a.uniqueItems(), a.ui())
+ && allFalse(a.multi(), a.allowEmptyValue(), a.aev(), a.exclusiveMaximum(), a.emax(), a.exclusiveMinimum(), a.emin(), a.required(), a.r(), a.uniqueItems(), a.ui(), a.skipIfEmpty(), a.sie())
&& allMinusOne(a.maxLength(), a.maxl(), a.minLength(), a.minl(), a.maxItems(), a.maxi(), a.minItems(), a.mini())
- && empty(a.items());
+ && empty(a.items())
+ && a.parser() == HttpPartParser.Null.class
+ && a.serializer() == HttpPartSerializer.Null.class
+ ;
}
/**
@@ -83,8 +94,12 @@ public class AnnotationUtils {
return true;
return
allEmpty(a.description(), a.d(), a.example(), a.ex(), a.examples(), a.exs(), a.api())
+ && a.code().length == 0
+ && a.value().length == 0
&& a.headers().length == 0
&& empty(a.schema())
+ && a.parser() == HttpPartParser.Null.class
+ && a.serializer() == HttpPartSerializer.Null.class
;
}
@@ -99,10 +114,13 @@ public class AnnotationUtils {
return true;
return
allEmpty(a.description(), a.d(), a._default(), a.df(), a._enum(), a.e(), a.example(), a.ex(), a.api())
- && allEmpty(a.name(), a.n(), a.value(), a.type(), a.t(), a.format(), a.f(), a.collectionFormat(), a.cf(), a.$ref(), a.maximum(), a.max(), a.minimum(), a.min(), a.multipleOf(), a.mo())
+ && allEmpty(a.name(), a.n(), a.value(), a.type(), a.t(), a.format(), a.f(), a.collectionFormat(), a.cf(), a.$ref(), a.maximum(), a.max(), a.minimum(), a.min(), a.multipleOf(), a.mo(), a.pattern(), a.p())
&& allFalse(a.exclusiveMaximum(), a.emax(), a.exclusiveMinimum(), a.emin(), a.uniqueItems(), a.ui())
&& allMinusOne(a.maxLength(), a.maxl(), a.minLength(), a.minl(), a.maxItems(), a.maxi(), a.minItems(), a.mini())
- && empty(a.items());
+ && empty(a.items())
+ && a.code().length == 0
+ && a.serializer() == HttpPartSerializer.Null.class
+ ;
}
/**
@@ -116,12 +134,13 @@ public class AnnotationUtils {
return true;
return
allEmpty(a.value(), a.description(), a.d(), a._default(), a.df(), a._enum(), a.e(), a.allOf(), a.properties(), a.additionalProperties(), a.xml(), a.example(), a.ex(), a.examples(), a.exs())
- && allEmpty(a.$ref(), a.format(), a.f(), a.title(), a.multipleOf(), a.mo(), a.maximum(), a.max(), a.minimum(), a.min(), a.pattern(), a.p(), a.type(), a.t(), a.discriminator())
+ && allEmpty(a.$ref(), a.format(), a.f(), a.title(), a.multipleOf(), a.mo(), a.maximum(), a.max(), a.minimum(), a.min(), a.pattern(), a.p(), a.type(), a.t(), a.discriminator(), a.collectionFormat(), a.cf(), a.on())
&& allMinusOne(a.maxProperties(), a.maxp(), a.minProperties(), a.minp())
&& allFalse(a.ignore(), a.exclusiveMaximum(), a.emax(), a.exclusiveMinimum(), a.emin(), a.readOnly(), a.ro(), a.required(), a.r(), a.uniqueItems(), a.ui())
&& allMinusOne(a.maxLength(), a.maxl(), a.minLength(), a.minl(), a.maxItems(), a.maxi(), a.minItems(), a.mini())
&& empty(a.items())
- && empty(a.externalDocs());
+ && empty(a.externalDocs())
+ ;
}
/**
@@ -135,7 +154,8 @@ public class AnnotationUtils {
return true;
return
allEmpty(a.value(), a.description())
- && allEmpty(a.url());
+ && allEmpty(a.url())
+ ;
}
/**
@@ -150,7 +170,8 @@ public class AnnotationUtils {
return
allEmpty(a.description(), a.d(), a.example(), a.ex(), a.examples(), a.exs(), a.api(), a.value())
&& allFalse(a.required(), a.r())
- && empty(a.schema());
+ && empty(a.schema())
+ ;
}
/**
@@ -164,7 +185,8 @@ public class AnnotationUtils {
return true;
return
allEmpty(a.value())
- && allEmpty(a.name(), a.url(), a.email());
+ && allEmpty(a.name(), a.url(), a.email())
+ ;
}
/**
@@ -178,7 +200,8 @@ public class AnnotationUtils {
return true;
return
allEmpty(a.value())
- && allEmpty(a.name(), a.url());
+ && allEmpty(a.name(), a.url())
+ ;
}
/**
@@ -195,7 +218,8 @@ public class AnnotationUtils {
&& allEmpty(a.type(), a.t(), a.format(), a.f(), a.collectionFormat(), a.cf(), a.pattern(), a.p(), a.$ref(), a.maximum(), a.max(), a.minimum(), a.min(), a.multipleOf(), a.mo())
&& allFalse(a.exclusiveMaximum(), a.emax(), a.exclusiveMinimum(), a.emin(), a.uniqueItems(), a.ui())
&& allMinusOne(a.maxLength(), a.maxl(), a.minLength(), a.minl(), a.maxItems(), a.maxi(), a.minItems(), a.mini())
- && empty(a.items());
+ && empty(a.items())
+ ;
}
/**
@@ -211,7 +235,8 @@ public class AnnotationUtils {
allEmpty(a.value(), a._default(), a.df(), a._enum(), a.e(), a.items())
&& allEmpty(a.type(), a.t(), a.format(), a.f(), a.collectionFormat(), a.cf(), a.pattern(), a.p(), a.$ref(), a.maximum(), a.max(), a.minimum(), a.min(), a.multipleOf(), a.mo())
&& allFalse(a.exclusiveMaximum(), a.emax(), a.exclusiveMinimum(), a.emin(), a.uniqueItems(), a.ui())
- && allMinusOne(a.maxLength(), a.maxl(), a.minLength(), a.minl(), a.maxItems(), a.maxi(), a.minItems(), a.mini());
+ && allMinusOne(a.maxLength(), a.maxl(), a.minLength(), a.minl(), a.maxItems(), a.maxi(), a.minItems(), a.mini())
+ ;
}
/**
@@ -225,11 +250,14 @@ public class AnnotationUtils {
return true;
return
allEmpty(a.description(), a.d(), a._enum(), a.e(), a.example(), a.ex(), a.api())
- && allEmpty(a.name(), a.value(), a.n(), a.type(), a.t(), a.format(), a.f(), a.pattern(), a.p(), a.maximum(), a.max(), a.minimum(), a.min(), a.multipleOf(), a.mo())
- && allFalse(a.exclusiveMaximum(), a.emax(), a.exclusiveMinimum(), a.emin(), a.uniqueItems(), a.ui())
+ && allEmpty(a.name(), a.value(), a.n(), a.type(), a.t(), a.format(), a.f(), a.pattern(), a.p(), a.maximum(), a.max(), a.minimum(), a.min(), a.multipleOf(), a.mo(), a.collectionFormat(), a.cf())
+ && allFalse(a.exclusiveMaximum(), a.emax(), a.exclusiveMinimum(), a.emin(), a.uniqueItems(), a.ui(), a.allowEmptyValue(), a.aev())
&& allTrue(a.required(), a.r())
&& allMinusOne(a.maxLength(), a.maxl(), a.minLength(), a.minl(), a.maxItems(), a.maxi(), a.minItems(), a.mini())
- && empty(a.items());
+ && empty(a.items())
+ && a.parser() == HttpPartParser.Null.class
+ && a.serializer() == HttpPartSerializer.Null.class
+ ;
}
/**
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/BodyAnnotation.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/BodyAnnotation.java
new file mode 100644
index 0000000..141fcf6
--- /dev/null
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/BodyAnnotation.java
@@ -0,0 +1,208 @@
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
+// * with the License. You may obtain a copy of the License at *
+// * *
+// * http://www.apache.org/licenses/LICENSE-2.0 *
+// * *
+// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
+// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
+// * specific language governing permissions and limitations under the License. *
+// ***************************************************************************************************************************
+package org.apache.juneau.http.annotation;
+
+import java.lang.annotation.*;
+
+import org.apache.juneau.jsonschema.annotation.*;
+
+/**
+ * A concrete implementation of the {@link Body} annotation.
+ */
+public class BodyAnnotation implements Body {
+
+ private String[] description={}, d={}, example={}, ex={}, examples={}, exs={}, value={}, api={};
+ private boolean required, r;
+ private Schema schema = new SchemaAnnotation();
+
+ @Override /* Annotation */
+ public Class<? extends Annotation> annotationType() {
+ return Body.class;
+ }
+
+ @Override /* Body */
+ public String[] description() {
+ return description;
+ }
+
+ /**
+ * Sets the <c>description</c> property on this annotation.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ */
+ public BodyAnnotation description(String[] value) {
+ this.description = value;
+ return this;
+ }
+
+ @Override /* Body */
+ public String[] d() {
+ return d;
+ }
+
+ /**
+ * Sets the <c>d</c> property on this annotation.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ */
+ public BodyAnnotation d(String[] value) {
+ this.d = value;
+ return this;
+ }
+
+ @Override /* Body */
+ public boolean required() {
+ return required;
+ }
+
+ /**
+ * Sets the <c>required</c> property on this annotation.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ */
+ public BodyAnnotation required(boolean value) {
+ this.required = value;
+ return this;
+ }
+
+ @Override /* Body */
+ public boolean r() {
+ return r;
+ }
+
+ /**
+ * Sets the <c>r</c> property on this annotation.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ */
+ public BodyAnnotation r(boolean value) {
+ this.r = value;
+ return this;
+ }
+
+ @Override /* Body */
+ public Schema schema() {
+ return schema;
+ }
+
+ /**
+ * Sets the <c>schema</c> property on this annotation.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ */
+ public BodyAnnotation schema(Schema value) {
+ this.schema = value;
+ return this;
+ }
+
+ @Override /* Body */
+ public String[] example() {
+ return example;
+ }
+
+ /**
+ * Sets the <c>example</c> property on this annotation.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ */
+ public BodyAnnotation example(String[] value) {
+ this.example = value;
+ return this;
+ }
+
+ @Override /* Body */
+ public String[] ex() {
+ return ex;
+ }
+
+ /**
+ * Sets the <c>ex</c> property on this annotation.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ */
+ public BodyAnnotation ex(String[] value) {
+ this.ex = value;
+ return this;
+ }
+
+ @Override /* Body */
+ public String[] examples() {
+ return examples;
+ }
+
+ /**
+ * Sets the <c>examples</c> property on this annotation.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ */
+ public BodyAnnotation examples(String[] value) {
+ this.examples = value;
+ return this;
+ }
+
+ @Override /* Body */
+ public String[] exs() {
+ return exs;
+ }
+
+ /**
+ * Sets the <c>exs</c> property on this annotation.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ */
+ public BodyAnnotation exs(String[] value) {
+ this.exs = value;
+ return this;
+ }
+
+ @Override /* Body */
+ public String[] value() {
+ return value;
+ }
+
+ /**
+ * Sets the <c>value</c> property on this annotation.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ */
+ public BodyAnnotation value(String[] value) {
+ this.value = value;
+ return this;
+ }
+
+ @Override /* Body */
+ public String[] api() {
+ return api;
+ }
+
+ /**
+ * Sets the <c>api</c> property on this annotation.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ */
+ public BodyAnnotation api(String[] value) {
+ this.api = value;
+ return this;
+ }
+}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ContactAnnotation.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ContactAnnotation.java
new file mode 100644
index 0000000..71845e7
--- /dev/null
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ContactAnnotation.java
@@ -0,0 +1,93 @@
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
+// * with the License. You may obtain a copy of the License at *
+// * *
+// * http://www.apache.org/licenses/LICENSE-2.0 *
+// * *
+// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
+// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
+// * specific language governing permissions and limitations under the License. *
+// ***************************************************************************************************************************
+package org.apache.juneau.http.annotation;
+
+import java.lang.annotation.*;
+
+/**
+ * A concrete implementation of the {@link Contact} annotation.
+ */
+public class ContactAnnotation implements Contact {
+
+ private String name="", url="", email="";
+ private String[] value={};
+
+ @Override /* Annotation */
+ public Class<? extends Annotation> annotationType() {
+ return Contact.class;
+ }
+
+ @Override /* Contact */
+ public String name() {
+ return name;
+ }
+
+ /**
+ * Sets the <c>name</c> property on this annotation.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ */
+ public ContactAnnotation name(String value) {
+ this.name = value;
+ return this;
+ }
+
+ @Override /* Contact */
+ public String url() {
+ return url;
+ }
+
+ /**
+ * Sets the <c>url</c> property on this annotation.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ */
+ public ContactAnnotation url(String value) {
+ this.url = value;
+ return this;
+ }
+
+ @Override /* Contact */
+ public String email() {
+ return email;
+ }
+
+ /**
+ * Sets the <c>email</c> property on this annotation.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ */
+ public ContactAnnotation email(String value) {
+ this.email = value;
+ return this;
+ }
+
+ @Override /* Contact */
+ public String[] value() {
+ return value;
+ }
+
+ /**
+ * Sets the <c>value</c> property on this annotation.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ */
+ public ContactAnnotation value(String[] value) {
+ this.value = value;
+ return this;
+ }
+}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jsonschema/annotation/SchemaAnnotation.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/FormDataAnnotation.java
similarity index 58%
copy from juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jsonschema/annotation/SchemaAnnotation.java
copy to juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/FormDataAnnotation.java
index 35b7e9f..61b1de1 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jsonschema/annotation/SchemaAnnotation.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/FormDataAnnotation.java
@@ -10,249 +10,160 @@
// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
// * specific language governing permissions and limitations under the License. *
// ***************************************************************************************************************************
-package org.apache.juneau.jsonschema.annotation;
+package org.apache.juneau.http.annotation;
import java.lang.annotation.*;
-import org.apache.juneau.*;
+import org.apache.juneau.httppart.*;
+import org.apache.juneau.jsonschema.annotation.*;
/**
- * A concrete implementation of the {@link Schema} annotation.
- *
- * <p>
- * Annotations can be applied programmatically using {@link BeanContextBuilder#annotations(Annotation...)}.
+ * A concrete implementation of the {@link FormData} annotation.
*/
-public class SchemaAnnotation implements Schema {
-
- private String on = "";
-
- private String
- $ref = "",
- format = "",
- f = "",
- title = "",
- multipleOf = "",
- mo = "",
- maximum = "",
- max = "",
- minimum = "",
- min = "",
- pattern = "",
- p = "",
- type = "",
- t = "",
- collectionFormat = "",
- cf = "",
- discriminator = "";
-
- private String[]
- description = new String[0],
- d = new String[0],
- _default = new String[0],
- df = new String[0],
- _enum = new String[0],
- e = new String[0],
- allOf = new String[0],
- properties = new String[0],
- additionalProperties = new String[0],
- xml = new String[0],
- example = new String[0],
- ex = new String[0],
- examples = new String[0],
- exs = new String[0],
- value = new String[0];
-
- private boolean
- exclusiveMaximum = false,
- emax = false,
- exclusiveMinimum = false,
- emin = false,
- uniqueItems = false,
- ui = false,
- required = false,
- r = false,
- readOnly = false,
- ro = false,
- ignore = false;
-
- private long
- maxLength = -1,
- maxl = -1,
- minLength = -1,
- minl = -1,
- maxItems = -1,
- maxi = -1,
- minItems = -1,
- mini = -1,
- maxProperties = -1,
- maxp = -1,
- minProperties = -1,
- minp = -1;
+public class FormDataAnnotation implements FormData {
+ private boolean skipIfEmpty, sie, aev, allowEmptyValue, emax, emin, exclusiveMaximum, exclusiveMinimum, multi, r, required, ui, uniqueItems;
+ private String[] _default={}, _enum={}, api={}, d={}, description={}, df={}, e={}, ex={}, example={};
+ private String cf="", collectionFormat="", f="", format="", max="", maximum="", min="", minimum="", mo="", multipleOf="", n="", name="", p="", pattern="", t="", type="", value="";
+ private long maxItems=-1, maxi=-1, maxl=-1, maxLength=-1, mini=-1, minItems=-1, minl=-1, minLength=-1;
private Items items = new ItemsAnnotation();
- private ExternalDocs externalDocs = new ExternalDocsAnnotation();
+ private Class<? extends HttpPartParser> parser = HttpPartParser.Null.class;
+ private Class<? extends HttpPartSerializer> serializer = HttpPartSerializer.Null.class;
-
- /**
- * Constructor.
- *
- * @param on The initial value for the <c>on</c> property.
- * <br>See {@link Schema#on()}
- */
- public SchemaAnnotation(String on) {
- this.on = on;
- }
-
- @Override
+ @Override /* Annotation */
public Class<? extends Annotation> annotationType() {
- return Schema.class;
+ return FormData.class;
}
- @Override /* Schema */
- public String[] _default() {
- return _default;
+ @Override /* FormData */
+ public boolean skipIfEmpty() {
+ return skipIfEmpty;
}
/**
- * Sets the <c>_default</c> property on this annotation.
+ * Sets the <c>skipIfEmpty</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation _default(String...value) {
- this._default = value;
+ public FormDataAnnotation skipIfEmpty(boolean value) {
+ this.skipIfEmpty = value;
return this;
}
- @Override /* Schema */
- public String[] df() {
- return df;
+ @Override /* FormData */
+ public boolean sie() {
+ return sie;
}
/**
- * Sets the <c>df</c> property on this annotation.
+ * Sets the <c>sie</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation df(String...value) {
- this.df = value;
+ public FormDataAnnotation sie(boolean value) {
+ this.sie = value;
return this;
}
- @Override /* Schema */
- public String[] _enum() {
- return _enum;
+ @Override /* FormData */
+ public Class<? extends HttpPartSerializer> serializer() {
+ return serializer;
}
/**
- * Sets the <c>_enum</c> property on this annotation.
+ * Sets the <c>serializer</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation _enum(String...value) {
- this._enum = value;
+ public FormDataAnnotation serializer(Class<? extends HttpPartSerializer> value) {
+ this.serializer = value;
return this;
}
- @Override /* Schema */
- public String[] e() {
- return e;
+ @Override /* FormData */
+ public Class<? extends HttpPartParser> parser() {
+ return parser;
}
/**
- * Sets the <c>e</c> property on this annotation.
+ * Sets the <c>parser</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation e(String...value) {
- this.e = value;
+ public FormDataAnnotation parser(Class<? extends HttpPartParser> value) {
+ this.parser = value;
return this;
}
- @Override /* Schema */
- public String $ref() {
- return $ref;
+ @Override /* FormData */
+ public boolean multi() {
+ return multi;
}
/**
- * Sets the <c>$ref</c> property on this annotation.
+ * Sets the <c>multi</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation $ref(String value) {
- this.$ref = value;
+ public FormDataAnnotation multi(boolean value) {
+ this.multi = value;
return this;
}
- @Override /* Schema */
- public String[] additionalProperties() {
- return additionalProperties;
+ @Override /* FormData */
+ public String name() {
+ return name;
}
/**
- * Sets the <c>additionalProperties</c> property on this annotation.
+ * Sets the <c>name</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation additionalProperties(String...value) {
- this.additionalProperties = value;
+ public FormDataAnnotation name(String value) {
+ this.name = value;
return this;
}
- @Override /* Schema */
- public String[] allOf() {
- return allOf;
+ @Override /* FormData */
+ public String n() {
+ return n;
}
/**
- * Sets the <c>allOf</c> property on this annotation.
+ * Sets the <c>n</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation allOf(String...value) {
- this.allOf = value;
+ public FormDataAnnotation n(String value) {
+ this.n = value;
return this;
}
- @Override /* Schema */
- public String collectionFormat() {
- return collectionFormat;
- }
-
- /**
- * Sets the <c>collectionFormat</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation collectionFormat(String value) {
- this.collectionFormat = value;
- return this;
- }
-
- @Override /* Schema */
- public String cf() {
- return cf;
+ @Override /* FormData */
+ public String value() {
+ return value;
}
/**
- * Sets the <c>cf</c> property on this annotation.
+ * Sets the <c>value</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation cf(String value) {
- this.cf = value;
+ public FormDataAnnotation value(String value) {
+ this.value = value;
return this;
}
- @Override /* Schema */
+ @Override /* FormData */
public String[] description() {
return description;
}
@@ -263,12 +174,12 @@ public class SchemaAnnotation implements Schema {
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation description(String...value) {
+ public FormDataAnnotation description(String[] value) {
this.description = value;
return this;
}
- @Override /* Schema */
+ @Override /* FormData */
public String[] d() {
return d;
}
@@ -279,236 +190,220 @@ public class SchemaAnnotation implements Schema {
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation d(String...value) {
+ public FormDataAnnotation d(String[] value) {
this.d = value;
return this;
}
- @Override /* Schema */
- public String discriminator() {
- return discriminator;
- }
-
- /**
- * Sets the <c>discriminator</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation discriminator(String value) {
- this.discriminator = value;
- return this;
- }
-
- @Override /* Schema */
- public String[] example() {
- return example;
+ @Override /* FormData */
+ public boolean required() {
+ return required;
}
/**
- * Sets the <c>example</c> property on this annotation.
+ * Sets the <c>required</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation example(String...value) {
- this.example = value;
+ public FormDataAnnotation required(boolean value) {
+ this.required = value;
return this;
}
- @Override /* Schema */
- public String[] ex() {
- return ex;
+ @Override /* FormData */
+ public boolean r() {
+ return r;
}
/**
- * Sets the <c>ex</c> property on this annotation.
+ * Sets the <c>r</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation ex(String...value) {
- this.ex = value;
+ public FormDataAnnotation r(boolean value) {
+ this.r = value;
return this;
}
- @Override /* Schema */
- public String[] examples() {
- return examples;
+ @Override /* FormData */
+ public String type() {
+ return type;
}
/**
- * Sets the <c>examples</c> property on this annotation.
+ * Sets the <c>type</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation examples(String...value) {
- this.examples = value;
+ public FormDataAnnotation type(String value) {
+ this.type = value;
return this;
}
- @Override /* Schema */
- public String[] exs() {
- return exs;
+ @Override /* FormData */
+ public String t() {
+ return t;
}
/**
- * Sets the <c>exs</c> property on this annotation.
+ * Sets the <c>t</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation exs(String...value) {
- this.exs = value;
+ public FormDataAnnotation t(String value) {
+ this.t = value;
return this;
}
- @Override /* Schema */
- public boolean exclusiveMaximum() {
- return exclusiveMaximum;
+ @Override /* FormData */
+ public String format() {
+ return format;
}
/**
- * Sets the <c>exclusiveMaximum</c> property on this annotation.
+ * Sets the <c>format</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation exclusiveMaximum(boolean value) {
- this.exclusiveMaximum = value;
+ public FormDataAnnotation format(String value) {
+ this.format = value;
return this;
}
- @Override /* Schema */
- public boolean emax() {
- return emax;
+ @Override /* FormData */
+ public String f() {
+ return f;
}
/**
- * Sets the <c>emax</c> property on this annotation.
+ * Sets the <c>f</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation emax(boolean value) {
- this.emax = value;
+ public FormDataAnnotation f(String value) {
+ this.f = value;
return this;
}
- @Override /* Schema */
- public boolean exclusiveMinimum() {
- return exclusiveMinimum;
+ @Override /* FormData */
+ public boolean allowEmptyValue() {
+ return allowEmptyValue;
}
/**
- * Sets the <c>exclusiveMinimum</c> property on this annotation.
+ * Sets the <c>allowEmptyValue</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation exclusiveMinimum(boolean value) {
- this.exclusiveMinimum = value;
+ public FormDataAnnotation allowEmptyValue(boolean value) {
+ this.allowEmptyValue = value;
return this;
}
- @Override /* Schema */
- public boolean emin() {
- return emin;
+ @Override /* FormData */
+ public boolean aev() {
+ return aev;
}
/**
- * Sets the <c>emin</c> property on this annotation.
+ * Sets the <c>aev</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation emin(boolean value) {
- this.emin = value;
+ public FormDataAnnotation aev(boolean value) {
+ this.aev = value;
return this;
}
- @Override /* Schema */
- public ExternalDocs externalDocs() {
- return externalDocs;
+ @Override /* FormData */
+ public Items items() {
+ return items;
}
/**
- * Sets the <c>externalDocs</c> property on this annotation.
+ * Sets the <c>items</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation externalDocs(ExternalDocs value) {
- this.externalDocs = value;
+ public FormDataAnnotation items(Items value) {
+ this.items = value;
return this;
}
- @Override /* Schema */
- public String format() {
- return format;
+ @Override /* FormData */
+ public String collectionFormat() {
+ return collectionFormat;
}
/**
- * Sets the <c>format</c> property on this annotation.
+ * Sets the <c>collectionFormat</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation format(String value) {
- this.format = value;
+ public FormDataAnnotation collectionFormat(String value) {
+ this.collectionFormat = value;
return this;
}
- @Override /* Schema */
- public String f() {
- return f;
+ @Override /* FormData */
+ public String cf() {
+ return cf;
}
/**
- * Sets the <c>f</c> property on this annotation.
+ * Sets the <c>cf</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation f(String value) {
- this.f = value;
+ public FormDataAnnotation cf(String value) {
+ this.cf = value;
return this;
}
- @Override /* Schema */
- public boolean ignore() {
- return ignore;
+ @Override /* FormData */
+ public String[] _default() {
+ return _default;
}
/**
- * Sets the <c>ignore</c> property on this annotation.
+ * Sets the <c>_default</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation ignore(boolean value) {
- this.ignore = value;
+ public FormDataAnnotation _default(String[] value) {
+ this._default = value;
return this;
}
- @Override /* Schema */
- public Items items() {
- return items;
+ @Override /* FormData */
+ public String[] df() {
+ return df;
}
/**
- * Sets the <c>items</c> property on this annotation.
+ * Sets the <c></c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation items(Items value) {
- this.items = value;
+ public FormDataAnnotation df(String[] value) {
+ this.df = value;
return this;
}
- @Override /* Schema */
+ @Override /* FormData */
public String maximum() {
return maximum;
}
@@ -519,12 +414,12 @@ public class SchemaAnnotation implements Schema {
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation maximum(String value) {
+ public FormDataAnnotation maximum(String value) {
this.maximum = value;
return this;
}
- @Override /* Schema */
+ @Override /* FormData */
public String max() {
return max;
}
@@ -535,108 +430,44 @@ public class SchemaAnnotation implements Schema {
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation max(String value) {
+ public FormDataAnnotation max(String value) {
this.max = value;
return this;
}
- @Override /* Schema */
- public long maxItems() {
- return maxItems;
- }
-
- /**
- * Sets the <c>maxItems</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation maxItems(long value) {
- this.maxItems = value;
- return this;
- }
-
- @Override /* Schema */
- public long maxi() {
- return maxi;
- }
-
- /**
- * Sets the <c>maxi</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation maxi(long value) {
- this.maxi = value;
- return this;
- }
-
- @Override /* Schema */
- public long maxLength() {
- return maxLength;
- }
-
- /**
- * Sets the <c>maxLength</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation maxLength(long value) {
- this.maxLength = value;
- return this;
- }
-
- @Override /* Schema */
- public long maxl() {
- return maxl;
- }
-
- /**
- * Sets the <c>maxl</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation maxl(long value) {
- this.maxl = value;
- return this;
- }
-
- @Override /* Schema */
- public long maxProperties() {
- return maxProperties;
+ @Override /* FormData */
+ public boolean exclusiveMaximum() {
+ return exclusiveMaximum;
}
/**
- * Sets the <c>maxProperties</c> property on this annotation.
+ * Sets the <c>exclusiveMaximum</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation maxProperties(long value) {
- this.maxProperties = value;
+ public FormDataAnnotation exclusiveMaximum(boolean value) {
+ this.exclusiveMaximum = value;
return this;
}
- @Override /* Schema */
- public long maxp() {
- return maxp;
+ @Override /* FormData */
+ public boolean emax() {
+ return emax;
}
/**
- * Sets the <c>maxp</c> property on this annotation.
+ * Sets the <c>emax</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation maxp(long value) {
- this.maxp = value;
+ public FormDataAnnotation emax(boolean value) {
+ this.emax = value;
return this;
}
- @Override /* Schema */
+ @Override /* FormData */
public String minimum() {
return minimum;
}
@@ -647,12 +478,12 @@ public class SchemaAnnotation implements Schema {
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation minimum(String value) {
+ public FormDataAnnotation minimum(String value) {
this.minimum = value;
return this;
}
- @Override /* Schema */
+ @Override /* FormData */
public String min() {
return min;
}
@@ -663,376 +494,344 @@ public class SchemaAnnotation implements Schema {
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation min(String value) {
+ public FormDataAnnotation min(String value) {
this.min = value;
return this;
}
- @Override /* Schema */
- public long minItems() {
- return minItems;
- }
-
- /**
- * Sets the <c>minItems</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation minItems(long value) {
- this.minItems = value;
- return this;
- }
-
- @Override /* Schema */
- public long mini() {
- return mini;
- }
-
- /**
- * Sets the <c>mini</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation mini(long value) {
- this.mini = value;
- return this;
- }
-
- @Override /* Schema */
- public long minLength() {
- return minLength;
+ @Override /* FormData */
+ public boolean exclusiveMinimum() {
+ return exclusiveMinimum;
}
/**
- * Sets the <c>minLength</c> property on this annotation.
+ * Sets the <c>exclusiveMinimum</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation minLength(long value) {
- this.minLength = value;
+ public FormDataAnnotation exclusiveMinimum(boolean value) {
+ this.exclusiveMinimum = value;
return this;
}
- @Override /* Schema */
- public long minl() {
- return minl;
+ @Override /* FormData */
+ public boolean emin() {
+ return emin;
}
/**
- * Sets the <c>minl</c> property on this annotation.
+ * Sets the <c>emin</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation minl(long value) {
- this.minl = value;
+ public FormDataAnnotation emin(boolean value) {
+ this.emin = value;
return this;
}
- @Override /* Schema */
- public long minProperties() {
- return minProperties;
+ @Override /* FormData */
+ public long maxLength() {
+ return maxLength;
}
/**
- * Sets the <c>minProperties</c> property on this annotation.
+ * Sets the <c>maxLength</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation minProperties(long value) {
- this.minProperties = value;
+ public FormDataAnnotation maxLength(long value) {
+ this.maxLength = value;
return this;
}
- @Override /* Schema */
- public long minp() {
- return minp;
+ @Override /* FormData */
+ public long maxl() {
+ return maxl;
}
/**
- * Sets the <c>minp</c> property on this annotation.
+ * Sets the <c>maxl</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation minp(long value) {
- this.minp = value;
+ public FormDataAnnotation maxl(long value) {
+ this.maxl = value;
return this;
}
- @Override /* Schema */
- public String multipleOf() {
- return multipleOf;
+ @Override /* FormData */
+ public long minLength() {
+ return minLength;
}
/**
- * Sets the <c>multipleOf</c> property on this annotation.
+ * Sets the <c>minLength</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation multipleOf(String value) {
- this.multipleOf = value;
+ public FormDataAnnotation minLength(long value) {
+ this.minLength = value;
return this;
}
- @Override /* Schema */
- public String mo() {
- return mo;
+ @Override /* FormData */
+ public long minl() {
+ return minl;
}
/**
- * Sets the <c>mo</c> property on this annotation.
+ * Sets the <c>minl</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation mo(String value) {
- this.mo = value;
+ public FormDataAnnotation minl(long value) {
+ this.minl = value;
return this;
}
- @Override /* Schema */
- public String on() {
- return on;
+ @Override /* FormData */
+ public String pattern() {
+ return pattern;
}
/**
- * Sets the <c>on</c> property on this annotation.
+ * Sets the <c>pattern</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation on(String value) {
- this.on = value;
+ public FormDataAnnotation pattern(String value) {
+ this.pattern = value;
return this;
}
- @Override /* Schema */
- public String pattern() {
- return pattern;
+ @Override /* FormData */
+ public String p() {
+ return p;
}
/**
- * Sets the <c>pattern</c> property on this annotation.
+ * Sets the <c>p</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation pattern(String value) {
- this.pattern = value;
+ public FormDataAnnotation p(String value) {
+ this.p = value;
return this;
}
- @Override /* Schema */
- public String p() {
- return p;
+ @Override /* FormData */
+ public long maxItems() {
+ return maxItems;
}
/**
- * Sets the <c>p</c> property on this annotation.
+ * Sets the <c>maxItems</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation p(String value) {
- this.p = value;
+ public FormDataAnnotation maxItems(long value) {
+ this.maxItems = value;
return this;
}
- @Override /* Schema */
- public String[] properties() {
- return properties;
+ @Override /* FormData */
+ public long maxi() {
+ return maxi;
}
/**
- * Sets the <c>properties</c> property on this annotation.
+ * Sets the <c>maxi</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation properties(String...value) {
- this.properties = value;
+ public FormDataAnnotation maxi(long value) {
+ this.maxi = value;
return this;
}
- @Override /* Schema */
- public boolean readOnly() {
- return readOnly;
+ @Override /* FormData */
+ public long minItems() {
+ return minItems;
}
/**
- * Sets the <c>readOnly</c> property on this annotation.
+ * Sets the <c>minItems</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation readOnly(boolean value) {
- this.readOnly = value;
+ public FormDataAnnotation minItems(long value) {
+ this.minItems = value;
return this;
}
- @Override /* Schema */
- public boolean ro() {
- return ro;
+ @Override /* FormData */
+ public long mini() {
+ return mini;
}
/**
- * Sets the <c>ro</c> property on this annotation.
+ * Sets the <c>mini</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation ro(boolean value) {
- this.ro = value;
+ public FormDataAnnotation mini(long value) {
+ this.mini = value;
return this;
}
- @Override /* Schema */
- public boolean required() {
- return required;
+ @Override /* FormData */
+ public boolean uniqueItems() {
+ return uniqueItems;
}
/**
- * Sets the <c>required</c> property on this annotation.
+ * Sets the <c>uniqueItems</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation required(boolean value) {
- this.required = value;
+ public FormDataAnnotation uniqueItems(boolean value) {
+ this.uniqueItems = value;
return this;
}
- @Override /* Schema */
- public boolean r() {
- return r;
+ @Override /* FormData */
+ public boolean ui() {
+ return ui;
}
/**
- * Sets the <c>r</c> property on this annotation.
+ * Sets the <c>ui</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation r(boolean value) {
- this.r = value;
+ public FormDataAnnotation ui(boolean value) {
+ this.ui = value;
return this;
}
- @Override /* Schema */
- public String title() {
- return title;
+ @Override /* FormData */
+ public String[] _enum() {
+ return _enum;
}
/**
- * Sets the <c>title</c> property on this annotation.
+ * Sets the <c>_enum</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation title(String value) {
- this.title = value;
+ public FormDataAnnotation _enum(String[] value) {
+ this._enum = value;
return this;
}
- @Override /* Schema */
- public String type() {
- return type;
+ @Override /* FormData */
+ public String[] e() {
+ return e;
}
/**
- * Sets the <c>type</c> property on this annotation.
+ * Sets the <c>e</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation type(String value) {
- this.type = value;
+ public FormDataAnnotation e(String[] value) {
+ this.e = value;
return this;
}
- @Override /* Schema */
- public String t() {
- return t;
+ @Override /* FormData */
+ public String multipleOf() {
+ return multipleOf;
}
/**
- * Sets the <c>t</c> property on this annotation.
+ * Sets the <c>multipleOf</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation t(String value) {
- this.t = value;
+ public FormDataAnnotation multipleOf(String value) {
+ this.multipleOf = value;
return this;
}
- @Override /* Schema */
- public boolean uniqueItems() {
- return uniqueItems;
+ @Override /* FormData */
+ public String mo() {
+ return mo;
}
/**
- * Sets the <c>uniqueItems</c> property on this annotation.
+ * Sets the <c>mo</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation uniqueItems(boolean value) {
- this.uniqueItems = value;
+ public FormDataAnnotation mo(String value) {
+ this.mo = value;
return this;
}
- @Override /* Schema */
- public boolean ui() {
- return ui;
+ @Override /* FormData */
+ public String[] example() {
+ return example;
}
/**
- * Sets the <c>ui</c> property on this annotation.
+ * Sets the <c>example</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation ui(boolean value) {
- this.ui = value;
+ public FormDataAnnotation example(String[] value) {
+ this.example = value;
return this;
}
- @Override /* Schema */
- public String[] value() {
- return value;
+ @Override /* FormData */
+ public String[] ex() {
+ return ex;
}
/**
- * Sets the <c>value</c> property on this annotation.
+ * Sets the <c>ex</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation value(String...value) {
- this.value = value;
+ public FormDataAnnotation ex(String[] value) {
+ this.ex = value;
return this;
}
- @Override /* Schema */
- public String[] xml() {
- return xml;
+ @Override /* FormData */
+ public String[] api() {
+ return api;
}
/**
- * Sets the <c>xml</c> property on this annotation.
+ * Sets the <c>api</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation xml(String...value) {
- this.xml = value;
+ public FormDataAnnotation api(String[] value) {
+ this.api = value;
return this;
}
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/HasFormDataAnnotation.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/HasFormDataAnnotation.java
new file mode 100644
index 0000000..af0d6b4
--- /dev/null
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/HasFormDataAnnotation.java
@@ -0,0 +1,76 @@
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
+// * with the License. You may obtain a copy of the License at *
+// * *
+// * http://www.apache.org/licenses/LICENSE-2.0 *
+// * *
+// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
+// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
+// * specific language governing permissions and limitations under the License. *
+// ***************************************************************************************************************************
+package org.apache.juneau.http.annotation;
+
+import java.lang.annotation.*;
+
+/**
+ * A concrete implementation of the {@link HasFormData} annotation.
+ */
+public class HasFormDataAnnotation implements HasFormData {
+
+ private String name="", n="", value="";
+
+ @Override /* Annotation */
+ public Class<? extends Annotation> annotationType() {
+ return HasFormData.class;
+ }
+
+ @Override /* HasFormData */
+ public String name() {
+ return name;
+ }
+
+ /**
+ * Sets the <c>name</c> property on this annotation.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ */
+ public HasFormDataAnnotation name(String value) {
+ this.name = value;
+ return this;
+ }
+
+ @Override /* HasFormData */
+ public String n() {
+ return n;
+ }
+
+ /**
+ * Sets the <c>n</c> property on this annotation.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ */
+ public HasFormDataAnnotation n(String value) {
+ this.n = value;
+ return this;
+ }
+
+ @Override /* HasFormData */
+ public String value() {
+ return value;
+ }
+
+ /**
+ * Sets the <c>value</c> property on this annotation.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ */
+ public HasFormDataAnnotation value(String value) {
+ this.value = value;
+ return this;
+ }
+}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/HasQueryAnnotation.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/HasQueryAnnotation.java
new file mode 100644
index 0000000..8275b01
--- /dev/null
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/HasQueryAnnotation.java
@@ -0,0 +1,76 @@
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
+// * with the License. You may obtain a copy of the License at *
+// * *
+// * http://www.apache.org/licenses/LICENSE-2.0 *
+// * *
+// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
+// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
+// * specific language governing permissions and limitations under the License. *
+// ***************************************************************************************************************************
+package org.apache.juneau.http.annotation;
+
+import java.lang.annotation.*;
+
+/**
+ * A concrete implementation of the {@link HasQuery} annotation.
+ */
+public class HasQueryAnnotation implements HasQuery {
+
+ private String name="", n="", value="";
+
+ @Override /* Annotation */
+ public Class<? extends Annotation> annotationType() {
+ return HasQuery.class;
+ }
+
+ @Override /* HasQuery */
+ public String name() {
+ return name;
+ }
+
+ /**
+ * Sets the <c>name</c> property on this annotation.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ */
+ public HasQueryAnnotation name(String value) {
+ this.name = value;
+ return this;
+ }
+
+ @Override /* HasQuery */
+ public String n() {
+ return n;
+ }
+
+ /**
+ * Sets the <c>n</c> property on this annotation.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ */
+ public HasQueryAnnotation n(String value) {
+ this.n = value;
+ return this;
+ }
+
+ @Override /* HasQuery */
+ public String value() {
+ return value;
+ }
+
+ /**
+ * Sets the <c>value</c> property on this annotation.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ */
+ public HasQueryAnnotation value(String value) {
+ this.value = value;
+ return this;
+ }
+}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jsonschema/annotation/SchemaAnnotation.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/HeaderAnnotation.java
similarity index 58%
copy from juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jsonschema/annotation/SchemaAnnotation.java
copy to juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/HeaderAnnotation.java
index 35b7e9f..5cd9716 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jsonschema/annotation/SchemaAnnotation.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/HeaderAnnotation.java
@@ -10,249 +10,160 @@
// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
// * specific language governing permissions and limitations under the License. *
// ***************************************************************************************************************************
-package org.apache.juneau.jsonschema.annotation;
+package org.apache.juneau.http.annotation;
import java.lang.annotation.*;
-import org.apache.juneau.*;
+import org.apache.juneau.httppart.*;
+import org.apache.juneau.jsonschema.annotation.*;
/**
- * A concrete implementation of the {@link Schema} annotation.
- *
- * <p>
- * Annotations can be applied programmatically using {@link BeanContextBuilder#annotations(Annotation...)}.
+ * A concrete implementation of the {@link Header} annotation.
*/
-public class SchemaAnnotation implements Schema {
-
- private String on = "";
-
- private String
- $ref = "",
- format = "",
- f = "",
- title = "",
- multipleOf = "",
- mo = "",
- maximum = "",
- max = "",
- minimum = "",
- min = "",
- pattern = "",
- p = "",
- type = "",
- t = "",
- collectionFormat = "",
- cf = "",
- discriminator = "";
-
- private String[]
- description = new String[0],
- d = new String[0],
- _default = new String[0],
- df = new String[0],
- _enum = new String[0],
- e = new String[0],
- allOf = new String[0],
- properties = new String[0],
- additionalProperties = new String[0],
- xml = new String[0],
- example = new String[0],
- ex = new String[0],
- examples = new String[0],
- exs = new String[0],
- value = new String[0];
-
- private boolean
- exclusiveMaximum = false,
- emax = false,
- exclusiveMinimum = false,
- emin = false,
- uniqueItems = false,
- ui = false,
- required = false,
- r = false,
- readOnly = false,
- ro = false,
- ignore = false;
-
- private long
- maxLength = -1,
- maxl = -1,
- minLength = -1,
- minl = -1,
- maxItems = -1,
- maxi = -1,
- minItems = -1,
- mini = -1,
- maxProperties = -1,
- maxp = -1,
- minProperties = -1,
- minp = -1;
+public class HeaderAnnotation implements Header {
+ private boolean skipIfEmpty, sie, multi, required, r, allowEmptyValue, aev, exclusiveMaximum, emax, exclusiveMinimum, emin, uniqueItems, ui;
+ private Class<? extends HttpPartSerializer> serializer = HttpPartSerializer.Null.class;
+ private Class<? extends HttpPartParser> parser = HttpPartParser.Null.class;
+ private String name="", n="", value="", type="", t="", format="", f="", collectionFormat="", cf="", maximum="", max="", minimum="", min="", pattern="", p="", multipleOf="", mo="";
+ private String[] description={}, d={}, _default={}, df={}, _enum={}, e={}, example={}, ex={}, api={};
private Items items = new ItemsAnnotation();
- private ExternalDocs externalDocs = new ExternalDocsAnnotation();
+ private long maxLength=-1, maxl=-1, minLength=-1, minl=-1, maxItems=-1, maxi=-1, minItems=-1, mini=-1;
-
- /**
- * Constructor.
- *
- * @param on The initial value for the <c>on</c> property.
- * <br>See {@link Schema#on()}
- */
- public SchemaAnnotation(String on) {
- this.on = on;
- }
-
- @Override
+ @Override /* Annotation */
public Class<? extends Annotation> annotationType() {
- return Schema.class;
+ return Header.class;
}
- @Override /* Schema */
- public String[] _default() {
- return _default;
+ @Override /* Header */
+ public boolean skipIfEmpty() {
+ return skipIfEmpty;
}
/**
- * Sets the <c>_default</c> property on this annotation.
+ * Sets the <c>skipIfEmpty</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation _default(String...value) {
- this._default = value;
+ public HeaderAnnotation skipIfEmpty(boolean value) {
+ this.skipIfEmpty = value;
return this;
}
- @Override /* Schema */
- public String[] df() {
- return df;
+ @Override /* Header */
+ public boolean sie() {
+ return sie;
}
/**
- * Sets the <c>df</c> property on this annotation.
+ * Sets the <c>sie</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation df(String...value) {
- this.df = value;
+ public HeaderAnnotation sie(boolean value) {
+ this.sie = value;
return this;
}
- @Override /* Schema */
- public String[] _enum() {
- return _enum;
+ @Override /* Header */
+ public Class<? extends HttpPartSerializer> serializer() {
+ return serializer;
}
/**
- * Sets the <c>_enum</c> property on this annotation.
+ * Sets the <c>serializer</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation _enum(String...value) {
- this._enum = value;
+ public HeaderAnnotation serializer(Class<? extends HttpPartSerializer> value) {
+ this.serializer = value;
return this;
}
- @Override /* Schema */
- public String[] e() {
- return e;
+ @Override /* Header */
+ public Class<? extends HttpPartParser> parser() {
+ return parser;
}
/**
- * Sets the <c>e</c> property on this annotation.
+ * Sets the <c>parser</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation e(String...value) {
- this.e = value;
+ public HeaderAnnotation parser(Class<? extends HttpPartParser> value) {
+ this.parser = value;
return this;
}
- @Override /* Schema */
- public String $ref() {
- return $ref;
+ @Override /* Header */
+ public boolean multi() {
+ return multi;
}
/**
- * Sets the <c>$ref</c> property on this annotation.
+ * Sets the <c>multi</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation $ref(String value) {
- this.$ref = value;
+ public HeaderAnnotation multi(boolean value) {
+ this.multi = value;
return this;
}
- @Override /* Schema */
- public String[] additionalProperties() {
- return additionalProperties;
+ @Override /* Header */
+ public String name() {
+ return name;
}
/**
- * Sets the <c>additionalProperties</c> property on this annotation.
+ * Sets the <c>name</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation additionalProperties(String...value) {
- this.additionalProperties = value;
+ public HeaderAnnotation name(String value) {
+ this.name = value;
return this;
}
- @Override /* Schema */
- public String[] allOf() {
- return allOf;
+ @Override /* Header */
+ public String n() {
+ return n;
}
/**
- * Sets the <c>allOf</c> property on this annotation.
+ * Sets the <c>n</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation allOf(String...value) {
- this.allOf = value;
+ public HeaderAnnotation n(String value) {
+ this.n = value;
return this;
}
- @Override /* Schema */
- public String collectionFormat() {
- return collectionFormat;
- }
-
- /**
- * Sets the <c>collectionFormat</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation collectionFormat(String value) {
- this.collectionFormat = value;
- return this;
- }
-
- @Override /* Schema */
- public String cf() {
- return cf;
+ @Override /* Header */
+ public String value() {
+ return value;
}
/**
- * Sets the <c>cf</c> property on this annotation.
+ * Sets the <c>value</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation cf(String value) {
- this.cf = value;
+ public HeaderAnnotation value(String value) {
+ this.value = value;
return this;
}
- @Override /* Schema */
+ @Override /* Header */
public String[] description() {
return description;
}
@@ -263,12 +174,12 @@ public class SchemaAnnotation implements Schema {
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation description(String...value) {
+ public HeaderAnnotation description(String[] value) {
this.description = value;
return this;
}
- @Override /* Schema */
+ @Override /* Header */
public String[] d() {
return d;
}
@@ -279,236 +190,220 @@ public class SchemaAnnotation implements Schema {
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation d(String...value) {
+ public HeaderAnnotation d(String[] value) {
this.d = value;
return this;
}
- @Override /* Schema */
- public String discriminator() {
- return discriminator;
- }
-
- /**
- * Sets the <c>discriminator</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation discriminator(String value) {
- this.discriminator = value;
- return this;
- }
-
- @Override /* Schema */
- public String[] example() {
- return example;
+ @Override /* Header */
+ public boolean required() {
+ return required;
}
/**
- * Sets the <c>example</c> property on this annotation.
+ * Sets the <c>required</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation example(String...value) {
- this.example = value;
+ public HeaderAnnotation required(boolean value) {
+ this.required = value;
return this;
}
- @Override /* Schema */
- public String[] ex() {
- return ex;
+ @Override /* Header */
+ public boolean r() {
+ return r;
}
/**
- * Sets the <c>ex</c> property on this annotation.
+ * Sets the <c></c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation ex(String...value) {
- this.ex = value;
+ public HeaderAnnotation r(boolean value) {
+ this.r = value;
return this;
}
- @Override /* Schema */
- public String[] examples() {
- return examples;
+ @Override /* Header */
+ public String type() {
+ return type;
}
/**
- * Sets the <c>examples</c> property on this annotation.
+ * Sets the <c>type</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation examples(String...value) {
- this.examples = value;
+ public HeaderAnnotation type(String value) {
+ this.type = value;
return this;
}
- @Override /* Schema */
- public String[] exs() {
- return exs;
+ @Override /* Header */
+ public String t() {
+ return t;
}
/**
- * Sets the <c>exs</c> property on this annotation.
+ * Sets the <c>t</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation exs(String...value) {
- this.exs = value;
+ public HeaderAnnotation t(String value) {
+ this.t = value;
return this;
}
- @Override /* Schema */
- public boolean exclusiveMaximum() {
- return exclusiveMaximum;
+ @Override /* Header */
+ public String format() {
+ return format;
}
/**
- * Sets the <c>exclusiveMaximum</c> property on this annotation.
+ * Sets the <c>format</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation exclusiveMaximum(boolean value) {
- this.exclusiveMaximum = value;
+ public HeaderAnnotation format(String value) {
+ this.format = value;
return this;
}
- @Override /* Schema */
- public boolean emax() {
- return emax;
+ @Override /* Header */
+ public String f() {
+ return f;
}
/**
- * Sets the <c>emax</c> property on this annotation.
+ * Sets the <c>f</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation emax(boolean value) {
- this.emax = value;
+ public HeaderAnnotation f(String value) {
+ this.f = value;
return this;
}
- @Override /* Schema */
- public boolean exclusiveMinimum() {
- return exclusiveMinimum;
+ @Override /* Header */
+ public boolean allowEmptyValue() {
+ return allowEmptyValue;
}
/**
- * Sets the <c>exclusiveMinimum</c> property on this annotation.
+ * Sets the <c>allowEmptyValue</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation exclusiveMinimum(boolean value) {
- this.exclusiveMinimum = value;
+ public HeaderAnnotation allowEmptyValue(boolean value) {
+ this.allowEmptyValue = value;
return this;
}
- @Override /* Schema */
- public boolean emin() {
- return emin;
+ @Override /* Header */
+ public boolean aev() {
+ return aev;
}
/**
- * Sets the <c>emin</c> property on this annotation.
+ * Sets the <c>aev</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation emin(boolean value) {
- this.emin = value;
+ public HeaderAnnotation aev(boolean value) {
+ this.aev = value;
return this;
}
- @Override /* Schema */
- public ExternalDocs externalDocs() {
- return externalDocs;
+ @Override /* Header */
+ public Items items() {
+ return items;
}
/**
- * Sets the <c>externalDocs</c> property on this annotation.
+ * Sets the <c>items</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation externalDocs(ExternalDocs value) {
- this.externalDocs = value;
+ public HeaderAnnotation items(Items value) {
+ this.items = value;
return this;
}
- @Override /* Schema */
- public String format() {
- return format;
+ @Override /* Header */
+ public String collectionFormat() {
+ return collectionFormat;
}
/**
- * Sets the <c>format</c> property on this annotation.
+ * Sets the <c>collectionFormat</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation format(String value) {
- this.format = value;
+ public HeaderAnnotation collectionFormat(String value) {
+ this.collectionFormat = value;
return this;
}
- @Override /* Schema */
- public String f() {
- return f;
+ @Override /* Header */
+ public String cf() {
+ return cf;
}
/**
- * Sets the <c>f</c> property on this annotation.
+ * Sets the <c>cf</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation f(String value) {
- this.f = value;
+ public HeaderAnnotation cf(String value) {
+ this.cf = value;
return this;
}
- @Override /* Schema */
- public boolean ignore() {
- return ignore;
+ @Override /* Header */
+ public String[] _default() {
+ return _default;
}
/**
- * Sets the <c>ignore</c> property on this annotation.
+ * Sets the <c>_default</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation ignore(boolean value) {
- this.ignore = value;
+ public HeaderAnnotation _default(String[] value) {
+ this._default = value;
return this;
}
- @Override /* Schema */
- public Items items() {
- return items;
+ @Override /* Header */
+ public String[] df() {
+ return df;
}
/**
- * Sets the <c>items</c> property on this annotation.
+ * Sets the <c>df</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation items(Items value) {
- this.items = value;
+ public HeaderAnnotation df(String[] value) {
+ this.df = value;
return this;
}
- @Override /* Schema */
+ @Override /* Header */
public String maximum() {
return maximum;
}
@@ -519,12 +414,12 @@ public class SchemaAnnotation implements Schema {
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation maximum(String value) {
+ public HeaderAnnotation maximum(String value) {
this.maximum = value;
return this;
}
- @Override /* Schema */
+ @Override /* Header */
public String max() {
return max;
}
@@ -535,108 +430,44 @@ public class SchemaAnnotation implements Schema {
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation max(String value) {
+ public HeaderAnnotation max(String value) {
this.max = value;
return this;
}
- @Override /* Schema */
- public long maxItems() {
- return maxItems;
- }
-
- /**
- * Sets the <c>maxItems</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation maxItems(long value) {
- this.maxItems = value;
- return this;
- }
-
- @Override /* Schema */
- public long maxi() {
- return maxi;
- }
-
- /**
- * Sets the <c>maxi</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation maxi(long value) {
- this.maxi = value;
- return this;
- }
-
- @Override /* Schema */
- public long maxLength() {
- return maxLength;
- }
-
- /**
- * Sets the <c>maxLength</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation maxLength(long value) {
- this.maxLength = value;
- return this;
- }
-
- @Override /* Schema */
- public long maxl() {
- return maxl;
- }
-
- /**
- * Sets the <c>maxl</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation maxl(long value) {
- this.maxl = value;
- return this;
- }
-
- @Override /* Schema */
- public long maxProperties() {
- return maxProperties;
+ @Override /* Header */
+ public boolean exclusiveMaximum() {
+ return exclusiveMaximum;
}
/**
- * Sets the <c>maxProperties</c> property on this annotation.
+ * Sets the <c>exclusiveMaximum</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation maxProperties(long value) {
- this.maxProperties = value;
+ public HeaderAnnotation exclusiveMaximum(boolean value) {
+ this.exclusiveMaximum = value;
return this;
}
- @Override /* Schema */
- public long maxp() {
- return maxp;
+ @Override /* Header */
+ public boolean emax() {
+ return emax;
}
/**
- * Sets the <c>maxp</c> property on this annotation.
+ * Sets the <c>emax</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation maxp(long value) {
- this.maxp = value;
+ public HeaderAnnotation emax(boolean value) {
+ this.emax = value;
return this;
}
- @Override /* Schema */
+ @Override /* Header */
public String minimum() {
return minimum;
}
@@ -647,12 +478,12 @@ public class SchemaAnnotation implements Schema {
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation minimum(String value) {
+ public HeaderAnnotation minimum(String value) {
this.minimum = value;
return this;
}
- @Override /* Schema */
+ @Override /* Header */
public String min() {
return min;
}
@@ -663,376 +494,344 @@ public class SchemaAnnotation implements Schema {
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation min(String value) {
+ public HeaderAnnotation min(String value) {
this.min = value;
return this;
}
- @Override /* Schema */
- public long minItems() {
- return minItems;
- }
-
- /**
- * Sets the <c>minItems</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation minItems(long value) {
- this.minItems = value;
- return this;
- }
-
- @Override /* Schema */
- public long mini() {
- return mini;
- }
-
- /**
- * Sets the <c>mini</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation mini(long value) {
- this.mini = value;
- return this;
- }
-
- @Override /* Schema */
- public long minLength() {
- return minLength;
+ @Override /* Header */
+ public boolean exclusiveMinimum() {
+ return exclusiveMinimum;
}
/**
- * Sets the <c>minLength</c> property on this annotation.
+ * Sets the <c>exclusiveMinimum</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation minLength(long value) {
- this.minLength = value;
+ public HeaderAnnotation exclusiveMinimum(boolean value) {
+ this.exclusiveMinimum = value;
return this;
}
- @Override /* Schema */
- public long minl() {
- return minl;
+ @Override /* Header */
+ public boolean emin() {
+ return emin;
}
/**
- * Sets the <c>minl</c> property on this annotation.
+ * Sets the <c>emin</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation minl(long value) {
- this.minl = value;
+ public HeaderAnnotation emin(boolean value) {
+ this.emin = value;
return this;
}
- @Override /* Schema */
- public long minProperties() {
- return minProperties;
+ @Override /* Header */
+ public long maxLength() {
+ return maxLength;
}
/**
- * Sets the <c>minProperties</c> property on this annotation.
+ * Sets the <c>maxLength</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation minProperties(long value) {
- this.minProperties = value;
+ public HeaderAnnotation maxLength(long value) {
+ this.maxLength = value;
return this;
}
- @Override /* Schema */
- public long minp() {
- return minp;
+ @Override /* Header */
+ public long maxl() {
+ return maxl;
}
/**
- * Sets the <c>minp</c> property on this annotation.
+ * Sets the <c>maxl</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation minp(long value) {
- this.minp = value;
+ public HeaderAnnotation maxl(long value) {
+ this.maxl = value;
return this;
}
- @Override /* Schema */
- public String multipleOf() {
- return multipleOf;
+ @Override /* Header */
+ public long minLength() {
+ return minLength;
}
/**
- * Sets the <c>multipleOf</c> property on this annotation.
+ * Sets the <c>minLength</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation multipleOf(String value) {
- this.multipleOf = value;
+ public HeaderAnnotation minLength(long value) {
+ this.minLength = value;
return this;
}
- @Override /* Schema */
- public String mo() {
- return mo;
+ @Override /* Header */
+ public long minl() {
+ return minl;
}
/**
- * Sets the <c>mo</c> property on this annotation.
+ * Sets the <c>minl</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation mo(String value) {
- this.mo = value;
+ public HeaderAnnotation minl(long value) {
+ this.minl = value;
return this;
}
- @Override /* Schema */
- public String on() {
- return on;
+ @Override /* Header */
+ public String pattern() {
+ return pattern;
}
/**
- * Sets the <c>on</c> property on this annotation.
+ * Sets the <c>pattern</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation on(String value) {
- this.on = value;
+ public HeaderAnnotation pattern(String value) {
+ this.pattern = value;
return this;
}
- @Override /* Schema */
- public String pattern() {
- return pattern;
+ @Override /* Header */
+ public String p() {
+ return p;
}
/**
- * Sets the <c>pattern</c> property on this annotation.
+ * Sets the <c>p</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation pattern(String value) {
- this.pattern = value;
+ public HeaderAnnotation p(String value) {
+ this.p = value;
return this;
}
- @Override /* Schema */
- public String p() {
- return p;
+ @Override /* Header */
+ public long maxItems() {
+ return maxItems;
}
/**
- * Sets the <c>p</c> property on this annotation.
+ * Sets the <c>maxItems</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation p(String value) {
- this.p = value;
+ public HeaderAnnotation maxItems(long value) {
+ this.maxItems = value;
return this;
}
- @Override /* Schema */
- public String[] properties() {
- return properties;
+ @Override /* Header */
+ public long maxi() {
+ return maxi;
}
/**
- * Sets the <c>properties</c> property on this annotation.
+ * Sets the <c>maxi</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation properties(String...value) {
- this.properties = value;
+ public HeaderAnnotation maxi(long value) {
+ this.maxi = value;
return this;
}
- @Override /* Schema */
- public boolean readOnly() {
- return readOnly;
+ @Override /* Header */
+ public long minItems() {
+ return minItems;
}
/**
- * Sets the <c>readOnly</c> property on this annotation.
+ * Sets the <c>minItems</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation readOnly(boolean value) {
- this.readOnly = value;
+ public HeaderAnnotation minItems(long value) {
+ this.minItems = value;
return this;
}
- @Override /* Schema */
- public boolean ro() {
- return ro;
+ @Override /* Header */
+ public long mini() {
+ return mini;
}
/**
- * Sets the <c>ro</c> property on this annotation.
+ * Sets the <c>mini</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation ro(boolean value) {
- this.ro = value;
+ public HeaderAnnotation mini(long value) {
+ this.mini = value;
return this;
}
- @Override /* Schema */
- public boolean required() {
- return required;
+ @Override /* Header */
+ public boolean uniqueItems() {
+ return uniqueItems;
}
/**
- * Sets the <c>required</c> property on this annotation.
+ * Sets the <c>uniqueItems</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation required(boolean value) {
- this.required = value;
+ public HeaderAnnotation uniqueItems(boolean value) {
+ this.uniqueItems = value;
return this;
}
- @Override /* Schema */
- public boolean r() {
- return r;
+ @Override /* Header */
+ public boolean ui() {
+ return ui;
}
/**
- * Sets the <c>r</c> property on this annotation.
+ * Sets the <c>ui</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation r(boolean value) {
- this.r = value;
+ public HeaderAnnotation ui(boolean value) {
+ this.ui = value;
return this;
}
- @Override /* Schema */
- public String title() {
- return title;
+ @Override /* Header */
+ public String[] _enum() {
+ return _enum;
}
/**
- * Sets the <c>title</c> property on this annotation.
+ * Sets the <c>_enum</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation title(String value) {
- this.title = value;
+ public HeaderAnnotation _enum(String[] value) {
+ this._enum = value;
return this;
}
- @Override /* Schema */
- public String type() {
- return type;
+ @Override /* Header */
+ public String[] e() {
+ return e;
}
/**
- * Sets the <c>type</c> property on this annotation.
+ * Sets the <c>e</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation type(String value) {
- this.type = value;
+ public HeaderAnnotation e(String[] value) {
+ this.e = value;
return this;
}
- @Override /* Schema */
- public String t() {
- return t;
+ @Override /* Header */
+ public String multipleOf() {
+ return multipleOf;
}
/**
- * Sets the <c>t</c> property on this annotation.
+ * Sets the <c>multipleOf</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation t(String value) {
- this.t = value;
+ public HeaderAnnotation multipleOf(String value) {
+ this.multipleOf = value;
return this;
}
- @Override /* Schema */
- public boolean uniqueItems() {
- return uniqueItems;
+ @Override /* Header */
+ public String mo() {
+ return mo;
}
/**
- * Sets the <c>uniqueItems</c> property on this annotation.
+ * Sets the <c>mo</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation uniqueItems(boolean value) {
- this.uniqueItems = value;
+ public HeaderAnnotation mo(String value) {
+ this.mo = value;
return this;
}
- @Override /* Schema */
- public boolean ui() {
- return ui;
+ @Override /* Header */
+ public String[] example() {
+ return example;
}
/**
- * Sets the <c>ui</c> property on this annotation.
+ * Sets the <c>example</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation ui(boolean value) {
- this.ui = value;
+ public HeaderAnnotation example(String[] value) {
+ this.example = value;
return this;
}
- @Override /* Schema */
- public String[] value() {
- return value;
+ @Override /* Header */
+ public String[] ex() {
+ return ex;
}
/**
- * Sets the <c>value</c> property on this annotation.
+ * Sets the <c>ex</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation value(String...value) {
- this.value = value;
+ public HeaderAnnotation ex(String[] value) {
+ this.ex = value;
return this;
}
- @Override /* Schema */
- public String[] xml() {
- return xml;
+ @Override /* Header */
+ public String[] api() {
+ return api;
}
/**
- * Sets the <c>xml</c> property on this annotation.
+ * Sets the <c>api</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation xml(String...value) {
- this.xml = value;
+ public HeaderAnnotation api(String[] value) {
+ this.api = value;
return this;
}
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/LicenseAnnotation.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/LicenseAnnotation.java
new file mode 100644
index 0000000..48e681d
--- /dev/null
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/LicenseAnnotation.java
@@ -0,0 +1,77 @@
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
+// * with the License. You may obtain a copy of the License at *
+// * *
+// * http://www.apache.org/licenses/LICENSE-2.0 *
+// * *
+// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
+// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
+// * specific language governing permissions and limitations under the License. *
+// ***************************************************************************************************************************
+package org.apache.juneau.http.annotation;
+
+import java.lang.annotation.*;
+
+/**
+ * A concrete implementation of the {@link License} annotation.
+ */
+public class LicenseAnnotation implements License {
+
+ private String name="", url="";
+ private String[] value={};
+
+ @Override /* Annotation */
+ public Class<? extends Annotation> annotationType() {
+ return License.class;
+ }
+
+ @Override /* License */
+ public String name() {
+ return name;
+ }
+
+ /**
+ * Sets the <c>name</c> property on this annotation.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ */
+ public LicenseAnnotation name(String value) {
+ this.name = value;
+ return this;
+ }
+
+ @Override /* License */
+ public String url() {
+ return url;
+ }
+
+ /**
+ * Sets the <c>url</c> property on this annotation.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ */
+ public LicenseAnnotation url(String value) {
+ this.url = value;
+ return this;
+ }
+
+ @Override /* License */
+ public String[] value() {
+ return value;
+ }
+
+ /**
+ * Sets the <c>value</c> property on this annotation.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ */
+ public LicenseAnnotation value(String[] value) {
+ this.value = value;
+ return this;
+ }
+}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jsonschema/annotation/SchemaAnnotation.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/PathAnnotation.java
similarity index 54%
copy from juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jsonschema/annotation/SchemaAnnotation.java
copy to juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/PathAnnotation.java
index 35b7e9f..9acb29e 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jsonschema/annotation/SchemaAnnotation.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/PathAnnotation.java
@@ -10,249 +10,113 @@
// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
// * specific language governing permissions and limitations under the License. *
// ***************************************************************************************************************************
-package org.apache.juneau.jsonschema.annotation;
+package org.apache.juneau.http.annotation;
import java.lang.annotation.*;
-import org.apache.juneau.*;
+import org.apache.juneau.httppart.*;
+import org.apache.juneau.jsonschema.annotation.*;
/**
- * A concrete implementation of the {@link Schema} annotation.
- *
- * <p>
- * Annotations can be applied programmatically using {@link BeanContextBuilder#annotations(Annotation...)}.
+ * A concrete implementation of the {@link Path} annotation.
*/
-public class SchemaAnnotation implements Schema {
-
- private String on = "";
-
- private String
- $ref = "",
- format = "",
- f = "",
- title = "",
- multipleOf = "",
- mo = "",
- maximum = "",
- max = "",
- minimum = "",
- min = "",
- pattern = "",
- p = "",
- type = "",
- t = "",
- collectionFormat = "",
- cf = "",
- discriminator = "";
-
- private String[]
- description = new String[0],
- d = new String[0],
- _default = new String[0],
- df = new String[0],
- _enum = new String[0],
- e = new String[0],
- allOf = new String[0],
- properties = new String[0],
- additionalProperties = new String[0],
- xml = new String[0],
- example = new String[0],
- ex = new String[0],
- examples = new String[0],
- exs = new String[0],
- value = new String[0];
-
- private boolean
- exclusiveMaximum = false,
- emax = false,
- exclusiveMinimum = false,
- emin = false,
- uniqueItems = false,
- ui = false,
- required = false,
- r = false,
- readOnly = false,
- ro = false,
- ignore = false;
-
- private long
- maxLength = -1,
- maxl = -1,
- minLength = -1,
- minl = -1,
- maxItems = -1,
- maxi = -1,
- minItems = -1,
- mini = -1,
- maxProperties = -1,
- maxp = -1,
- minProperties = -1,
- minp = -1;
-
+public class PathAnnotation implements Path {
+
+ private Class<? extends HttpPartSerializer> serializer = HttpPartSerializer.Null.class;
+ private Class<? extends HttpPartParser> parser = HttpPartParser.Null.class;
+ private String name="", n="", value="", type="", t="", format="", f="", collectionFormat="", cf="", maximum="", max="", minimum="", min="", pattern="", p="", multipleOf="", mo="";
+ private String[] description={}, d={}, _enum={}, e={}, example={}, ex={}, api={};
+ private boolean allowEmptyValue, aev,exclusiveMaximum, emax, exclusiveMinimum, emin, uniqueItems, ui;
+ private boolean required=true, r=true;
private Items items = new ItemsAnnotation();
- private ExternalDocs externalDocs = new ExternalDocsAnnotation();
-
-
- /**
- * Constructor.
- *
- * @param on The initial value for the <c>on</c> property.
- * <br>See {@link Schema#on()}
- */
- public SchemaAnnotation(String on) {
- this.on = on;
- }
+ private long maxLength=-1, maxl=-1, minLength=-1, minl=-1, maxItems=-1, maxi=-1, minItems=-1, mini=-1;
- @Override
+ @Override /* Path */ /* Annotation */
public Class<? extends Annotation> annotationType() {
- return Schema.class;
- }
-
- @Override /* Schema */
- public String[] _default() {
- return _default;
- }
-
- /**
- * Sets the <c>_default</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation _default(String...value) {
- this._default = value;
- return this;
- }
-
- @Override /* Schema */
- public String[] df() {
- return df;
- }
-
- /**
- * Sets the <c>df</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation df(String...value) {
- this.df = value;
- return this;
- }
-
- @Override /* Schema */
- public String[] _enum() {
- return _enum;
- }
-
- /**
- * Sets the <c>_enum</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation _enum(String...value) {
- this._enum = value;
- return this;
- }
-
- @Override /* Schema */
- public String[] e() {
- return e;
- }
-
- /**
- * Sets the <c>e</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation e(String...value) {
- this.e = value;
- return this;
+ return Path.class;
}
- @Override /* Schema */
- public String $ref() {
- return $ref;
+ @Override /* Path */ /* Path */
+ public Class<? extends HttpPartSerializer> serializer() {
+ return serializer;
}
/**
- * Sets the <c>$ref</c> property on this annotation.
+ * Sets the <c>serializer</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation $ref(String value) {
- this.$ref = value;
+ public PathAnnotation serializer(Class<? extends HttpPartSerializer> value) {
+ this.serializer = value;
return this;
}
- @Override /* Schema */
- public String[] additionalProperties() {
- return additionalProperties;
+ @Override /* Path */
+ public Class<? extends HttpPartParser> parser() {
+ return parser;
}
/**
- * Sets the <c>additionalProperties</c> property on this annotation.
+ * Sets the <c>parser</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation additionalProperties(String...value) {
- this.additionalProperties = value;
+ public PathAnnotation parser(Class<? extends HttpPartParser> value) {
+ this.parser = value;
return this;
}
- @Override /* Schema */
- public String[] allOf() {
- return allOf;
+ @Override /* Path */
+ public String name() {
+ return name;
}
/**
- * Sets the <c>allOf</c> property on this annotation.
+ * Sets the <c>name</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation allOf(String...value) {
- this.allOf = value;
+ public PathAnnotation name(String value) {
+ this.name = value;
return this;
}
- @Override /* Schema */
- public String collectionFormat() {
- return collectionFormat;
+ @Override /* Path */
+ public String n() {
+ return n;
}
/**
- * Sets the <c>collectionFormat</c> property on this annotation.
+ * Sets the <c>n</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation collectionFormat(String value) {
- this.collectionFormat = value;
+ public PathAnnotation n(String value) {
+ this.n = value;
return this;
}
- @Override /* Schema */
- public String cf() {
- return cf;
+ @Override /* Path */
+ public String value() {
+ return value;
}
/**
- * Sets the <c>cf</c> property on this annotation.
+ * Sets the <c>value</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation cf(String value) {
- this.cf = value;
+ public PathAnnotation value(String value) {
+ this.value = value;
return this;
}
- @Override /* Schema */
+ @Override /* Path */
public String[] description() {
return description;
}
@@ -263,12 +127,12 @@ public class SchemaAnnotation implements Schema {
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation description(String...value) {
+ public PathAnnotation description(String[] value) {
this.description = value;
return this;
}
- @Override /* Schema */
+ @Override /* Path */
public String[] d() {
return d;
}
@@ -279,172 +143,76 @@ public class SchemaAnnotation implements Schema {
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation d(String...value) {
+ public PathAnnotation d(String[] value) {
this.d = value;
return this;
}
- @Override /* Schema */
- public String discriminator() {
- return discriminator;
- }
-
- /**
- * Sets the <c>discriminator</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation discriminator(String value) {
- this.discriminator = value;
- return this;
- }
-
- @Override /* Schema */
- public String[] example() {
- return example;
- }
-
- /**
- * Sets the <c>example</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation example(String...value) {
- this.example = value;
- return this;
- }
-
- @Override /* Schema */
- public String[] ex() {
- return ex;
- }
-
- /**
- * Sets the <c>ex</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation ex(String...value) {
- this.ex = value;
- return this;
- }
-
- @Override /* Schema */
- public String[] examples() {
- return examples;
- }
-
- /**
- * Sets the <c>examples</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation examples(String...value) {
- this.examples = value;
- return this;
- }
-
- @Override /* Schema */
- public String[] exs() {
- return exs;
- }
-
- /**
- * Sets the <c>exs</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation exs(String...value) {
- this.exs = value;
- return this;
- }
-
- @Override /* Schema */
- public boolean exclusiveMaximum() {
- return exclusiveMaximum;
- }
-
- /**
- * Sets the <c>exclusiveMaximum</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation exclusiveMaximum(boolean value) {
- this.exclusiveMaximum = value;
- return this;
- }
-
- @Override /* Schema */
- public boolean emax() {
- return emax;
+ @Override /* Path */
+ public boolean required() {
+ return required;
}
/**
- * Sets the <c>emax</c> property on this annotation.
+ * Sets the <c>required</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation emax(boolean value) {
- this.emax = value;
+ public PathAnnotation required(boolean value) {
+ this.required = value;
return this;
}
- @Override /* Schema */
- public boolean exclusiveMinimum() {
- return exclusiveMinimum;
+ @Override /* Path */
+ public boolean r() {
+ return r;
}
/**
- * Sets the <c>exclusiveMinimum</c> property on this annotation.
+ * Sets the <c>r</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation exclusiveMinimum(boolean value) {
- this.exclusiveMinimum = value;
+ public PathAnnotation r(boolean value) {
+ this.r = value;
return this;
}
- @Override /* Schema */
- public boolean emin() {
- return emin;
+ @Override /* Path */
+ public String type() {
+ return type;
}
/**
- * Sets the <c>emin</c> property on this annotation.
+ * Sets the <c>type</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation emin(boolean value) {
- this.emin = value;
+ public PathAnnotation type(String value) {
+ this.type = value;
return this;
}
- @Override /* Schema */
- public ExternalDocs externalDocs() {
- return externalDocs;
+ @Override /* Path */
+ public String t() {
+ return t;
}
/**
- * Sets the <c>externalDocs</c> property on this annotation.
+ * Sets the <c>t</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation externalDocs(ExternalDocs value) {
- this.externalDocs = value;
+ public PathAnnotation t(String value) {
+ this.t = value;
return this;
}
- @Override /* Schema */
+ @Override /* Path */
public String format() {
return format;
}
@@ -455,12 +223,12 @@ public class SchemaAnnotation implements Schema {
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation format(String value) {
+ public PathAnnotation format(String value) {
this.format = value;
return this;
}
- @Override /* Schema */
+ @Override /* Path */
public String f() {
return f;
}
@@ -471,172 +239,156 @@ public class SchemaAnnotation implements Schema {
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation f(String value) {
+ public PathAnnotation f(String value) {
this.f = value;
return this;
}
- @Override /* Schema */
- public boolean ignore() {
- return ignore;
+ @Override /* Path */
+ public boolean allowEmptyValue() {
+ return allowEmptyValue;
}
/**
- * Sets the <c>ignore</c> property on this annotation.
+ * Sets the <c>allowEmptyValue</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation ignore(boolean value) {
- this.ignore = value;
+ public PathAnnotation allowEmptyValue(boolean value) {
+ this.allowEmptyValue = value;
return this;
}
- @Override /* Schema */
- public Items items() {
- return items;
+ @Override /* Path */
+ public boolean aev() {
+ return aev;
}
/**
- * Sets the <c>items</c> property on this annotation.
+ * Sets the <c>aev</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation items(Items value) {
- this.items = value;
+ public PathAnnotation aev(boolean value) {
+ this.aev = value;
return this;
}
- @Override /* Schema */
- public String maximum() {
- return maximum;
- }
-
- /**
- * Sets the <c>maximum</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation maximum(String value) {
- this.maximum = value;
- return this;
- }
-
- @Override /* Schema */
- public String max() {
- return max;
+ @Override /* Path */
+ public Items items() {
+ return items;
}
/**
- * Sets the <c>max</c> property on this annotation.
+ * Sets the <c>items</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation max(String value) {
- this.max = value;
+ public PathAnnotation items(Items value) {
+ this.items = value;
return this;
}
- @Override /* Schema */
- public long maxItems() {
- return maxItems;
+ @Override /* Path */
+ public String collectionFormat() {
+ return collectionFormat;
}
/**
- * Sets the <c>maxItems</c> property on this annotation.
+ * Sets the <c>collectionFormat</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation maxItems(long value) {
- this.maxItems = value;
+ public PathAnnotation collectionFormat(String value) {
+ this.collectionFormat = value;
return this;
}
- @Override /* Schema */
- public long maxi() {
- return maxi;
+ @Override /* Path */
+ public String cf() {
+ return cf;
}
/**
- * Sets the <c>maxi</c> property on this annotation.
+ * Sets the <c>cf</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation maxi(long value) {
- this.maxi = value;
+ public PathAnnotation cf(String value) {
+ this.cf = value;
return this;
}
- @Override /* Schema */
- public long maxLength() {
- return maxLength;
+ @Override /* Path */
+ public String maximum() {
+ return maximum;
}
/**
- * Sets the <c>maxLength</c> property on this annotation.
+ * Sets the <c>maximum</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation maxLength(long value) {
- this.maxLength = value;
+ public PathAnnotation maximum(String value) {
+ this.maximum = value;
return this;
}
- @Override /* Schema */
- public long maxl() {
- return maxl;
+ @Override /* Path */
+ public String max() {
+ return max;
}
/**
- * Sets the <c>maxl</c> property on this annotation.
+ * Sets the <c>max</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation maxl(long value) {
- this.maxl = value;
+ public PathAnnotation max(String value) {
+ this.max = value;
return this;
}
- @Override /* Schema */
- public long maxProperties() {
- return maxProperties;
+ @Override /* Path */
+ public boolean exclusiveMaximum() {
+ return exclusiveMaximum;
}
/**
- * Sets the <c>maxProperties</c> property on this annotation.
+ * Sets the <c>exclusiveMaximum</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation maxProperties(long value) {
- this.maxProperties = value;
+ public PathAnnotation exclusiveMaximum(boolean value) {
+ this.exclusiveMaximum = value;
return this;
}
- @Override /* Schema */
- public long maxp() {
- return maxp;
+ @Override /* Path */
+ public boolean emax() {
+ return emax;
}
/**
- * Sets the <c>maxp</c> property on this annotation.
+ * Sets the <c>emax</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation maxp(long value) {
- this.maxp = value;
+ public PathAnnotation emax(boolean value) {
+ this.emax = value;
return this;
}
- @Override /* Schema */
+ @Override /* Path */
public String minimum() {
return minimum;
}
@@ -647,12 +399,12 @@ public class SchemaAnnotation implements Schema {
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation minimum(String value) {
+ public PathAnnotation minimum(String value) {
this.minimum = value;
return this;
}
- @Override /* Schema */
+ @Override /* Path */
public String min() {
return min;
}
@@ -663,376 +415,344 @@ public class SchemaAnnotation implements Schema {
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation min(String value) {
+ public PathAnnotation min(String value) {
this.min = value;
return this;
}
- @Override /* Schema */
- public long minItems() {
- return minItems;
- }
-
- /**
- * Sets the <c>minItems</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation minItems(long value) {
- this.minItems = value;
- return this;
- }
-
- @Override /* Schema */
- public long mini() {
- return mini;
- }
-
- /**
- * Sets the <c>mini</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation mini(long value) {
- this.mini = value;
- return this;
- }
-
- @Override /* Schema */
- public long minLength() {
- return minLength;
+ @Override /* Path */
+ public boolean exclusiveMinimum() {
+ return exclusiveMinimum;
}
/**
- * Sets the <c>minLength</c> property on this annotation.
+ * Sets the <c>exclusiveMinimum</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation minLength(long value) {
- this.minLength = value;
+ public PathAnnotation exclusiveMinimum(boolean value) {
+ this.exclusiveMinimum = value;
return this;
}
- @Override /* Schema */
- public long minl() {
- return minl;
+ @Override /* Path */
+ public boolean emin() {
+ return emin;
}
/**
- * Sets the <c>minl</c> property on this annotation.
+ * Sets the <c>emin</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation minl(long value) {
- this.minl = value;
+ public PathAnnotation emin(boolean value) {
+ this.emin = value;
return this;
}
- @Override /* Schema */
- public long minProperties() {
- return minProperties;
+ @Override /* Path */
+ public long maxLength() {
+ return maxLength;
}
/**
- * Sets the <c>minProperties</c> property on this annotation.
+ * Sets the <c>maxLength</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation minProperties(long value) {
- this.minProperties = value;
+ public PathAnnotation maxLength(long value) {
+ this.maxLength = value;
return this;
}
- @Override /* Schema */
- public long minp() {
- return minp;
+ @Override /* Path */
+ public long maxl() {
+ return maxl;
}
/**
- * Sets the <c>minp</c> property on this annotation.
+ * Sets the <c>maxl</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation minp(long value) {
- this.minp = value;
+ public PathAnnotation maxl(long value) {
+ this.maxl = value;
return this;
}
- @Override /* Schema */
- public String multipleOf() {
- return multipleOf;
+ @Override /* Path */
+ public long minLength() {
+ return minLength;
}
/**
- * Sets the <c>multipleOf</c> property on this annotation.
+ * Sets the <c>minLength</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation multipleOf(String value) {
- this.multipleOf = value;
+ public PathAnnotation minLength(long value) {
+ this.minLength = value;
return this;
}
- @Override /* Schema */
- public String mo() {
- return mo;
+ @Override /* Path */
+ public long minl() {
+ return minl;
}
/**
- * Sets the <c>mo</c> property on this annotation.
+ * Sets the <c>minl</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation mo(String value) {
- this.mo = value;
+ public PathAnnotation minl(long value) {
+ this.minl = value;
return this;
}
- @Override /* Schema */
- public String on() {
- return on;
+ @Override /* Path */
+ public String pattern() {
+ return pattern;
}
/**
- * Sets the <c>on</c> property on this annotation.
+ * Sets the <c>pattern</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation on(String value) {
- this.on = value;
+ public PathAnnotation pattern(String value) {
+ this.pattern = value;
return this;
}
- @Override /* Schema */
- public String pattern() {
- return pattern;
+ @Override /* Path */
+ public String p() {
+ return p;
}
/**
- * Sets the <c>pattern</c> property on this annotation.
+ * Sets the <c>p</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation pattern(String value) {
- this.pattern = value;
+ public PathAnnotation p(String value) {
+ this.p = value;
return this;
}
- @Override /* Schema */
- public String p() {
- return p;
+ @Override /* Path */
+ public long maxItems() {
+ return maxItems;
}
/**
- * Sets the <c>p</c> property on this annotation.
+ * Sets the <c>maxItems</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation p(String value) {
- this.p = value;
+ public PathAnnotation maxItems(long value) {
+ this.maxItems = value;
return this;
}
- @Override /* Schema */
- public String[] properties() {
- return properties;
+ @Override /* Path */
+ public long maxi() {
+ return maxi;
}
/**
- * Sets the <c>properties</c> property on this annotation.
+ * Sets the <c>maxi</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation properties(String...value) {
- this.properties = value;
+ public PathAnnotation maxi(long value) {
+ this.maxi = value;
return this;
}
- @Override /* Schema */
- public boolean readOnly() {
- return readOnly;
+ @Override /* Path */
+ public long minItems() {
+ return minItems;
}
/**
- * Sets the <c>readOnly</c> property on this annotation.
+ * Sets the <c>minItems</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation readOnly(boolean value) {
- this.readOnly = value;
+ public PathAnnotation minItems(long value) {
+ this.minItems = value;
return this;
}
- @Override /* Schema */
- public boolean ro() {
- return ro;
+ @Override /* Path */
+ public long mini() {
+ return mini;
}
/**
- * Sets the <c>ro</c> property on this annotation.
+ * Sets the <c>mini</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation ro(boolean value) {
- this.ro = value;
+ public PathAnnotation mini(long value) {
+ this.mini = value;
return this;
}
- @Override /* Schema */
- public boolean required() {
- return required;
+ @Override /* Path */
+ public boolean uniqueItems() {
+ return uniqueItems;
}
/**
- * Sets the <c>required</c> property on this annotation.
+ * Sets the <c>uniqueItems</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation required(boolean value) {
- this.required = value;
+ public PathAnnotation uniqueItems(boolean value) {
+ this.uniqueItems = value;
return this;
}
- @Override /* Schema */
- public boolean r() {
- return r;
+ @Override /* Path */
+ public boolean ui() {
+ return ui;
}
/**
- * Sets the <c>r</c> property on this annotation.
+ * Sets the <c>ui</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation r(boolean value) {
- this.r = value;
+ public PathAnnotation ui(boolean value) {
+ this.ui = value;
return this;
}
- @Override /* Schema */
- public String title() {
- return title;
+ @Override /* Path */
+ public String[] _enum() {
+ return _enum;
}
/**
- * Sets the <c>title</c> property on this annotation.
+ * Sets the <c>_enum</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation title(String value) {
- this.title = value;
+ public PathAnnotation _enum( String[] value) {
+ this._enum = value;
return this;
}
- @Override /* Schema */
- public String type() {
- return type;
+ @Override /* Path */
+ public String[] e() {
+ return e;
}
/**
- * Sets the <c>type</c> property on this annotation.
+ * Sets the <c>e</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation type(String value) {
- this.type = value;
+ public PathAnnotation e( String[] value) {
+ this.e = value;
return this;
}
- @Override /* Schema */
- public String t() {
- return t;
+ @Override /* Path */
+ public String multipleOf() {
+ return multipleOf;
}
/**
- * Sets the <c>t</c> property on this annotation.
+ * Sets the <c>multipleOf</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation t(String value) {
- this.t = value;
+ public PathAnnotation multipleOf(String value) {
+ this.multipleOf = value;
return this;
}
- @Override /* Schema */
- public boolean uniqueItems() {
- return uniqueItems;
+ @Override /* Path */
+ public String mo() {
+ return mo;
}
/**
- * Sets the <c>uniqueItems</c> property on this annotation.
+ * Sets the <c>mo</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation uniqueItems(boolean value) {
- this.uniqueItems = value;
+ public PathAnnotation mo(String value) {
+ this.mo = value;
return this;
}
- @Override /* Schema */
- public boolean ui() {
- return ui;
+ @Override /* Path */
+ public String[] example() {
+ return example;
}
/**
- * Sets the <c>ui</c> property on this annotation.
+ * Sets the <c>example</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation ui(boolean value) {
- this.ui = value;
+ public PathAnnotation example(String[] value) {
+ this.example = value;
return this;
}
- @Override /* Schema */
- public String[] value() {
- return value;
+ @Override /* Path */
+ public String[] ex() {
+ return ex;
}
/**
- * Sets the <c>value</c> property on this annotation.
+ * Sets the <c>ex</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation value(String...value) {
- this.value = value;
+ public PathAnnotation ex(String[] value) {
+ this.ex = value;
return this;
}
- @Override /* Schema */
- public String[] xml() {
- return xml;
+ @Override /* Path */
+ public String[] api() {
+ return api;
}
/**
- * Sets the <c>xml</c> property on this annotation.
+ * Sets the <c>api</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation xml(String...value) {
- this.xml = value;
+ public PathAnnotation api(String[] value) {
+ this.api = value;
return this;
}
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jsonschema/annotation/SchemaAnnotation.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/QueryAnnotation.java
similarity index 58%
copy from juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jsonschema/annotation/SchemaAnnotation.java
copy to juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/QueryAnnotation.java
index 35b7e9f..6f8e73e 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jsonschema/annotation/SchemaAnnotation.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/QueryAnnotation.java
@@ -10,249 +10,160 @@
// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
// * specific language governing permissions and limitations under the License. *
// ***************************************************************************************************************************
-package org.apache.juneau.jsonschema.annotation;
+package org.apache.juneau.http.annotation;
import java.lang.annotation.*;
-import org.apache.juneau.*;
+import org.apache.juneau.httppart.*;
+import org.apache.juneau.jsonschema.annotation.*;
/**
- * A concrete implementation of the {@link Schema} annotation.
- *
- * <p>
- * Annotations can be applied programmatically using {@link BeanContextBuilder#annotations(Annotation...)}.
+ * A concrete implementation of the {@link Query} annotation.
*/
-public class SchemaAnnotation implements Schema {
-
- private String on = "";
-
- private String
- $ref = "",
- format = "",
- f = "",
- title = "",
- multipleOf = "",
- mo = "",
- maximum = "",
- max = "",
- minimum = "",
- min = "",
- pattern = "",
- p = "",
- type = "",
- t = "",
- collectionFormat = "",
- cf = "",
- discriminator = "";
-
- private String[]
- description = new String[0],
- d = new String[0],
- _default = new String[0],
- df = new String[0],
- _enum = new String[0],
- e = new String[0],
- allOf = new String[0],
- properties = new String[0],
- additionalProperties = new String[0],
- xml = new String[0],
- example = new String[0],
- ex = new String[0],
- examples = new String[0],
- exs = new String[0],
- value = new String[0];
-
- private boolean
- exclusiveMaximum = false,
- emax = false,
- exclusiveMinimum = false,
- emin = false,
- uniqueItems = false,
- ui = false,
- required = false,
- r = false,
- readOnly = false,
- ro = false,
- ignore = false;
-
- private long
- maxLength = -1,
- maxl = -1,
- minLength = -1,
- minl = -1,
- maxItems = -1,
- maxi = -1,
- minItems = -1,
- mini = -1,
- maxProperties = -1,
- maxp = -1,
- minProperties = -1,
- minp = -1;
+public class QueryAnnotation implements Query {
+ private boolean skipIfEmpty, sie, multi, required, r, allowEmptyValue, aev, exclusiveMaximum, emax, exclusiveMinimum, emin, uniqueItems, ui;
+ private Class<? extends HttpPartSerializer> serializer = HttpPartSerializer.Null.class;
+ private Class<? extends HttpPartParser> parser = HttpPartParser.Null.class;
+ private String name="", n="", value="", type="", t="", format="", f="", collectionFormat="", cf="", maximum="", max="", minimum="", min="", pattern="", p="", multipleOf="", mo="";
+ private String[] description={}, d={}, _default={}, df={}, _enum={}, e={}, example={}, ex={}, api={};
private Items items = new ItemsAnnotation();
- private ExternalDocs externalDocs = new ExternalDocsAnnotation();
+ private long maxLength=-1, maxl=-1, minLength=-1, minl=-1, maxItems=-1, maxi=-1, minItems=-1, mini=-1;
-
- /**
- * Constructor.
- *
- * @param on The initial value for the <c>on</c> property.
- * <br>See {@link Schema#on()}
- */
- public SchemaAnnotation(String on) {
- this.on = on;
- }
-
- @Override
+ @Override /* Query */ /* Annotation */
public Class<? extends Annotation> annotationType() {
- return Schema.class;
+ return Query.class;
}
- @Override /* Schema */
- public String[] _default() {
- return _default;
+ @Override /* Query */ /* Query */
+ public boolean skipIfEmpty() {
+ return skipIfEmpty;
}
/**
- * Sets the <c>_default</c> property on this annotation.
+ * Sets the <c>skipIfEmpty</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation _default(String...value) {
- this._default = value;
+ public QueryAnnotation skipIfEmpty(boolean value) {
+ this.skipIfEmpty = value;
return this;
}
- @Override /* Schema */
- public String[] df() {
- return df;
+ @Override /* Query */
+ public boolean sie() {
+ return sie;
}
/**
- * Sets the <c>df</c> property on this annotation.
+ * Sets the <csie></c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation df(String...value) {
- this.df = value;
+ public QueryAnnotation sie(boolean value) {
+ this.sie = value;
return this;
}
- @Override /* Schema */
- public String[] _enum() {
- return _enum;
+ @Override /* Query */
+ public Class<? extends HttpPartSerializer> serializer() {
+ return serializer;
}
/**
- * Sets the <c>_enum</c> property on this annotation.
+ * Sets the <c>serializer</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation _enum(String...value) {
- this._enum = value;
+ public QueryAnnotation serializer(Class<? extends HttpPartSerializer> value) {
+ this.serializer = value;
return this;
}
- @Override /* Schema */
- public String[] e() {
- return e;
+ @Override /* Query */
+ public Class<? extends HttpPartParser> parser() {
+ return parser;
}
/**
- * Sets the <c>e</c> property on this annotation.
+ * Sets the <c>parser</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation e(String...value) {
- this.e = value;
+ public QueryAnnotation parser(Class<? extends HttpPartParser> value) {
+ this.parser = value;
return this;
}
- @Override /* Schema */
- public String $ref() {
- return $ref;
+ @Override /* Query */
+ public boolean multi() {
+ return multi;
}
/**
- * Sets the <c>$ref</c> property on this annotation.
+ * Sets the <c>multi</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation $ref(String value) {
- this.$ref = value;
+ public QueryAnnotation multi(boolean value) {
+ this.multi = value;
return this;
}
- @Override /* Schema */
- public String[] additionalProperties() {
- return additionalProperties;
+ @Override /* Query */
+ public String name() {
+ return name;
}
/**
- * Sets the <c>additionalProperties</c> property on this annotation.
+ * Sets the <c>name</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation additionalProperties(String...value) {
- this.additionalProperties = value;
+ public QueryAnnotation name(String value) {
+ this.name = value;
return this;
}
- @Override /* Schema */
- public String[] allOf() {
- return allOf;
+ @Override /* Query */
+ public String n() {
+ return n;
}
/**
- * Sets the <c>allOf</c> property on this annotation.
+ * Sets the <c>n</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation allOf(String...value) {
- this.allOf = value;
+ public QueryAnnotation n(String value) {
+ this.n = value;
return this;
}
- @Override /* Schema */
- public String collectionFormat() {
- return collectionFormat;
- }
-
- /**
- * Sets the <c>collectionFormat</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation collectionFormat(String value) {
- this.collectionFormat = value;
- return this;
- }
-
- @Override /* Schema */
- public String cf() {
- return cf;
+ @Override /* Query */
+ public String value() {
+ return value;
}
/**
- * Sets the <c>cf</c> property on this annotation.
+ * Sets the <c>value</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation cf(String value) {
- this.cf = value;
+ public QueryAnnotation value(String value) {
+ this.value = value;
return this;
}
- @Override /* Schema */
+ @Override /* Query */
public String[] description() {
return description;
}
@@ -263,12 +174,12 @@ public class SchemaAnnotation implements Schema {
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation description(String...value) {
+ public QueryAnnotation description(String[] value) {
this.description = value;
return this;
}
- @Override /* Schema */
+ @Override /* Query */
public String[] d() {
return d;
}
@@ -279,236 +190,220 @@ public class SchemaAnnotation implements Schema {
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation d(String...value) {
+ public QueryAnnotation d(String[] value) {
this.d = value;
return this;
}
- @Override /* Schema */
- public String discriminator() {
- return discriminator;
- }
-
- /**
- * Sets the <c>discriminator</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation discriminator(String value) {
- this.discriminator = value;
- return this;
- }
-
- @Override /* Schema */
- public String[] example() {
- return example;
+ @Override /* Query */
+ public boolean required() {
+ return required;
}
/**
- * Sets the <c>example</c> property on this annotation.
+ * Sets the <c>required</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation example(String...value) {
- this.example = value;
+ public QueryAnnotation required(boolean value) {
+ this.required = value;
return this;
}
- @Override /* Schema */
- public String[] ex() {
- return ex;
+ @Override /* Query */
+ public boolean r() {
+ return r;
}
/**
- * Sets the <c>ex</c> property on this annotation.
+ * Sets the <c>r</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation ex(String...value) {
- this.ex = value;
+ public QueryAnnotation r(boolean value) {
+ this.r = value;
return this;
}
- @Override /* Schema */
- public String[] examples() {
- return examples;
+ @Override /* Query */
+ public String type() {
+ return type;
}
/**
- * Sets the <c>examples</c> property on this annotation.
+ * Sets the <c>type</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation examples(String...value) {
- this.examples = value;
+ public QueryAnnotation type(String value) {
+ this.type = value;
return this;
}
- @Override /* Schema */
- public String[] exs() {
- return exs;
+ @Override /* Query */
+ public String t() {
+ return t;
}
/**
- * Sets the <c>exs</c> property on this annotation.
+ * Sets the <c>t</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation exs(String...value) {
- this.exs = value;
+ public QueryAnnotation t(String value) {
+ this.t = value;
return this;
}
- @Override /* Schema */
- public boolean exclusiveMaximum() {
- return exclusiveMaximum;
+ @Override /* Query */
+ public String format() {
+ return format;
}
/**
- * Sets the <c>exclusiveMaximum</c> property on this annotation.
+ * Sets the <c>format</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation exclusiveMaximum(boolean value) {
- this.exclusiveMaximum = value;
+ public QueryAnnotation format(String value) {
+ this.format = value;
return this;
}
- @Override /* Schema */
- public boolean emax() {
- return emax;
+ @Override /* Query */
+ public String f() {
+ return f;
}
/**
- * Sets the <c>emax</c> property on this annotation.
+ * Sets the <c>f</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation emax(boolean value) {
- this.emax = value;
+ public QueryAnnotation f(String value) {
+ this.f = value;
return this;
}
- @Override /* Schema */
- public boolean exclusiveMinimum() {
- return exclusiveMinimum;
+ @Override /* Query */
+ public boolean allowEmptyValue() {
+ return allowEmptyValue;
}
/**
- * Sets the <c>exclusiveMinimum</c> property on this annotation.
+ * Sets the <c>allowEmptyValue</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation exclusiveMinimum(boolean value) {
- this.exclusiveMinimum = value;
+ public QueryAnnotation allowEmptyValue(boolean value) {
+ this.allowEmptyValue = value;
return this;
}
- @Override /* Schema */
- public boolean emin() {
- return emin;
+ @Override /* Query */
+ public boolean aev() {
+ return aev;
}
/**
- * Sets the <c>emin</c> property on this annotation.
+ * Sets the <c>aev</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation emin(boolean value) {
- this.emin = value;
+ public QueryAnnotation aev(boolean value) {
+ this.aev = value;
return this;
}
- @Override /* Schema */
- public ExternalDocs externalDocs() {
- return externalDocs;
+ @Override /* Query */
+ public Items items() {
+ return items;
}
/**
- * Sets the <c>externalDocs</c> property on this annotation.
+ * Sets the <c>items</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation externalDocs(ExternalDocs value) {
- this.externalDocs = value;
+ public QueryAnnotation items(Items value) {
+ this.items = value;
return this;
}
- @Override /* Schema */
- public String format() {
- return format;
+ @Override /* Query */
+ public String collectionFormat() {
+ return collectionFormat;
}
/**
- * Sets the <c>format</c> property on this annotation.
+ * Sets the <c>collectionFormat</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation format(String value) {
- this.format = value;
+ public QueryAnnotation collectionFormat(String value) {
+ this.collectionFormat = value;
return this;
}
- @Override /* Schema */
- public String f() {
- return f;
+ @Override /* Query */
+ public String cf() {
+ return cf;
}
/**
- * Sets the <c>f</c> property on this annotation.
+ * Sets the <c>cf</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation f(String value) {
- this.f = value;
+ public QueryAnnotation cf(String value) {
+ this.cf = value;
return this;
}
- @Override /* Schema */
- public boolean ignore() {
- return ignore;
+ @Override /* Query */
+ public String[] _default() {
+ return _default;
}
/**
- * Sets the <c>ignore</c> property on this annotation.
+ * Sets the <c>_default</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation ignore(boolean value) {
- this.ignore = value;
+ public QueryAnnotation _default(String[] value) {
+ this._default = value;
return this;
}
- @Override /* Schema */
- public Items items() {
- return items;
+ @Override /* Query */
+ public String[] df() {
+ return df;
}
/**
- * Sets the <c>items</c> property on this annotation.
+ * Sets the <c>df</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation items(Items value) {
- this.items = value;
+ public QueryAnnotation df(String[] value) {
+ this.df = value;
return this;
}
- @Override /* Schema */
+ @Override /* Query */
public String maximum() {
return maximum;
}
@@ -519,12 +414,12 @@ public class SchemaAnnotation implements Schema {
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation maximum(String value) {
+ public QueryAnnotation maximum(String value) {
this.maximum = value;
return this;
}
- @Override /* Schema */
+ @Override /* Query */
public String max() {
return max;
}
@@ -535,108 +430,44 @@ public class SchemaAnnotation implements Schema {
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation max(String value) {
+ public QueryAnnotation max(String value) {
this.max = value;
return this;
}
- @Override /* Schema */
- public long maxItems() {
- return maxItems;
- }
-
- /**
- * Sets the <c>maxItems</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation maxItems(long value) {
- this.maxItems = value;
- return this;
- }
-
- @Override /* Schema */
- public long maxi() {
- return maxi;
- }
-
- /**
- * Sets the <c>maxi</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation maxi(long value) {
- this.maxi = value;
- return this;
- }
-
- @Override /* Schema */
- public long maxLength() {
- return maxLength;
- }
-
- /**
- * Sets the <c>maxLength</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation maxLength(long value) {
- this.maxLength = value;
- return this;
- }
-
- @Override /* Schema */
- public long maxl() {
- return maxl;
- }
-
- /**
- * Sets the <c>maxl</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation maxl(long value) {
- this.maxl = value;
- return this;
- }
-
- @Override /* Schema */
- public long maxProperties() {
- return maxProperties;
+ @Override /* Query */
+ public boolean exclusiveMaximum() {
+ return exclusiveMaximum;
}
/**
- * Sets the <c>maxProperties</c> property on this annotation.
+ * Sets the <cexclusiveMaximum></c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation maxProperties(long value) {
- this.maxProperties = value;
+ public QueryAnnotation exclusiveMaximum(boolean value) {
+ this.exclusiveMaximum = value;
return this;
}
- @Override /* Schema */
- public long maxp() {
- return maxp;
+ @Override /* Query */
+ public boolean emax() {
+ return emax;
}
/**
- * Sets the <c>maxp</c> property on this annotation.
+ * Sets the <c>emax</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation maxp(long value) {
- this.maxp = value;
+ public QueryAnnotation emax(boolean value) {
+ this.emax = value;
return this;
}
- @Override /* Schema */
+ @Override /* Query */
public String minimum() {
return minimum;
}
@@ -647,12 +478,12 @@ public class SchemaAnnotation implements Schema {
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation minimum(String value) {
+ public QueryAnnotation minimum(String value) {
this.minimum = value;
return this;
}
- @Override /* Schema */
+ @Override /* Query */
public String min() {
return min;
}
@@ -663,376 +494,344 @@ public class SchemaAnnotation implements Schema {
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation min(String value) {
+ public QueryAnnotation min(String value) {
this.min = value;
return this;
}
- @Override /* Schema */
- public long minItems() {
- return minItems;
- }
-
- /**
- * Sets the <c>minItems</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation minItems(long value) {
- this.minItems = value;
- return this;
- }
-
- @Override /* Schema */
- public long mini() {
- return mini;
- }
-
- /**
- * Sets the <c>mini</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation mini(long value) {
- this.mini = value;
- return this;
- }
-
- @Override /* Schema */
- public long minLength() {
- return minLength;
+ @Override /* Query */
+ public boolean exclusiveMinimum() {
+ return exclusiveMinimum;
}
/**
- * Sets the <c>minLength</c> property on this annotation.
+ * Sets the <c>exclusiveMinimum</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation minLength(long value) {
- this.minLength = value;
+ public QueryAnnotation exclusiveMinimum(boolean value) {
+ this.exclusiveMinimum = value;
return this;
}
- @Override /* Schema */
- public long minl() {
- return minl;
+ @Override /* Query */
+ public boolean emin() {
+ return emin;
}
/**
- * Sets the <c>minl</c> property on this annotation.
+ * Sets the <c>emin</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation minl(long value) {
- this.minl = value;
+ public QueryAnnotation emin(boolean value) {
+ this.emin = value;
return this;
}
- @Override /* Schema */
- public long minProperties() {
- return minProperties;
+ @Override /* Query */
+ public long maxLength() {
+ return maxLength;
}
/**
- * Sets the <c>minProperties</c> property on this annotation.
+ * Sets the <c>maxLength</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation minProperties(long value) {
- this.minProperties = value;
+ public QueryAnnotation maxLength(long value) {
+ this.maxLength = value;
return this;
}
- @Override /* Schema */
- public long minp() {
- return minp;
+ @Override /* Query */
+ public long maxl() {
+ return maxl;
}
/**
- * Sets the <c>minp</c> property on this annotation.
+ * Sets the <c>maxl</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation minp(long value) {
- this.minp = value;
+ public QueryAnnotation maxl(long value) {
+ this.maxl = value;
return this;
}
- @Override /* Schema */
- public String multipleOf() {
- return multipleOf;
+ @Override /* Query */
+ public long minLength() {
+ return minLength;
}
/**
- * Sets the <c>multipleOf</c> property on this annotation.
+ * Sets the <c>minLength</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation multipleOf(String value) {
- this.multipleOf = value;
+ public QueryAnnotation minLength(long value) {
+ this.minLength = value;
return this;
}
- @Override /* Schema */
- public String mo() {
- return mo;
+ @Override /* Query */
+ public long minl() {
+ return minl;
}
/**
- * Sets the <c>mo</c> property on this annotation.
+ * Sets the <c>minl</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation mo(String value) {
- this.mo = value;
+ public QueryAnnotation minl(long value) {
+ this.minl = value;
return this;
}
- @Override /* Schema */
- public String on() {
- return on;
+ @Override /* Query */
+ public String pattern() {
+ return pattern;
}
/**
- * Sets the <c>on</c> property on this annotation.
+ * Sets the <c>pattern</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation on(String value) {
- this.on = value;
+ public QueryAnnotation pattern(String value) {
+ this.pattern = value;
return this;
}
- @Override /* Schema */
- public String pattern() {
- return pattern;
+ @Override /* Query */
+ public String p() {
+ return p;
}
/**
- * Sets the <c>pattern</c> property on this annotation.
+ * Sets the <c>p</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation pattern(String value) {
- this.pattern = value;
+ public QueryAnnotation p(String value) {
+ this.p = value;
return this;
}
- @Override /* Schema */
- public String p() {
- return p;
+ @Override /* Query */
+ public long maxItems() {
+ return maxItems;
}
/**
- * Sets the <c>p</c> property on this annotation.
+ * Sets the <c>maxItems</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation p(String value) {
- this.p = value;
+ public QueryAnnotation maxItems(long value) {
+ this.maxItems = value;
return this;
}
- @Override /* Schema */
- public String[] properties() {
- return properties;
+ @Override /* Query */
+ public long maxi() {
+ return maxi;
}
/**
- * Sets the <c>properties</c> property on this annotation.
+ * Sets the <c>maxi</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation properties(String...value) {
- this.properties = value;
+ public QueryAnnotation maxi(long value) {
+ this.maxi = value;
return this;
}
- @Override /* Schema */
- public boolean readOnly() {
- return readOnly;
+ @Override /* Query */
+ public long minItems() {
+ return minItems;
}
/**
- * Sets the <c>readOnly</c> property on this annotation.
+ * Sets the <c>minItems</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation readOnly(boolean value) {
- this.readOnly = value;
+ public QueryAnnotation minItems(long value) {
+ this.minItems = value;
return this;
}
- @Override /* Schema */
- public boolean ro() {
- return ro;
+ @Override /* Query */
+ public long mini() {
+ return mini;
}
/**
- * Sets the <c>ro</c> property on this annotation.
+ * Sets the <c>mini</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation ro(boolean value) {
- this.ro = value;
+ public QueryAnnotation mini(long value) {
+ this.mini = value;
return this;
}
- @Override /* Schema */
- public boolean required() {
- return required;
+ @Override /* Query */
+ public boolean uniqueItems() {
+ return uniqueItems;
}
/**
- * Sets the <c>required</c> property on this annotation.
+ * Sets the <c>uniqueItems</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation required(boolean value) {
- this.required = value;
+ public QueryAnnotation uniqueItems(boolean value) {
+ this.uniqueItems = value;
return this;
}
- @Override /* Schema */
- public boolean r() {
- return r;
+ @Override /* Query */
+ public boolean ui() {
+ return ui;
}
/**
- * Sets the <c>r</c> property on this annotation.
+ * Sets the <c>ui</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation r(boolean value) {
- this.r = value;
+ public QueryAnnotation ui(boolean value) {
+ this.ui = value;
return this;
}
- @Override /* Schema */
- public String title() {
- return title;
+ @Override /* Query */
+ public String[] _enum() {
+ return _enum;
}
/**
- * Sets the <c>title</c> property on this annotation.
+ * Sets the <c>_enum</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation title(String value) {
- this.title = value;
+ public QueryAnnotation _enum(String[] value) {
+ this._enum = value;
return this;
}
- @Override /* Schema */
- public String type() {
- return type;
+ @Override /* Query */
+ public String[] e() {
+ return e;
}
/**
- * Sets the <c>type</c> property on this annotation.
+ * Sets the <c>e</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation type(String value) {
- this.type = value;
+ public QueryAnnotation e(String[] value) {
+ this.e = value;
return this;
}
- @Override /* Schema */
- public String t() {
- return t;
+ @Override /* Query */
+ public String multipleOf() {
+ return multipleOf;
}
/**
- * Sets the <c>t</c> property on this annotation.
+ * Sets the <c>multipleOf</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation t(String value) {
- this.t = value;
+ public QueryAnnotation multipleOf(String value) {
+ this.multipleOf = value;
return this;
}
- @Override /* Schema */
- public boolean uniqueItems() {
- return uniqueItems;
+ @Override /* Query */
+ public String mo() {
+ return mo;
}
/**
- * Sets the <c>uniqueItems</c> property on this annotation.
+ * Sets the <c>mo</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation uniqueItems(boolean value) {
- this.uniqueItems = value;
+ public QueryAnnotation mo(String value) {
+ this.mo = value;
return this;
}
- @Override /* Schema */
- public boolean ui() {
- return ui;
+ @Override /* Query */
+ public String[] example() {
+ return example;
}
/**
- * Sets the <c>ui</c> property on this annotation.
+ * Sets the <c>example</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation ui(boolean value) {
- this.ui = value;
+ public QueryAnnotation example(String[] value) {
+ this.example = value;
return this;
}
- @Override /* Schema */
- public String[] value() {
- return value;
+ @Override /* Query */
+ public String[] ex() {
+ return ex;
}
/**
- * Sets the <c>value</c> property on this annotation.
+ * Sets the <c>ex</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation value(String...value) {
- this.value = value;
+ public QueryAnnotation ex(String[] value) {
+ this.ex = value;
return this;
}
- @Override /* Schema */
- public String[] xml() {
- return xml;
+ @Override /* Query */
+ public String[] api() {
+ return api;
}
/**
- * Sets the <c>xml</c> property on this annotation.
+ * Sets the <c>api</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation xml(String...value) {
- this.xml = value;
+ public QueryAnnotation api(String[] value) {
+ this.api = value;
return this;
}
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Request.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Request.java
index f3309d7..91bcabc 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Request.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Request.java
@@ -147,7 +147,7 @@ public @interface Request {
* <p>
* Overrides for this part the part serializer defined on the REST client which by default is {@link OpenApiSerializer}.
*/
- Class<? extends HttpPartSerializer> partSerializer() default HttpPartSerializer.Null.class;
+ Class<? extends HttpPartSerializer> serializer() default HttpPartSerializer.Null.class;
/**
* Specifies the {@link HttpPartParser} class used for parsing strings to values.
@@ -155,5 +155,5 @@ public @interface Request {
* <p>
* Overrides for this part the part parser defined on the REST resource which by default is {@link OpenApiParser}.
*/
- Class<? extends HttpPartParser> partParser() default HttpPartParser.Null.class;
+ Class<? extends HttpPartParser> parser() default HttpPartParser.Null.class;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/RequestAnnotation.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/RequestAnnotation.java
new file mode 100644
index 0000000..34afc91
--- /dev/null
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/RequestAnnotation.java
@@ -0,0 +1,63 @@
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
+// * with the License. You may obtain a copy of the License at *
+// * *
+// * http://www.apache.org/licenses/LICENSE-2.0 *
+// * *
+// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
+// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
+// * specific language governing permissions and limitations under the License. *
+// ***************************************************************************************************************************
+package org.apache.juneau.http.annotation;
+
+import java.lang.annotation.*;
+
+import org.apache.juneau.httppart.*;
+
+/**
+ * A concrete implementation of the {@link Request} annotation.
+ */
+public class RequestAnnotation implements Request {
+
+ private Class<? extends HttpPartSerializer> serializer = HttpPartSerializer.Null.class;
+ private Class<? extends HttpPartParser> parser = HttpPartParser.Null.class;
+
+ @Override /* Annotation */
+ public Class<? extends Annotation> annotationType() {
+ return Request.class;
+ }
+
+ @Override /* Request */
+ public Class<? extends HttpPartSerializer> serializer() {
+ return serializer;
+ }
+
+ /**
+ * Sets the <c>serializer</c> property on this annotation.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ */
+ public RequestAnnotation serializer(Class<? extends HttpPartSerializer> value) {
+ this.serializer = value;
+ return this;
+ }
+
+ @Override /* Request */
+ public Class<? extends HttpPartParser> parser() {
+ return parser;
+ }
+
+ /**
+ * Sets the <c>parser</c> property on this annotation.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ */
+ public RequestAnnotation parser(Class<? extends HttpPartParser> value) {
+ this.parser = value;
+ return this;
+ }
+}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Response.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Response.java
index 02620f9..70c64a7 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Response.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/Response.java
@@ -61,7 +61,7 @@ public @interface Response {
* <p>
* Overrides for this part the part parser defined on the REST resource which by default is {@link OpenApiParser}.
*/
- Class<? extends HttpPartParser> partParser() default HttpPartParser.Null.class;
+ Class<? extends HttpPartParser> parser() default HttpPartParser.Null.class;
/**
* Specifies the {@link HttpPartSerializer} class used for serializing values to strings.
@@ -69,7 +69,7 @@ public @interface Response {
* <p>
* Overrides for this part the part serializer defined on the REST resource which by default is {@link OpenApiSerializer}.
*/
- Class<? extends HttpPartSerializer> partSerializer() default HttpPartSerializer.Null.class;
+ Class<? extends HttpPartSerializer> serializer() default HttpPartSerializer.Null.class;
/**
* The HTTP response code.
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ResponseAnnotation.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ResponseAnnotation.java
new file mode 100644
index 0000000..07f8877
--- /dev/null
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ResponseAnnotation.java
@@ -0,0 +1,244 @@
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
+// * with the License. You may obtain a copy of the License at *
+// * *
+// * http://www.apache.org/licenses/LICENSE-2.0 *
+// * *
+// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
+// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
+// * specific language governing permissions and limitations under the License. *
+// ***************************************************************************************************************************
+package org.apache.juneau.http.annotation;
+
+import java.lang.annotation.*;
+
+import org.apache.juneau.httppart.*;
+import org.apache.juneau.jsonschema.annotation.*;
+
+/**
+ * A concrete implementation of the {@link Response} annotation.
+ */
+public class ResponseAnnotation implements Response {
+
+ private Class<? extends HttpPartParser> parser = HttpPartParser.Null.class;
+ private Class<? extends HttpPartSerializer> serializer = HttpPartSerializer.Null.class;
+ private int[] code={}, value={};
+ private String[] description={}, d={}, example={}, ex={}, examples={}, exs={}, api={};
+ private Schema schema = new SchemaAnnotation();
+ private ResponseHeader[] headers={};
+
+ @Override /* Response */ /* Annotation */
+ public Class<? extends Annotation> annotationType() {
+ return Response.class;
+ }
+
+ @Override /* Response */
+ public Class<? extends HttpPartParser> parser() {
+ return parser;
+ }
+
+ /**
+ * Sets the <c>parser</c> property on this annotation.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ */
+ public ResponseAnnotation parser(Class<? extends HttpPartParser> value) {
+ this.parser = value;
+ return this;
+ }
+
+ @Override /* Response */
+ public Class<? extends HttpPartSerializer> serializer() {
+ return serializer;
+ }
+
+ /**
+ * Sets the <c>serializer</c> property on this annotation.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ */
+ public ResponseAnnotation serializer(Class<? extends HttpPartSerializer> value) {
+ this.serializer = value;
+ return this;
+ }
+
+ @Override /* Response */
+ public int[] code() {
+ return code;
+ }
+
+ /**
+ * Sets the <c>code</c> property on this annotation.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ */
+ public ResponseAnnotation code(int[] value) {
+ this.code = value;
+ return this;
+ }
+
+ @Override /* Response */
+ public int[] value() {
+ return value;
+ }
+
+ /**
+ * Sets the <c>value</c> property on this annotation.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ */
+ public ResponseAnnotation value(int[] value) {
+ this.value = value;
+ return this;
+ }
+
+ @Override /* Response */
+ public String[] description() {
+ return description;
+ }
+
+ /**
+ * Sets the <c>description</c> property on this annotation.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ */
+ public ResponseAnnotation description(String[] value) {
+ this.description = value;
+ return this;
+ }
+
+ @Override /* Response */
+ public String[] d() {
+ return d;
+ }
+
+ /**
+ * Sets the <c>d</c> property on this annotation.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ */
+ public ResponseAnnotation d(String[] value) {
+ this.d = value;
+ return this;
+ }
+
+ @Override /* Response */
+ public Schema schema() {
+ return schema;
+ }
+
+ /**
+ * Sets the <c>schema</c> property on this annotation.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ */
+ public ResponseAnnotation schema(Schema value) {
+ this.schema = value;
+ return this;
+ }
+
+ @Override /* Response */
+ public ResponseHeader[] headers() {
+ return headers;
+ }
+
+ /**
+ * Sets the <c>headers</c> property on this annotation.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ */
+ public ResponseAnnotation headers(ResponseHeader[] value) {
+ this.headers = value;
+ return this;
+ }
+
+ @Override /* Response */
+ public String[] example() {
+ return example;
+ }
+
+ /**
+ * Sets the <c>example</c> property on this annotation.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ */
+ public ResponseAnnotation example(String[] value) {
+ this.example = value;
+ return this;
+ }
+
+ @Override /* Response */
+ public String[] ex() {
+ return ex;
+ }
+
+ /**
+ * Sets the <c>ex</c> property on this annotation.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ */
+ public ResponseAnnotation ex(String[] value) {
+ this.ex = value;
+ return this;
+ }
+
+ @Override /* Response */
+ public String[] examples() {
+ return examples;
+ }
+
+ /**
+ * Sets the <c>examples</c> property on this annotation.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ */
+ public ResponseAnnotation examples(String[] value) {
+ this.examples = value;
+ return this;
+ }
+
+ @Override /* Response */
+ public String[] exs() {
+ return exs;
+ }
+
+ /**
+ * Sets the <c>exs</c> property on this annotation.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ */
+ public ResponseAnnotation exs(String[] value) {
+ this.exs = value;
+ return this;
+ }
+
+ @Override /* Response */
+ public String[] api() {
+ return api;
+ }
+
+ /**
+ * Sets the <c>api</c> property on this annotation.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ */
+ public ResponseAnnotation api(String[] value) {
+ this.api = value;
+ return this;
+ }
+}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ResponseBodyAnnotation.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ResponseBodyAnnotation.java
new file mode 100644
index 0000000..25fdf39
--- /dev/null
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ResponseBodyAnnotation.java
@@ -0,0 +1,26 @@
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
+// * with the License. You may obtain a copy of the License at *
+// * *
+// * http://www.apache.org/licenses/LICENSE-2.0 *
+// * *
+// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
+// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
+// * specific language governing permissions and limitations under the License. *
+// ***************************************************************************************************************************
+package org.apache.juneau.http.annotation;
+
+import java.lang.annotation.*;
+
+/**
+ * A concrete implementation of the {@link ResponseBody} annotation.
+ */
+public class ResponseBodyAnnotation implements ResponseBody {
+
+ @Override /* Annotation */
+ public Class<? extends Annotation> annotationType() {
+ return ResponseBody.class;
+ }
+}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jsonschema/annotation/SchemaAnnotation.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ResponseHeaderAnnotation.java
similarity index 54%
copy from juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jsonschema/annotation/SchemaAnnotation.java
copy to juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ResponseHeaderAnnotation.java
index 35b7e9f..ad9ffa3 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jsonschema/annotation/SchemaAnnotation.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ResponseHeaderAnnotation.java
@@ -10,249 +10,112 @@
// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
// * specific language governing permissions and limitations under the License. *
// ***************************************************************************************************************************
-package org.apache.juneau.jsonschema.annotation;
+package org.apache.juneau.http.annotation;
import java.lang.annotation.*;
-import org.apache.juneau.*;
+import org.apache.juneau.httppart.*;
+import org.apache.juneau.jsonschema.annotation.*;
/**
- * A concrete implementation of the {@link Schema} annotation.
- *
- * <p>
- * Annotations can be applied programmatically using {@link BeanContextBuilder#annotations(Annotation...)}.
+ * A concrete implementation of the {@link ResponseHeader} annotation.
*/
-public class SchemaAnnotation implements Schema {
-
- private String on = "";
-
- private String
- $ref = "",
- format = "",
- f = "",
- title = "",
- multipleOf = "",
- mo = "",
- maximum = "",
- max = "",
- minimum = "",
- min = "",
- pattern = "",
- p = "",
- type = "",
- t = "",
- collectionFormat = "",
- cf = "",
- discriminator = "";
-
- private String[]
- description = new String[0],
- d = new String[0],
- _default = new String[0],
- df = new String[0],
- _enum = new String[0],
- e = new String[0],
- allOf = new String[0],
- properties = new String[0],
- additionalProperties = new String[0],
- xml = new String[0],
- example = new String[0],
- ex = new String[0],
- examples = new String[0],
- exs = new String[0],
- value = new String[0];
-
- private boolean
- exclusiveMaximum = false,
- emax = false,
- exclusiveMinimum = false,
- emin = false,
- uniqueItems = false,
- ui = false,
- required = false,
- r = false,
- readOnly = false,
- ro = false,
- ignore = false;
-
- private long
- maxLength = -1,
- maxl = -1,
- minLength = -1,
- minl = -1,
- maxItems = -1,
- maxi = -1,
- minItems = -1,
- mini = -1,
- maxProperties = -1,
- maxp = -1,
- minProperties = -1,
- minp = -1;
-
+public class ResponseHeaderAnnotation implements ResponseHeader {
+
+ private int[] code={};
+ private String name="", n="", value="", type="", t="", format="", f="", collectionFormat="", cf="", $ref="", maximum="", max="", minimum="", min="", multipleOf="", mo="", pattern="", p="";
+ private Class<? extends HttpPartSerializer> serializer = HttpPartSerializer.Null.class;
+ private String[] description={}, d={}, _default={}, df={}, _enum={}, e={}, example={}, ex={}, api={};
+ private long maxLength=-1, maxl=-1, minLength=-1, minl=-1, maxItems=-1, maxi=-1, minItems=-1, mini=-1;
+ private boolean exclusiveMaximum, emax, exclusiveMinimum, emin, uniqueItems, ui;
private Items items = new ItemsAnnotation();
- private ExternalDocs externalDocs = new ExternalDocsAnnotation();
-
-
- /**
- * Constructor.
- *
- * @param on The initial value for the <c>on</c> property.
- * <br>See {@link Schema#on()}
- */
- public SchemaAnnotation(String on) {
- this.on = on;
- }
- @Override
+ @Override /* ResponseHeader */ /* Annotation */
public Class<? extends Annotation> annotationType() {
- return Schema.class;
- }
-
- @Override /* Schema */
- public String[] _default() {
- return _default;
- }
-
- /**
- * Sets the <c>_default</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation _default(String...value) {
- this._default = value;
- return this;
- }
-
- @Override /* Schema */
- public String[] df() {
- return df;
- }
-
- /**
- * Sets the <c>df</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation df(String...value) {
- this.df = value;
- return this;
+ return ResponseHeader.class;
}
- @Override /* Schema */
- public String[] _enum() {
- return _enum;
+ @Override /* ResponseHeader */
+ public int[] code() {
+ return code;
}
/**
- * Sets the <c>_enum</c> property on this annotation.
+ * Sets the <c>code</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation _enum(String...value) {
- this._enum = value;
+ public ResponseHeaderAnnotation code(int[] value) {
+ this.code = value;
return this;
}
- @Override /* Schema */
- public String[] e() {
- return e;
+ @Override /* ResponseHeader */
+ public String name() {
+ return name;
}
/**
- * Sets the <c>e</c> property on this annotation.
+ * Sets the <c>name</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation e(String...value) {
- this.e = value;
+ public ResponseHeaderAnnotation name(String value) {
+ this.name = value;
return this;
}
- @Override /* Schema */
- public String $ref() {
- return $ref;
+ @Override /* ResponseHeader */
+ public String n() {
+ return n;
}
/**
- * Sets the <c>$ref</c> property on this annotation.
+ * Sets the <c>n</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation $ref(String value) {
- this.$ref = value;
+ public ResponseHeaderAnnotation n(String value) {
+ this.n = value;
return this;
}
- @Override /* Schema */
- public String[] additionalProperties() {
- return additionalProperties;
- }
-
- /**
- * Sets the <c>additionalProperties</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation additionalProperties(String...value) {
- this.additionalProperties = value;
- return this;
- }
-
- @Override /* Schema */
- public String[] allOf() {
- return allOf;
- }
-
- /**
- * Sets the <c>allOf</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation allOf(String...value) {
- this.allOf = value;
- return this;
- }
-
- @Override /* Schema */
- public String collectionFormat() {
- return collectionFormat;
+ @Override /* ResponseHeader */
+ public String value() {
+ return value;
}
/**
- * Sets the <c>collectionFormat</c> property on this annotation.
+ * Sets the <c>value</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation collectionFormat(String value) {
- this.collectionFormat = value;
+ public ResponseHeaderAnnotation value(String value) {
+ this.value = value;
return this;
}
- @Override /* Schema */
- public String cf() {
- return cf;
+ @Override /* ResponseHeader */
+ public Class<? extends HttpPartSerializer> serializer() {
+ return serializer;
}
/**
- * Sets the <c>cf</c> property on this annotation.
+ * Sets the <c>serializer</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation cf(String value) {
- this.cf = value;
+ public ResponseHeaderAnnotation serializer(Class<? extends HttpPartSerializer> value) {
+ this.serializer = value;
return this;
}
- @Override /* Schema */
+ @Override /* ResponseHeader */
public String[] description() {
return description;
}
@@ -263,12 +126,12 @@ public class SchemaAnnotation implements Schema {
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation description(String...value) {
+ public ResponseHeaderAnnotation description(String[] value) {
this.description = value;
return this;
}
- @Override /* Schema */
+ @Override /* ResponseHeader */
public String[] d() {
return d;
}
@@ -279,172 +142,44 @@ public class SchemaAnnotation implements Schema {
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation d(String...value) {
+ public ResponseHeaderAnnotation d(String[] value) {
this.d = value;
return this;
}
- @Override /* Schema */
- public String discriminator() {
- return discriminator;
- }
-
- /**
- * Sets the <c>discriminator</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation discriminator(String value) {
- this.discriminator = value;
- return this;
- }
-
- @Override /* Schema */
- public String[] example() {
- return example;
- }
-
- /**
- * Sets the <c>example</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation example(String...value) {
- this.example = value;
- return this;
- }
-
- @Override /* Schema */
- public String[] ex() {
- return ex;
- }
-
- /**
- * Sets the <c>ex</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation ex(String...value) {
- this.ex = value;
- return this;
- }
-
- @Override /* Schema */
- public String[] examples() {
- return examples;
- }
-
- /**
- * Sets the <c>examples</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation examples(String...value) {
- this.examples = value;
- return this;
- }
-
- @Override /* Schema */
- public String[] exs() {
- return exs;
- }
-
- /**
- * Sets the <c>exs</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation exs(String...value) {
- this.exs = value;
- return this;
- }
-
- @Override /* Schema */
- public boolean exclusiveMaximum() {
- return exclusiveMaximum;
- }
-
- /**
- * Sets the <c>exclusiveMaximum</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation exclusiveMaximum(boolean value) {
- this.exclusiveMaximum = value;
- return this;
- }
-
- @Override /* Schema */
- public boolean emax() {
- return emax;
- }
-
- /**
- * Sets the <c>emax</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation emax(boolean value) {
- this.emax = value;
- return this;
- }
-
- @Override /* Schema */
- public boolean exclusiveMinimum() {
- return exclusiveMinimum;
- }
-
- /**
- * Sets the <c>exclusiveMinimum</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation exclusiveMinimum(boolean value) {
- this.exclusiveMinimum = value;
- return this;
- }
-
- @Override /* Schema */
- public boolean emin() {
- return emin;
+ @Override /* ResponseHeader */
+ public String type() {
+ return type;
}
/**
- * Sets the <c>emin</c> property on this annotation.
+ * Sets the <c>type</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation emin(boolean value) {
- this.emin = value;
+ public ResponseHeaderAnnotation type(String value) {
+ this.type = value;
return this;
}
- @Override /* Schema */
- public ExternalDocs externalDocs() {
- return externalDocs;
+ @Override /* ResponseHeader */
+ public String t() {
+ return t;
}
/**
- * Sets the <c>externalDocs</c> property on this annotation.
+ * Sets the <c>t</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation externalDocs(ExternalDocs value) {
- this.externalDocs = value;
+ public ResponseHeaderAnnotation t(String value) {
+ this.t = value;
return this;
}
- @Override /* Schema */
+ @Override /* ResponseHeader */
public String format() {
return format;
}
@@ -455,12 +190,12 @@ public class SchemaAnnotation implements Schema {
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation format(String value) {
+ public ResponseHeaderAnnotation format(String value) {
this.format = value;
return this;
}
- @Override /* Schema */
+ @Override /* ResponseHeader */
public String f() {
return f;
}
@@ -471,568 +206,536 @@ public class SchemaAnnotation implements Schema {
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation f(String value) {
+ public ResponseHeaderAnnotation f(String value) {
this.f = value;
return this;
}
- @Override /* Schema */
- public boolean ignore() {
- return ignore;
- }
-
- /**
- * Sets the <c>ignore</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation ignore(boolean value) {
- this.ignore = value;
- return this;
- }
-
- @Override /* Schema */
- public Items items() {
- return items;
- }
-
- /**
- * Sets the <c>items</c> property on this annotation.
- *
- * @param value The new value for this property.
- * @return This object (for method chaining).
- */
- public SchemaAnnotation items(Items value) {
- this.items = value;
- return this;
- }
-
- @Override /* Schema */
- public String maximum() {
- return maximum;
+ @Override /* ResponseHeader */
+ public String collectionFormat() {
+ return collectionFormat;
}
/**
- * Sets the <c>maximum</c> property on this annotation.
+ * Sets the <c>collectionFormat</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation maximum(String value) {
- this.maximum = value;
+ public ResponseHeaderAnnotation collectionFormat(String value) {
+ this.collectionFormat = value;
return this;
}
- @Override /* Schema */
- public String max() {
- return max;
+ @Override /* ResponseHeader */
+ public String cf() {
+ return cf;
}
/**
- * Sets the <c>max</c> property on this annotation.
+ * Sets the <c>cf</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation max(String value) {
- this.max = value;
+ public ResponseHeaderAnnotation cf(String value) {
+ this.cf = value;
return this;
}
- @Override /* Schema */
- public long maxItems() {
- return maxItems;
+ @Override /* ResponseHeader */
+ public String $ref() {
+ return $ref;
}
/**
- * Sets the <c>maxItems</c> property on this annotation.
+ * Sets the <c>$ref</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation maxItems(long value) {
- this.maxItems = value;
+ public ResponseHeaderAnnotation $ref(String value) {
+ this.$ref = value;
return this;
}
- @Override /* Schema */
- public long maxi() {
- return maxi;
+ @Override /* ResponseHeader */
+ public String maximum() {
+ return maximum;
}
/**
- * Sets the <c>maxi</c> property on this annotation.
+ * Sets the <c>maximum</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation maxi(long value) {
- this.maxi = value;
+ public ResponseHeaderAnnotation maximum(String value) {
+ this.maximum = value;
return this;
}
- @Override /* Schema */
- public long maxLength() {
- return maxLength;
+ @Override /* ResponseHeader */
+ public String max() {
+ return max;
}
/**
- * Sets the <c>maxLength</c> property on this annotation.
+ * Sets the <c>max</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation maxLength(long value) {
- this.maxLength = value;
+ public ResponseHeaderAnnotation max(String value) {
+ this.max = value;
return this;
}
- @Override /* Schema */
- public long maxl() {
- return maxl;
+ @Override /* ResponseHeader */
+ public String minimum() {
+ return minimum;
}
/**
- * Sets the <c>maxl</c> property on this annotation.
+ * Sets the <c>minimum</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation maxl(long value) {
- this.maxl = value;
+ public ResponseHeaderAnnotation minimum(String value) {
+ this.minimum = value;
return this;
}
- @Override /* Schema */
- public long maxProperties() {
- return maxProperties;
+ @Override /* ResponseHeader */
+ public String min() {
+ return min;
}
/**
- * Sets the <c>maxProperties</c> property on this annotation.
+ * Sets the <c>min</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation maxProperties(long value) {
- this.maxProperties = value;
+ public ResponseHeaderAnnotation min(String value) {
+ this.min = value;
return this;
}
- @Override /* Schema */
- public long maxp() {
- return maxp;
+ @Override /* ResponseHeader */
+ public String multipleOf() {
+ return multipleOf;
}
/**
- * Sets the <c>maxp</c> property on this annotation.
+ * Sets the <c>multipleOf</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation maxp(long value) {
- this.maxp = value;
+ public ResponseHeaderAnnotation multipleOf(String value) {
+ this.multipleOf = value;
return this;
}
- @Override /* Schema */
- public String minimum() {
- return minimum;
+ @Override /* ResponseHeader */
+ public String mo() {
+ return mo;
}
/**
- * Sets the <c>minimum</c> property on this annotation.
+ * Sets the <c>mo</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation minimum(String value) {
- this.minimum = value;
+ public ResponseHeaderAnnotation mo(String value) {
+ this.mo = value;
return this;
}
- @Override /* Schema */
- public String min() {
- return min;
+ @Override /* ResponseHeader */
+ public long maxLength() {
+ return maxLength;
}
/**
- * Sets the <c>min</c> property on this annotation.
+ * Sets the <c>maxLength</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation min(String value) {
- this.min = value;
+ public ResponseHeaderAnnotation maxLength(long value) {
+ this.maxLength = value;
return this;
}
- @Override /* Schema */
- public long minItems() {
- return minItems;
+ @Override /* ResponseHeader */
+ public long maxl() {
+ return maxl;
}
/**
- * Sets the <c>minItems</c> property on this annotation.
+ * Sets the <c>maxl</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation minItems(long value) {
- this.minItems = value;
+ public ResponseHeaderAnnotation maxl(long value) {
+ this.maxl = value;
return this;
}
- @Override /* Schema */
- public long mini() {
- return mini;
+ @Override /* ResponseHeader */
+ public long minLength() {
+ return minLength;
}
/**
- * Sets the <c>mini</c> property on this annotation.
+ * Sets the <c>minLength</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation mini(long value) {
- this.mini = value;
+ public ResponseHeaderAnnotation minLength(long value) {
+ this.minLength = value;
return this;
}
- @Override /* Schema */
- public long minLength() {
- return minLength;
+ @Override /* ResponseHeader */
+ public long minl() {
+ return minl;
}
/**
- * Sets the <c>minLength</c> property on this annotation.
+ * Sets the <c>minl</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation minLength(long value) {
- this.minLength = value;
+ public ResponseHeaderAnnotation minl(long value) {
+ this.minl = value;
return this;
}
- @Override /* Schema */
- public long minl() {
- return minl;
+ @Override /* ResponseHeader */
+ public String pattern() {
+ return pattern;
}
/**
- * Sets the <c>minl</c> property on this annotation.
+ * Sets the <c>pattern</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation minl(long value) {
- this.minl = value;
+ public ResponseHeaderAnnotation pattern(String value) {
+ this.pattern = value;
return this;
}
- @Override /* Schema */
- public long minProperties() {
- return minProperties;
+ @Override /* ResponseHeader */
+ public String p() {
+ return p;
}
/**
- * Sets the <c>minProperties</c> property on this annotation.
+ * Sets the <c>p</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation minProperties(long value) {
- this.minProperties = value;
+ public ResponseHeaderAnnotation p(String value) {
+ this.p = value;
return this;
}
- @Override /* Schema */
- public long minp() {
- return minp;
+ @Override /* ResponseHeader */
+ public long maxItems() {
+ return maxItems;
}
/**
- * Sets the <c>minp</c> property on this annotation.
+ * Sets the <c>maxItems</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation minp(long value) {
- this.minp = value;
+ public ResponseHeaderAnnotation maxItems(long value) {
+ this.maxItems = value;
return this;
}
- @Override /* Schema */
- public String multipleOf() {
- return multipleOf;
+ @Override /* ResponseHeader */
+ public long maxi() {
+ return maxi;
}
/**
- * Sets the <c>multipleOf</c> property on this annotation.
+ * Sets the <c>maxi</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation multipleOf(String value) {
- this.multipleOf = value;
+ public ResponseHeaderAnnotation maxi(long value) {
+ this.maxi = value;
return this;
}
- @Override /* Schema */
- public String mo() {
- return mo;
+ @Override /* ResponseHeader */
+ public long minItems() {
+ return minItems;
}
/**
- * Sets the <c>mo</c> property on this annotation.
+ * Sets the <c>minItems</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation mo(String value) {
- this.mo = value;
+ public ResponseHeaderAnnotation minItems(long value) {
+ this.minItems = value;
return this;
}
- @Override /* Schema */
- public String on() {
- return on;
+ @Override /* ResponseHeader */
+ public long mini() {
+ return mini;
}
/**
- * Sets the <c>on</c> property on this annotation.
+ * Sets the <c>mini</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation on(String value) {
- this.on = value;
+ public ResponseHeaderAnnotation mini(long value) {
+ this.mini = value;
return this;
}
- @Override /* Schema */
- public String pattern() {
- return pattern;
+ @Override /* ResponseHeader */
+ public boolean exclusiveMaximum() {
+ return exclusiveMaximum;
}
/**
- * Sets the <c>pattern</c> property on this annotation.
+ * Sets the <c>exclusiveMaximum</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation pattern(String value) {
- this.pattern = value;
+ public ResponseHeaderAnnotation exclusiveMaximum(boolean value) {
+ this.exclusiveMaximum = value;
return this;
}
- @Override /* Schema */
- public String p() {
- return p;
+ @Override /* ResponseHeader */
+ public boolean emax() {
+ return emax;
}
/**
- * Sets the <c>p</c> property on this annotation.
+ * Sets the <c>emax</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation p(String value) {
- this.p = value;
+ public ResponseHeaderAnnotation emax(boolean value) {
+ this.emax = value;
return this;
}
- @Override /* Schema */
- public String[] properties() {
- return properties;
+ @Override /* ResponseHeader */
+ public boolean exclusiveMinimum() {
+ return exclusiveMinimum;
}
/**
- * Sets the <c>properties</c> property on this annotation.
+ * Sets the <c>exclusiveMinimum</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation properties(String...value) {
- this.properties = value;
+ public ResponseHeaderAnnotation exclusiveMinimum(boolean value) {
+ this.exclusiveMinimum = value;
return this;
}
- @Override /* Schema */
- public boolean readOnly() {
- return readOnly;
+ @Override /* ResponseHeader */
+ public boolean emin() {
+ return emin;
}
/**
- * Sets the <c>readOnly</c> property on this annotation.
+ * Sets the <c>emin</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation readOnly(boolean value) {
- this.readOnly = value;
+ public ResponseHeaderAnnotation emin(boolean value) {
+ this.emin = value;
return this;
}
- @Override /* Schema */
- public boolean ro() {
- return ro;
+ @Override /* ResponseHeader */
+ public boolean uniqueItems() {
+ return uniqueItems;
}
/**
- * Sets the <c>ro</c> property on this annotation.
+ * Sets the <c>uniqueItems</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation ro(boolean value) {
- this.ro = value;
+ public ResponseHeaderAnnotation uniqueItems(boolean value) {
+ this.uniqueItems = value;
return this;
}
- @Override /* Schema */
- public boolean required() {
- return required;
+ @Override /* ResponseHeader */
+ public boolean ui() {
+ return ui;
}
/**
- * Sets the <c>required</c> property on this annotation.
+ * Sets the <c>ui</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation required(boolean value) {
- this.required = value;
+ public ResponseHeaderAnnotation ui(boolean value) {
+ this.ui = value;
return this;
}
- @Override /* Schema */
- public boolean r() {
- return r;
+ @Override /* ResponseHeader */
+ public Items items() {
+ return items;
}
/**
- * Sets the <c>r</c> property on this annotation.
+ * Sets the <c>items</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation r(boolean value) {
- this.r = value;
+ public ResponseHeaderAnnotation items(Items value) {
+ this.items = value;
return this;
}
- @Override /* Schema */
- public String title() {
- return title;
+ @Override /* ResponseHeader */
+ public String[] _default() {
+ return _default;
}
/**
- * Sets the <c>title</c> property on this annotation.
+ * Sets the <c>_default</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation title(String value) {
- this.title = value;
+ public ResponseHeaderAnnotation _default(String[] value) {
+ this._default = value;
return this;
}
- @Override /* Schema */
- public String type() {
- return type;
+ @Override /* ResponseHeader */
+ public String[] df() {
+ return df;
}
/**
- * Sets the <c>type</c> property on this annotation.
+ * Sets the <c>df</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation type(String value) {
- this.type = value;
+ public ResponseHeaderAnnotation df(String[] value) {
+ this.df = value;
return this;
}
- @Override /* Schema */
- public String t() {
- return t;
+ @Override /* ResponseHeader */
+ public String[] _enum() {
+ return _enum;
}
/**
- * Sets the <c>t</c> property on this annotation.
+ * Sets the <c>_enum</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation t(String value) {
- this.t = value;
+ public ResponseHeaderAnnotation _enum(String[] value) {
+ this._enum = value;
return this;
}
- @Override /* Schema */
- public boolean uniqueItems() {
- return uniqueItems;
+ @Override /* ResponseHeader */
+ public String[] e() {
+ return e;
}
/**
- * Sets the <c>uniqueItems</c> property on this annotation.
+ * Sets the <c>e</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation uniqueItems(boolean value) {
- this.uniqueItems = value;
+ public ResponseHeaderAnnotation e(String[] value) {
+ this.e = value;
return this;
}
- @Override /* Schema */
- public boolean ui() {
- return ui;
+ @Override /* ResponseHeader */
+ public String[] example() {
+ return example;
}
/**
- * Sets the <c>ui</c> property on this annotation.
+ * Sets the <c>example</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation ui(boolean value) {
- this.ui = value;
+ public ResponseHeaderAnnotation example(String[] value) {
+ this.example = value;
return this;
}
- @Override /* Schema */
- public String[] value() {
- return value;
+ @Override /* ResponseHeader */
+ public String[] ex() {
+ return ex;
}
/**
- * Sets the <c>value</c> property on this annotation.
+ * Sets the <c>ex</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation value(String...value) {
- this.value = value;
+ public ResponseHeaderAnnotation ex(String[] value) {
+ this.ex = value;
return this;
}
- @Override /* Schema */
- public String[] xml() {
- return xml;
+ @Override /* ResponseHeader */
+ public String[] api() {
+ return api;
}
/**
- * Sets the <c>xml</c> property on this annotation.
+ * Sets the <c>api</c> property on this annotation.
*
* @param value The new value for this property.
* @return This object (for method chaining).
*/
- public SchemaAnnotation xml(String...value) {
- this.xml = value;
+ public ResponseHeaderAnnotation api(String[] value) {
+ this.api = value;
return this;
}
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ResponseStatusAnnotation.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ResponseStatusAnnotation.java
new file mode 100644
index 0000000..c34a471
--- /dev/null
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/ResponseStatusAnnotation.java
@@ -0,0 +1,26 @@
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
+// * with the License. You may obtain a copy of the License at *
+// * *
+// * http://www.apache.org/licenses/LICENSE-2.0 *
+// * *
+// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
+// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
+// * specific language governing permissions and limitations under the License. *
+// ***************************************************************************************************************************
+package org.apache.juneau.http.annotation;
+
+import java.lang.annotation.*;
+
+/**
+ * A concrete implementation of the {@link ResponseStatus} annotation.
+ */
+public class ResponseStatusAnnotation implements ResponseStatus {
+
+ @Override /* Annotation */
+ public Class<? extends Annotation> annotationType() {
+ return ResponseStatus.class;
+ }
+}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/TagAnnotation.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/TagAnnotation.java
new file mode 100644
index 0000000..0062a9f
--- /dev/null
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/annotation/TagAnnotation.java
@@ -0,0 +1,95 @@
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
+// * with the License. You may obtain a copy of the License at *
+// * *
+// * http://www.apache.org/licenses/LICENSE-2.0 *
+// * *
+// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
+// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
+// * specific language governing permissions and limitations under the License. *
+// ***************************************************************************************************************************
+package org.apache.juneau.http.annotation;
+
+import java.lang.annotation.*;
+
+import org.apache.juneau.jsonschema.annotation.*;
+
+/**
+ * A concrete implementation of the {@link Tag} annotation.
+ */
+public class TagAnnotation implements Tag {
+
+ private String name="";
+ private String[] description={}, value={};
+ private ExternalDocs externalDocs = new ExternalDocsAnnotation();
+
+ @Override /* Annotation */
+ public Class<? extends Annotation> annotationType() {
+ return Tag.class;
+ }
+
+ @Override /* Tag */
+ public String name() {
+ return name;
+ }
+
+ /**
+ * Sets the <c>name</c> property on this annotation.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ */
+ public TagAnnotation name(String value) {
+ this.name = value;
+ return this;
+ }
+
+ @Override /* Tag */
+ public String[] description() {
+ return description;
+ }
+
+ /**
+ * Sets the <c>description</c> property on this annotation.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ */
+ public TagAnnotation description(String[] value) {
+ this.description = value;
+ return this;
+ }
+
+ @Override /* Tag */
+ public ExternalDocs externalDocs() {
+ return externalDocs;
+ }
+
+ /**
+ * Sets the <c>externalDocs</c> property on this annotation.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ */
+ public TagAnnotation externalDocs(ExternalDocs value) {
+ this.externalDocs = value;
+ return this;
+ }
+
+ @Override /* Tag */
+ public String[] value() {
+ return value;
+ }
+ /**
+ * Sets the <c></c> property on this annotation.
+ *
+ * @param value The new value for this property.
+ * @return This object (for method chaining).
+ */
+ public TagAnnotation value(String[] value) {
+ this.value = value;
+ return this;
+ }
+}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/header/Accept.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/header/Accept.java
index 2bd9bfe..7470252 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/header/Accept.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/http/header/Accept.java
@@ -276,7 +276,7 @@ public class Accept extends BasicParameterizedArrayHeader {
* @return The index into the array of the best match, or <c>-1</c> if no suitable matches could be found.
*/
public int findMatch(List<? extends MediaType> mediaTypes) {
- return getRanges().findMatch(mediaTypes);
+ return getRanges().match(mediaTypes);
}
private MediaRanges getRanges() {
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartSchemaBuilder.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartSchemaBuilder.java
index c350d4f..75b4e1b 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartSchemaBuilder.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartSchemaBuilder.java
@@ -270,8 +270,8 @@ public class HttpPartSchemaBuilder {
codes(a.code());
required(false);
allowEmptyValue(true);
- serializer(a.partSerializer());
- parser(a.partParser());
+ serializer(a.serializer());
+ parser(a.parser());
apply(a.schema());
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartSerializer.java
index fdd8315..6a909b0 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/HttpPartSerializer.java
@@ -35,8 +35,8 @@ import org.apache.juneau.serializer.*;
* <li class='ja'>{@link Query#serializer()}
* <li class='ja'>{@link Header#serializer()}
* <li class='ja'>{@link Path#serializer()}
- * <li class='ja'>{@link Request#partSerializer()}
- * <li class='ja'>{@link Response#partSerializer()}
+ * <li class='ja'>{@link Request#serializer()}
+ * <li class='ja'>{@link Response#serializer()}
* <li class='jc'><c>RestClientBuilder.partSerializer(Class)</c>
* </ul>
*
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/bean/RequestBeanMeta.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/bean/RequestBeanMeta.java
index e176cc7..58339ee 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/bean/RequestBeanMeta.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/bean/RequestBeanMeta.java
@@ -130,10 +130,10 @@ public class RequestBeanMeta {
Builder apply(Request a) {
if (a != null) {
- if (a.partSerializer() != HttpPartSerializer.Null.class)
- serializer = a.partSerializer();
- if (a.partParser() != HttpPartParser.Null.class)
- parser = a.partParser();
+ if (a.serializer() != HttpPartSerializer.Null.class)
+ serializer = a.serializer();
+ if (a.parser() != HttpPartParser.Null.class)
+ parser = a.parser();
}
return this;
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/bean/ResponseBeanMeta.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/bean/ResponseBeanMeta.java
index 61cbaac..c2fd1c9 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/bean/ResponseBeanMeta.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/httppart/bean/ResponseBeanMeta.java
@@ -182,10 +182,10 @@ public class ResponseBeanMeta {
Builder apply(Response a) {
if (a != null) {
- if (a.partSerializer() != HttpPartSerializer.Null.class)
- partSerializer = a.partSerializer();
- if (a.partParser() != HttpPartParser.Null.class)
- partParser = a.partParser();
+ if (a.serializer() != HttpPartSerializer.Null.class)
+ partSerializer = a.serializer();
+ if (a.parser() != HttpPartParser.Null.class)
+ partParser = a.parser();
if (a.value().length > 0)
code = a.value()[0];
if (a.code().length > 0)
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jsonschema/annotation/SchemaAnnotation.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jsonschema/annotation/SchemaAnnotation.java
index 35b7e9f..171a11e 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jsonschema/annotation/SchemaAnnotation.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/jsonschema/annotation/SchemaAnnotation.java
@@ -103,6 +103,11 @@ public class SchemaAnnotation implements Schema {
this.on = on;
}
+ /**
+ * Constructor.
+ */
+ public SchemaAnnotation() {}
+
@Override
public Class<? extends Annotation> annotationType() {
return Schema.class;
diff --git a/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/http/HttpMethodName_Test.java b/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/http/HttpMethodName_Test.java
new file mode 100644
index 0000000..fc5e7d9
--- /dev/null
+++ b/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/http/HttpMethodName_Test.java
@@ -0,0 +1,27 @@
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
+// * with the License. You may obtain a copy of the License at *
+// * *
+// * http://www.apache.org/licenses/LICENSE-2.0 *
+// * *
+// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
+// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
+// * specific language governing permissions and limitations under the License. *
+// ***************************************************************************************************************************
+package org.apache.juneau.http;
+
+import static org.junit.runners.MethodSorters.*;
+
+import org.junit.*;
+
+@FixMethodOrder(NAME_ASCENDING)
+public class HttpMethodName_Test {
+
+ @SuppressWarnings("deprecation")
+ @Test
+ public void a01_basic() throws Exception {
+ new HttpMethodName();
+ }
+}
diff --git a/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/http/StringRange_Test.java b/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/http/StringRange_Test.java
new file mode 100644
index 0000000..c339b67
--- /dev/null
+++ b/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/http/StringRange_Test.java
@@ -0,0 +1,50 @@
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
+// * with the License. You may obtain a copy of the License at *
+// * *
+// * http://www.apache.org/licenses/LICENSE-2.0 *
+// * *
+// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
+// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
+// * specific language governing permissions and limitations under the License. *
+// ***************************************************************************************************************************
+package org.apache.juneau.http;
+
+import static org.junit.runners.MethodSorters.*;
+
+import static org.apache.juneau.assertions.Assertions.*;
+
+import org.junit.*;
+
+@FixMethodOrder(NAME_ASCENDING)
+public class StringRange_Test {
+
+ @Test
+ public void a01_basic() throws Exception {
+ StringRange x1 = new StringRange("foo;a=1;q=0.5;b=2");
+ assertString(x1.getQValue()).is("0.5");
+ assertObject(x1.getExtensions()).json().is("['a=1','b=2']");
+
+ StringRange x2 = new StringRange("foo;q=1.0");
+ assertString(x2.getQValue()).is("1.0");
+ assertObject(x2.getExtensions()).json().is("[]");
+
+ StringRange x3 = new StringRange("foo;a=1");
+ assertString(x3.getQValue()).is("1.0");
+ assertObject(x3.getExtensions()).json().is("['a=1']");
+
+ StringRange x4 = new StringRange("foo;a=1");
+ assertObject(x3).is(x4);
+ assertObject(x3).isNot(x2);
+ assertObject(x3).isNot("foo");
+ assertObject(x3.hashCode()).is(x4.hashCode());
+
+ StringRange x5 = new StringRange((String)null);
+ assertString(x5).is("*");
+
+ StringRange x6 = new StringRange("foo;q=0");
+ assertString(x6.match("foo")).is("0");
+ }
+}
diff --git a/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/http/StringRanges_Test.java b/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/http/StringRanges_Test.java
new file mode 100644
index 0000000..e37abe5
--- /dev/null
+++ b/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/http/StringRanges_Test.java
@@ -0,0 +1,51 @@
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
+// * with the License. You may obtain a copy of the License at *
+// * *
+// * http://www.apache.org/licenses/LICENSE-2.0 *
+// * *
+// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
+// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
+// * specific language governing permissions and limitations under the License. *
+// ***************************************************************************************************************************
+package org.apache.juneau.http;
+
+import static org.junit.runners.MethodSorters.*;
+
+import java.util.*;
+
+import org.apache.juneau.collections.*;
+
+import static org.apache.juneau.assertions.Assertions.*;
+import static org.apache.juneau.http.StringRanges.*;
+
+import org.junit.*;
+
+@FixMethodOrder(NAME_ASCENDING)
+public class StringRanges_Test {
+
+ @Test
+ public void a01_basic() throws Exception {
+ List<String> x = AList.of("foo","bar","baz");
+
+ assertInteger(of(null).match(x)).is(0);
+
+ assertInteger(of("foo;q=0.5,bar").match(x)).is(1);
+ assertInteger(of("foo;q=0.6,bar;q=0.5").match(x)).is(0);
+ assertInteger(of("foo;q=0.6,bar;q=0.5,qux").match(x)).is(0);
+ assertInteger(of("qux").match(x)).is(-1);
+ assertInteger(of("qux,q2x;q=0").match(x)).is(-1);
+ assertInteger(of("foo;q=0").match(x)).is(-1);
+
+ assertString(of(null).getRange(0)).is("*");
+ assertString(of("").getRange(0)).is("*");
+ assertString(of(null).getRange(-1)).doesNotExist();
+ assertString(of(null).getRange(1)).doesNotExist();
+
+ assertString(new StringRange("*")).is("*");
+
+ assertString(of("foo;q=0.6,bar;q=0.9,qux")).is("qux,bar;q=0.9,foo;q=0.6");
+ }
+}
diff --git a/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/http/annotation/AnnotationUtilsTest.java b/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/http/annotation/AnnotationUtilsTest.java
deleted file mode 100644
index 0db94ad..0000000
--- a/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/http/annotation/AnnotationUtilsTest.java
+++ /dev/null
@@ -1,143 +0,0 @@
-// ***************************************************************************************************************************
-// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
-// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
-// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
-// * with the License. You may obtain a copy of the License at *
-// * *
-// * http://www.apache.org/licenses/LICENSE-2.0 *
-// * *
-// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
-// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
-// * specific language governing permissions and limitations under the License. *
-// ***************************************************************************************************************************
-package org.apache.juneau.http.annotation;
-
-import static org.junit.Assert.*;
-import static org.junit.runners.MethodSorters.*;
-import static java.lang.annotation.ElementType.*;
-import static java.lang.annotation.RetentionPolicy.*;
-import static org.apache.juneau.http.annotation.AnnotationUtils.*;
-
-import org.apache.juneau.jsonschema.annotation.ExternalDocs;
-import org.apache.juneau.jsonschema.annotation.Schema;
-import org.apache.juneau.jsonschema.annotation.SubItems;
-import org.apache.juneau.jsonschema.annotation.Items;
-import java.lang.annotation.*;
-import java.lang.reflect.*;
-
-import org.junit.*;
-
-@FixMethodOrder(NAME_ASCENDING)
-public class AnnotationUtilsTest {
-
- //-----------------------------------------------------------------------------------------------------------------
- // Test empty checks
- //-----------------------------------------------------------------------------------------------------------------
-
- @Target(TYPE)
- @Retention(RUNTIME)
- public @interface X {
- Contact x1() default @Contact;
- ExternalDocs x2() default @ExternalDocs;
- License x3() default @License;
- Schema x4() default @Schema;
- SubItems x5() default @SubItems;
- Items x6() default @Items;
- }
-
- @Body
- @Response
- @ResponseHeader
- @X
- public static class A01 {
- @Query @Header @FormData @Path @Schema
- public int f1;
- }
-
- @Test
- public void testEmpty() throws Exception {
- assertTrue(empty(A01.class.getAnnotation(Body.class)));
- assertTrue(empty(A01.class.getAnnotation(Response.class)));
- assertTrue(empty(A01.class.getAnnotation(ResponseHeader.class)));
-
- X x = A01.class.getAnnotation(X.class);
- assertTrue(empty(x.x1()));
- assertTrue(empty(x.x2()));
- assertTrue(empty(x.x3()));
- assertTrue(empty(x.x4()));
- assertTrue(empty(x.x5()));
- assertTrue(empty(x.x6()));
-
- Field f = A01.class.getField("f1");
- assertTrue(empty(f.getAnnotation(Query.class)));
- assertTrue(empty(f.getAnnotation(Header.class)));
- assertTrue(empty(f.getAnnotation(FormData.class)));
- assertTrue(empty(f.getAnnotation(Path.class)));
- }
-
- public static class B01 {
- public int f1;
- }
-
- @Test
- public void testEmptyNonExistent() throws Exception {
- assertTrue(empty(B01.class.getAnnotation(Body.class)));
- assertTrue(empty(B01.class.getAnnotation(Response.class)));
- assertTrue(empty(B01.class.getAnnotation(ResponseHeader.class)));
-
- assertTrue(empty((Contact)null));
- assertTrue(empty((ExternalDocs)null));
- assertTrue(empty((License)null));
- assertTrue(empty((Schema)null));
- assertTrue(empty((Items)null));
- assertTrue(empty((SubItems)null));
-
- Field f = B01.class.getField("f1");
- assertTrue(empty(f.getAnnotation(Query.class)));
- assertTrue(empty(f.getAnnotation(Header.class)));
- assertTrue(empty(f.getAnnotation(FormData.class)));
- assertTrue(empty(f.getAnnotation(Path.class)));
- }
-
- @Test
- public void testAllEmpty1() {
- assertTrue(allEmpty(new String[0]));
- assertTrue(allEmpty(""));
- assertTrue(allEmpty(null,""));
- assertFalse(allEmpty(null,"","x"));
- }
-
- @Test
- public void testAllEmpty2() {
- assertTrue(allEmpty(new String[0],new String[0]));
- assertTrue(allEmpty(null,new String[0]));
- assertFalse(allEmpty(null,new String[]{""}));
- assertFalse(allEmpty(null,new String[]{"x"}));
- }
-
- @Test
- public void testAllFalse() {
- assertTrue(allFalse());
- assertTrue(allFalse(false));
- assertTrue(allFalse(false,false));
- assertFalse(allFalse(false,true));
- assertFalse(allFalse(true));
- }
-
- @Test
- public void testAllMinusOne() {
- assertTrue(allMinusOne());
- assertTrue(allMinusOne(-1));
- assertTrue(allMinusOne(-1,-1));
- assertFalse(allMinusOne(-1,0));
- assertFalse(allMinusOne(0));
- }
-
- @Test
- public void testAllMinusOneLongs() {
- assertTrue(allMinusOne(-1l));
- assertTrue(allMinusOne(-1l,-1l));
- assertFalse(allMinusOne(-1l,0l));
- assertFalse(allMinusOne(0l));
- }
-}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/http/annotation/AnnotationUtils_Test.java b/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/http/annotation/AnnotationUtils_Test.java
new file mode 100644
index 0000000..15bfdf7
--- /dev/null
+++ b/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/http/annotation/AnnotationUtils_Test.java
@@ -0,0 +1,800 @@
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
+// * with the License. You may obtain a copy of the License at *
+// * *
+// * http://www.apache.org/licenses/LICENSE-2.0 *
+// * *
+// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
+// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
+// * specific language governing permissions and limitations under the License. *
+// ***************************************************************************************************************************
+package org.apache.juneau.http.annotation;
+
+import static org.junit.Assert.*;
+import static org.junit.runners.MethodSorters.*;
+import static java.lang.annotation.ElementType.*;
+import static java.lang.annotation.RetentionPolicy.*;
+import static org.apache.juneau.assertions.Assertions.*;
+import static org.apache.juneau.http.annotation.AnnotationUtils.*;
+
+import java.lang.annotation.*;
+import java.lang.reflect.*;
+
+import org.apache.juneau.jsonschema.annotation.*;
+import org.apache.juneau.oapi.*;
+import org.junit.*;
+
+@FixMethodOrder(NAME_ASCENDING)
+public class AnnotationUtils_Test {
+
+ //-----------------------------------------------------------------------------------------------------------------
+ // Test empty checks
+ //-----------------------------------------------------------------------------------------------------------------
+
+ @Target(TYPE)
+ @Retention(RUNTIME)
+ public @interface X1 {
+ Contact contact() default @Contact;
+ ExternalDocs externalDocs() default @ExternalDocs;
+ License license() default @License;
+ Schema schema() default @Schema;
+ SubItems subItems() default @SubItems;
+ Items items() default @Items;
+ }
+
+ @Body
+ @Response
+ @ResponseHeader
+ @X1
+ public static class A1 {
+ @Query @Header @FormData @Path @Schema
+ public int f1;
+ }
+
+ public static class A2 {
+ public int f1;
+ }
+
+ @Test
+ public void a01_Body() throws Exception {
+ assertObject(body().annotationType()).json().contains("Body");
+
+ assertTrue(empty(A1.class.getAnnotation(Body.class)));
+ assertTrue(empty(A2.class.getAnnotation(Body.class)));
+ assertTrue(empty(body()));
+ assertTrue(empty((Body)null));
+
+ assertFalse(empty(body().api(a("foo"))));
+ assertFalse(empty(body().d(a("foo"))));
+ assertFalse(empty(body().description(a("foo"))));
+ assertFalse(empty(body().ex(a("foo"))));
+ assertFalse(empty(body().example(a("foo"))));
+ assertFalse(empty(body().examples(a("foo"))));
+ assertFalse(empty(body().exs(a("foo"))));
+ assertFalse(empty(body().required(true)));
+ assertFalse(empty(body().r(true)));
+ assertFalse(empty(body().schema(schema().$ref("foo"))));
+ assertFalse(empty(body().value(a("foo"))));
+ }
+
+ @Test
+ public void a02_Contact() throws Exception {
+ X1 x1 = A1.class.getAnnotation(X1.class);
+
+ assertObject(contact().annotationType()).json().contains("Contact");
+
+ assertTrue(empty(x1.contact()));
+ assertTrue(empty(contact()));
+ assertTrue(empty((Contact)null));
+
+ assertFalse(empty(contact().email("foo")));
+ assertFalse(empty(contact().name("foo")));
+ assertFalse(empty(contact().url("foo")));
+ assertFalse(empty(contact().value(a("foo"))));
+ }
+
+ @Test
+ public void a03_FormData() throws Exception {
+ Field f1 = A1.class.getField("f1");
+ Field f2 = A2.class.getField("f1");
+
+ assertObject(formData().annotationType()).json().contains("FormData");
+
+ assertTrue(empty(f1.getAnnotation(FormData.class)));
+ assertTrue(empty(f2.getAnnotation(FormData.class)));
+ assertTrue(empty((FormData)null));
+ assertTrue(empty(formData()));
+
+ assertFalse(empty(formData()._default(a("foo"))));
+ assertFalse(empty(formData()._enum(a("foo"))));
+ assertFalse(empty(formData().aev(true)));
+ assertFalse(empty(formData().allowEmptyValue(true)));
+ assertFalse(empty(formData().api(a("foo"))));
+ assertFalse(empty(formData().cf("foo")));
+ assertFalse(empty(formData().collectionFormat("foo")));
+ assertFalse(empty(formData().d(a("foo"))));
+ assertFalse(empty(formData().description(a("foo"))));
+ assertFalse(empty(formData().df(a("foo"))));
+ assertFalse(empty(formData().e(a("foo"))));
+ assertFalse(empty(formData().emax(true)));
+ assertFalse(empty(formData().emin(true)));
+ assertFalse(empty(formData().ex(a("foo"))));
+ assertFalse(empty(formData().example(a("foo"))));
+ assertFalse(empty(formData().exclusiveMaximum(true)));
+ assertFalse(empty(formData().exclusiveMinimum(true)));
+ assertFalse(empty(formData().f("foo")));
+ assertFalse(empty(formData().format("foo")));
+ assertFalse(empty(formData().items(items().$ref("foo"))));
+ assertFalse(empty(formData().max("foo")));
+ assertFalse(empty(formData().maxi(0)));
+ assertFalse(empty(formData().maximum("foo")));
+ assertFalse(empty(formData().maxItems(0)));
+ assertFalse(empty(formData().maxl(0)));
+ assertFalse(empty(formData().maxLength(0)));
+ assertFalse(empty(formData().min("foo")));
+ assertFalse(empty(formData().mini(0)));
+ assertFalse(empty(formData().minimum("foo")));
+ assertFalse(empty(formData().minItems(0)));
+ assertFalse(empty(formData().minl(0)));
+ assertFalse(empty(formData().minLength(0)));
+ assertFalse(empty(formData().mo("foo")));
+ assertFalse(empty(formData().multi(true)));
+ assertFalse(empty(formData().multipleOf("foo")));
+ assertFalse(empty(formData().n("foo")));
+ assertFalse(empty(formData().name("foo")));
+ assertFalse(empty(formData().p("foo")));
+ assertFalse(empty(formData().parser(OpenApiParser.class)));
+ assertFalse(empty(formData().pattern("foo")));
+ assertFalse(empty(formData().r(true)));
+ assertFalse(empty(formData().required(true)));
+ assertFalse(empty(formData().serializer(OpenApiSerializer.class)));
+ assertFalse(empty(formData().sie(true)));
+ assertFalse(empty(formData().skipIfEmpty(true)));
+ assertFalse(empty(formData().t("foo")));
+ assertFalse(empty(formData().type("foo")));
+ assertFalse(empty(formData().ui(true)));
+ assertFalse(empty(formData().uniqueItems(true)));
+ assertFalse(empty(formData().value("foo")));
+ }
+
+ @Test
+ public void a04_HasFormData() throws Exception {
+ assertObject(hasFormData().annotationType()).json().contains("HasFormData");
+
+ assertObject(hasFormData().n("foo").n()).json().is("'foo'");
+ assertObject(hasFormData().name("foo").name()).json().is("'foo'");
+ assertObject(hasFormData().value("foo").value()).json().is("'foo'");
+ }
+
+ @Test
+ public void a05_Query() throws Exception {
+ Field f1 = A1.class.getField("f1");
+ Field f2 = A2.class.getField("f1");
+
+ assertObject(query().annotationType()).json().contains("Query");
+
+ assertTrue(empty(f1.getAnnotation(Query.class)));
+ assertTrue(empty(f2.getAnnotation(Query.class)));
+ assertTrue(empty((Query)null));
+ assertTrue(empty(query()));
+
+ assertFalse(empty(query()._default(a("foo"))));
+ assertFalse(empty(query()._enum(a("foo"))));
+ assertFalse(empty(query().aev(true)));
+ assertFalse(empty(query().allowEmptyValue(true)));
+ assertFalse(empty(query().api(a("foo"))));
+ assertFalse(empty(query().cf("foo")));
+ assertFalse(empty(query().collectionFormat("foo")));
+ assertFalse(empty(query().d(a("foo"))));
+ assertFalse(empty(query().description(a("foo"))));
+ assertFalse(empty(query().df(a("foo"))));
+ assertFalse(empty(query().e(a("foo"))));
+ assertFalse(empty(query().emax(true)));
+ assertFalse(empty(query().emin(true)));
+ assertFalse(empty(query().ex(a("foo"))));
+ assertFalse(empty(query().example(a("foo"))));
+ assertFalse(empty(query().exclusiveMaximum(true)));
+ assertFalse(empty(query().exclusiveMinimum(true)));
+ assertFalse(empty(query().f("foo")));
+ assertFalse(empty(query().format("foo")));
+ assertFalse(empty(query().items(items().$ref("foo"))));
+ assertFalse(empty(query().max("foo")));
+ assertFalse(empty(query().maxi(0)));
+ assertFalse(empty(query().maximum("foo")));
+ assertFalse(empty(query().maxItems(0)));
+ assertFalse(empty(query().maxl(0)));
+ assertFalse(empty(query().maxLength(0)));
+ assertFalse(empty(query().min("foo")));
+ assertFalse(empty(query().mini(0)));
+ assertFalse(empty(query().minimum("foo")));
+ assertFalse(empty(query().minItems(0)));
+ assertFalse(empty(query().minl(0)));
+ assertFalse(empty(query().minLength(0)));
+ assertFalse(empty(query().mo("foo")));
+ assertFalse(empty(query().multi(true)));
+ assertFalse(empty(query().multipleOf("foo")));
+ assertFalse(empty(query().n("foo")));
+ assertFalse(empty(query().name("foo")));
+ assertFalse(empty(query().p("foo")));
+ assertFalse(empty(query().parser(OpenApiParser.class)));
+ assertFalse(empty(query().pattern("foo")));
+ assertFalse(empty(query().r(true)));
+ assertFalse(empty(query().required(true)));
+ assertFalse(empty(query().serializer(OpenApiSerializer.class)));
+ assertFalse(empty(query().sie(true)));
+ assertFalse(empty(query().skipIfEmpty(true)));
+ assertFalse(empty(query().t("foo")));
+ assertFalse(empty(query().type("foo")));
+ assertFalse(empty(query().ui(true)));
+ assertFalse(empty(query().uniqueItems(true)));
+ assertFalse(empty(query().value("foo")));
+ }
+
+ @Test
+ public void a06_HasQuery() throws Exception {
+ assertObject(hasQuery().annotationType()).json().contains("HasQuery");
+
+ assertObject(hasQuery().n("foo").n()).json().is("'foo'");
+ assertObject(hasQuery().name("foo").name()).json().is("'foo'");
+ assertObject(hasQuery().value("foo").value()).json().is("'foo'");
+ }
+
+ @Test
+ public void a07_Header() throws Exception {
+ Field f1 = A1.class.getField("f1");
+ Field f2 = A2.class.getField("f1");
+
+ assertObject(header().annotationType()).json().contains("Header");
+
+ assertTrue(empty(f1.getAnnotation(Header.class)));
+ assertTrue(empty(f2.getAnnotation(Header.class)));
+ assertTrue(empty((Header)null));
+ assertTrue(empty(header()));
+
+ assertFalse(empty(header()._default(a("foo"))));
+ assertFalse(empty(header()._enum(a("foo"))));
+ assertFalse(empty(header().aev(true)));
+ assertFalse(empty(header().allowEmptyValue(true)));
+ assertFalse(empty(header().api(a("foo"))));
+ assertFalse(empty(header().cf("foo")));
+ assertFalse(empty(header().collectionFormat("foo")));
+ assertFalse(empty(header().d(a("foo"))));
+ assertFalse(empty(header().description(a("foo"))));
+ assertFalse(empty(header().df(a("foo"))));
+ assertFalse(empty(header().e(a("foo"))));
+ assertFalse(empty(header().emax(true)));
+ assertFalse(empty(header().emin(true)));
+ assertFalse(empty(header().ex(a("foo"))));
+ assertFalse(empty(header().example(a("foo"))));
+ assertFalse(empty(header().exclusiveMaximum(true)));
+ assertFalse(empty(header().exclusiveMinimum(true)));
+ assertFalse(empty(header().f("foo")));
+ assertFalse(empty(header().format("foo")));
+ assertFalse(empty(header().items(items().$ref("foo"))));
+ assertFalse(empty(header().max("foo")));
+ assertFalse(empty(header().maxi(0)));
+ assertFalse(empty(header().maximum("foo")));
+ assertFalse(empty(header().maxItems(0)));
+ assertFalse(empty(header().maxl(0)));
+ assertFalse(empty(header().maxLength(0)));
+ assertFalse(empty(header().min("foo")));
+ assertFalse(empty(header().mini(0)));
+ assertFalse(empty(header().minimum("foo")));
+ assertFalse(empty(header().minItems(0)));
+ assertFalse(empty(header().minl(0)));
+ assertFalse(empty(header().minLength(0)));
+ assertFalse(empty(header().mo("foo")));
+ assertFalse(empty(header().multi(true)));
+ assertFalse(empty(header().multipleOf("foo")));
+ assertFalse(empty(header().n("foo")));
+ assertFalse(empty(header().name("foo")));
+ assertFalse(empty(header().p("foo")));
+ assertFalse(empty(header().parser(OpenApiParser.class)));
+ assertFalse(empty(header().pattern("foo")));
+ assertFalse(empty(header().r(true)));
+ assertFalse(empty(header().required(true)));
+ assertFalse(empty(header().serializer(OpenApiSerializer.class)));
+ assertFalse(empty(header().sie(true)));
+ assertFalse(empty(header().skipIfEmpty(true)));
+ assertFalse(empty(header().t("foo")));
+ assertFalse(empty(header().type("foo")));
+ assertFalse(empty(header().ui(true)));
+ assertFalse(empty(header().uniqueItems(true)));
+ assertFalse(empty(header().value("foo")));
+ }
+
+ @Test
+ public void a08_License() throws Exception {
+ X1 x = A1.class.getAnnotation(X1.class);
+
+ assertObject(license().annotationType()).json().contains("License");
+
+ assertTrue(empty(x.license()));
+ assertTrue(empty((License)null));
+ assertTrue(empty(license()));
+
+ assertFalse(empty(license().name("foo")));
+ assertFalse(empty(license().url("foo")));
+ assertFalse(empty(license().value(a("foo"))));
+ }
+
+ @Test
+ public void a09_Path() throws Exception {
+ Field f1 = A1.class.getField("f1");
+ Field f2 = A2.class.getField("f1");
+
+ assertObject(path().annotationType()).json().contains("Path");
+
+ assertTrue(empty(f1.getAnnotation(Path.class)));
+ assertTrue(empty(f2.getAnnotation(Path.class)));
+ assertTrue(empty((Path)null));
+ assertTrue(empty(path()));
+
+ assertFalse(empty(path()._enum(a("foo"))));
+ assertFalse(empty(path().aev(true)));
+ assertFalse(empty(path().allowEmptyValue(true)));
+ assertFalse(empty(path().api(a("foo"))));
+ assertFalse(empty(path().cf("foo")));
+ assertFalse(empty(path().collectionFormat("foo")));
+ assertFalse(empty(path().d(a("foo"))));
+ assertFalse(empty(path().description(a("foo"))));
+ assertFalse(empty(path().e(a("foo"))));
+ assertFalse(empty(path().emax(true)));
+ assertFalse(empty(path().emin(true)));
+ assertFalse(empty(path().ex(a("foo"))));
+ assertFalse(empty(path().example(a("foo"))));
+ assertFalse(empty(path().exclusiveMaximum(true)));
+ assertFalse(empty(path().exclusiveMinimum(true)));
+ assertFalse(empty(path().f("foo")));
+ assertFalse(empty(path().format("foo")));
+ assertFalse(empty(path().items(items().$ref("foo"))));
+ assertFalse(empty(path().max("foo")));
+ assertFalse(empty(path().maxi(0)));
+ assertFalse(empty(path().maximum("foo")));
+ assertFalse(empty(path().maxItems(0)));
+ assertFalse(empty(path().maxl(0)));
+ assertFalse(empty(path().maxLength(0)));
+ assertFalse(empty(path().min("foo")));
+ assertFalse(empty(path().mini(0)));
+ assertFalse(empty(path().minimum("foo")));
+ assertFalse(empty(path().minItems(0)));
+ assertFalse(empty(path().minl(0)));
+ assertFalse(empty(path().minLength(0)));
+ assertFalse(empty(path().mo("foo")));
+ assertFalse(empty(path().multipleOf("foo")));
+ assertFalse(empty(path().n("foo")));
+ assertFalse(empty(path().name("foo")));
+ assertFalse(empty(path().p("foo")));
+ assertFalse(empty(path().parser(OpenApiParser.class)));
+ assertFalse(empty(path().pattern("foo")));
+ assertFalse(empty(path().r(false)));
+ assertFalse(empty(path().required(false)));
+ assertFalse(empty(path().serializer(OpenApiSerializer.class)));
+ assertFalse(empty(path().t("foo")));
+ assertFalse(empty(path().type("foo")));
+ assertFalse(empty(path().ui(true)));
+ assertFalse(empty(path().uniqueItems(true)));
+ assertFalse(empty(path().value("foo")));
+ }
+
+ @Test
+ public void a10_Request() throws Exception {
+ assertObject(request().annotationType()).json().contains("Request");
+
+ assertObject(request().parser(OpenApiParser.class).parser()).json().is("'org.apache.juneau.oapi.OpenApiParser'");
+ assertObject(request().serializer(OpenApiSerializer.class).serializer()).json().is("'org.apache.juneau.oapi.OpenApiSerializer'");
+ }
+
+ @Test
+ public void a11_Response() throws Exception {
+ assertObject(response().annotationType()).json().contains("Response");
+
+ assertTrue(empty(A1.class.getAnnotation(Response.class)));
+ assertTrue(empty(A2.class.getAnnotation(Response.class)));
+ assertTrue(empty(response()));
+ assertTrue(empty((Response)null));
+
+ assertFalse(empty(response().api(a("foo"))));
+ assertFalse(empty(response().code(a(0))));
+ assertFalse(empty(response().d(a("foo"))));
+ assertFalse(empty(response().description(a("foo"))));
+ assertFalse(empty(response().ex(a("foo"))));
+ assertFalse(empty(response().example(a("foo"))));
+ assertFalse(empty(response().examples(a("foo"))));
+ assertFalse(empty(response().exs(a("foo"))));
+ assertFalse(empty(response().headers(new ResponseHeader[]{responseHeader().$ref("foo")})));
+ assertFalse(empty(response().parser(OpenApiParser.class)));
+ assertFalse(empty(response().schema(schema().$ref("foo"))));
+ assertFalse(empty(response().serializer(OpenApiSerializer.class)));
+ assertFalse(empty(response().value(a(0))));
+ }
+
+ @Test
+ public void a12_ResponseBody() throws Exception {
+ assertObject(responseBody().annotationType()).json().contains("ResponseBody");
+ }
+
+ @Test
+ public void a13_ResponseHeader() throws Exception {
+ assertObject(responseHeader().annotationType()).json().contains("ResponseHeader");
+
+ assertTrue(empty(A1.class.getAnnotation(ResponseHeader.class)));
+ assertTrue(empty(A2.class.getAnnotation(ResponseHeader.class)));
+
+ assertFalse(empty(responseHeader()._default(a("foo"))));
+ assertFalse(empty(responseHeader()._enum(a("foo"))));
+ assertFalse(empty(responseHeader().api(a("foo"))));
+ assertFalse(empty(responseHeader().code(a(0))));
+ assertFalse(empty(responseHeader().cf("foo")));
+ assertFalse(empty(responseHeader().collectionFormat("foo")));
+ assertFalse(empty(responseHeader().d(a("foo"))));
+ assertFalse(empty(responseHeader().description(a("foo"))));
+ assertFalse(empty(responseHeader().df(a("foo"))));
+ assertFalse(empty(responseHeader().e(a("foo"))));
+ assertFalse(empty(responseHeader().emax(true)));
+ assertFalse(empty(responseHeader().emin(true)));
+ assertFalse(empty(responseHeader().ex(a("foo"))));
+ assertFalse(empty(responseHeader().example(a("foo"))));
+ assertFalse(empty(responseHeader().exclusiveMaximum(true)));
+ assertFalse(empty(responseHeader().exclusiveMinimum(true)));
+ assertFalse(empty(responseHeader().f("foo")));
+ assertFalse(empty(responseHeader().format("foo")));
+ assertFalse(empty(responseHeader().items(items().$ref("foo"))));
+ assertFalse(empty(responseHeader().max("foo")));
+ assertFalse(empty(responseHeader().maxi(0)));
+ assertFalse(empty(responseHeader().maximum("foo")));
+ assertFalse(empty(responseHeader().maxItems(0)));
+ assertFalse(empty(responseHeader().maxl(0)));
+ assertFalse(empty(responseHeader().maxLength(0)));
+ assertFalse(empty(responseHeader().min("foo")));
+ assertFalse(empty(responseHeader().mini(0)));
+ assertFalse(empty(responseHeader().minimum("foo")));
+ assertFalse(empty(responseHeader().minItems(0)));
+ assertFalse(empty(responseHeader().minl(0)));
+ assertFalse(empty(responseHeader().minLength(0)));
+ assertFalse(empty(responseHeader().mo("foo")));
+ assertFalse(empty(responseHeader().multipleOf("foo")));
+ assertFalse(empty(responseHeader().n("foo")));
+ assertFalse(empty(responseHeader().name("foo")));
+ assertFalse(empty(responseHeader().p("foo")));
+ assertFalse(empty(responseHeader().pattern("foo")));
+ assertFalse(empty(responseHeader().serializer(OpenApiSerializer.class)));
+ assertFalse(empty(responseHeader().t("foo")));
+ assertFalse(empty(responseHeader().type("foo")));
+ assertFalse(empty(responseHeader().ui(true)));
+ assertFalse(empty(responseHeader().uniqueItems(true)));
+ assertFalse(empty(responseHeader().value("foo")));
+ }
+
+ @Test
+ public void a14_ResponseStatus() throws Exception {
+ assertObject(responseStatus().annotationType()).json().contains("ResponseStatus");
+ }
+
+ @Test
+ public void a15_Tag() throws Exception {
+ assertObject(tag().annotationType()).json().contains("Tag");
+
+ assertObject(tag().description(a("foo")).description()).json().is("['foo']");
+ assertObject(tag().externalDocs(externalDocs().url("foo")).externalDocs().url()).json().is("'foo'");
+ assertObject(tag().name("foo").name()).json().is("'foo'");
+ assertObject(tag().value(a("foo")).value()).json().is("['foo']");
+ }
+
+ @Test
+ public void a16_ExternalDocs() throws Exception {
+ X1 x = A1.class.getAnnotation(X1.class);
+
+ assertObject(externalDocs().annotationType()).json().contains("ExternalDocs");
+
+ assertTrue(empty(x.externalDocs()));
+ assertTrue(empty((ExternalDocs)null));
+
+ assertFalse(empty(externalDocs().description(a("foo"))));
+ assertFalse(empty(externalDocs().url("foo")));
+ assertFalse(empty(externalDocs().value(a("foo"))));
+ }
+
+ @Test
+ public void a17_Schema() throws Exception {
+ X1 x = A1.class.getAnnotation(X1.class);
+
+ assertObject(schema().annotationType()).json().contains("Schema");
+
+ assertTrue(empty(x.schema()));
+ assertTrue(empty((Schema)null));
+
+ assertFalse(empty(schema()._default(a("foo"))));
+ assertFalse(empty(schema()._enum(a("foo"))));
+ assertFalse(empty(schema().$ref("foo")));
+ assertFalse(empty(schema().additionalProperties(a("foo"))));
+ assertFalse(empty(schema().allOf(a("foo"))));
+ assertFalse(empty(schema().cf("foo")));
+ assertFalse(empty(schema().collectionFormat("foo")));
+ assertFalse(empty(schema().d(a("foo"))));
+ assertFalse(empty(schema().description(a("foo"))));
+ assertFalse(empty(schema().df(a("foo"))));
+ assertFalse(empty(schema().discriminator("foo")));
+ assertFalse(empty(schema().e(a("foo"))));
+ assertFalse(empty(schema().emax(true)));
+ assertFalse(empty(schema().emin(true)));
+ assertFalse(empty(schema().ex(a("foo"))));
+ assertFalse(empty(schema().example(a("foo"))));
+ assertFalse(empty(schema().examples(a("foo"))));
+ assertFalse(empty(schema().exclusiveMaximum(true)));
+ assertFalse(empty(schema().exclusiveMinimum(true)));
+ assertFalse(empty(schema().exs(a("foo"))));
+ assertFalse(empty(schema().externalDocs(externalDocs().url("foo"))));
+ assertFalse(empty(schema().f("foo")));
+ assertFalse(empty(schema().format("foo")));
+ assertFalse(empty(schema().ignore(true)));
+ assertFalse(empty(schema().items(items().$ref("foo"))));
+ assertFalse(empty(schema().max("foo")));
+ assertFalse(empty(schema().maxi(0)));
+ assertFalse(empty(schema().maximum("foo")));
+ assertFalse(empty(schema().maxItems(0)));
+ assertFalse(empty(schema().maxl(0)));
+ assertFalse(empty(schema().maxLength(0)));
+ assertFalse(empty(schema().maxp(0)));
+ assertFalse(empty(schema().maxProperties(0)));
+ assertFalse(empty(schema().min("foo")));
+ assertFalse(empty(schema().mini(0)));
+ assertFalse(empty(schema().minimum("foo")));
+ assertFalse(empty(schema().minItems(0)));
+ assertFalse(empty(schema().minl(0)));
+ assertFalse(empty(schema().minLength(0)));
+ assertFalse(empty(schema().minp(0)));
+ assertFalse(empty(schema().minProperties(0)));
+ assertFalse(empty(schema().mo("foo")));
+ assertFalse(empty(schema().multipleOf("foo")));
+ assertFalse(empty(schema().on("foo")));
+ assertFalse(empty(schema().p("foo")));
+ assertFalse(empty(schema().pattern("foo")));
+ assertFalse(empty(schema().properties(a("foo"))));
+ assertFalse(empty(schema().r(true)));
+ assertFalse(empty(schema().readOnly(true)));
+ assertFalse(empty(schema().required(true)));
+ assertFalse(empty(schema().ro(true)));
+ assertFalse(empty(schema().t("foo")));
+ assertFalse(empty(schema().title("foo")));
+ assertFalse(empty(schema().type("foo")));
+ assertFalse(empty(schema().ui(true)));
+ assertFalse(empty(schema().uniqueItems(true)));
+ assertFalse(empty(schema().value(a("foo"))));
+ assertFalse(empty(schema().xml(a("foo"))));
+ }
+
+ @Test
+ public void a18_SubItems() throws Exception {
+ X1 x = A1.class.getAnnotation(X1.class);
+
+ assertObject(subItems().annotationType()).json().contains("SubItems");
+
+ assertTrue(empty(x.subItems()));
+ assertTrue(empty((SubItems)null));
+
+ assertFalse(empty(subItems()._default(a("foo"))));
+ assertFalse(empty(subItems()._enum(a("foo"))));
+ assertFalse(empty(subItems().$ref("foo")));
+ assertFalse(empty(subItems().cf("foo")));
+ assertFalse(empty(subItems().collectionFormat("foo")));
+ assertFalse(empty(subItems().df(a("foo"))));
+ assertFalse(empty(subItems().e(a("foo"))));
+ assertFalse(empty(subItems().emax(true)));
+ assertFalse(empty(subItems().emin(true)));
+ assertFalse(empty(subItems().exclusiveMaximum(true)));
+ assertFalse(empty(subItems().exclusiveMinimum(true)));
+ assertFalse(empty(subItems().f("foo")));
+ assertFalse(empty(subItems().format("foo")));
+ assertFalse(empty(subItems().items(a("foo"))));
+ assertFalse(empty(subItems().max("foo")));
+ assertFalse(empty(subItems().maxi(0)));
+ assertFalse(empty(subItems().maximum("foo")));
+ assertFalse(empty(subItems().maxItems(0)));
+ assertFalse(empty(subItems().maxl(0)));
+ assertFalse(empty(subItems().maxLength(0)));
+ assertFalse(empty(subItems().min("foo")));
+ assertFalse(empty(subItems().mini(0)));
+ assertFalse(empty(subItems().minimum("foo")));
+ assertFalse(empty(subItems().minItems(0)));
+ assertFalse(empty(subItems().minl(0)));
+ assertFalse(empty(subItems().minLength(0)));
+ assertFalse(empty(subItems().mo("foo")));
+ assertFalse(empty(subItems().multipleOf("foo")));
+ assertFalse(empty(subItems().p("foo")));
+ assertFalse(empty(subItems().pattern("foo")));
+ assertFalse(empty(subItems().t("foo")));
+ assertFalse(empty(subItems().type("foo")));
+ assertFalse(empty(subItems().ui(true)));
+ assertFalse(empty(subItems().uniqueItems(true)));
+ assertFalse(empty(subItems().value(a("foo"))));
+ }
+
+ @Test
+ public void a19_Items() throws Exception {
+ X1 x = A1.class.getAnnotation(X1.class);
+
+ assertObject(items().annotationType()).json().contains("Items");
+
+ assertTrue(empty(x.items()));
+ assertTrue(empty((Items)null));
+ assertFalse(empty(items()._default(a("foo"))));
+ assertFalse(empty(items()._enum(a("foo"))));
+ assertFalse(empty(items().$ref("foo")));
+ assertFalse(empty(items().cf("foo")));
+ assertFalse(empty(items().collectionFormat("foo")));
+ assertFalse(empty(items().df(a("foo"))));
+ assertFalse(empty(items().e(a("foo"))));
+ assertFalse(empty(items().emax(true)));
+ assertFalse(empty(items().emin(true)));
+ assertFalse(empty(items().exclusiveMaximum(true)));
+ assertFalse(empty(items().exclusiveMinimum(true)));
+ assertFalse(empty(items().f("foo")));
+ assertFalse(empty(items().format("foo")));
+ assertFalse(empty(items().items(subItems().$ref("foo"))));
+ assertFalse(empty(items().max("foo")));
+ assertFalse(empty(items().maxi(0)));
+ assertFalse(empty(items().maximum("foo")));
+ assertFalse(empty(items().maxItems(0)));
+ assertFalse(empty(items().maxl(0)));
+ assertFalse(empty(items().maxLength(0)));
+ assertFalse(empty(items().min("foo")));
+ assertFalse(empty(items().mini(0)));
+ assertFalse(empty(items().minimum("foo")));
+ assertFalse(empty(items().minItems(0)));
+ assertFalse(empty(items().minl(0)));
+ assertFalse(empty(items().minLength(0)));
+ assertFalse(empty(items().mo("foo")));
+ assertFalse(empty(items().multipleOf("foo")));
+ assertFalse(empty(items().p("foo")));
+ assertFalse(empty(items().pattern("foo")));
+ assertFalse(empty(items().t("foo")));
+ assertFalse(empty(items().type("foo")));
+ assertFalse(empty(items().ui(true)));
+ assertFalse(empty(items().uniqueItems(true)));
+ assertFalse(empty(items().value(a("foo"))));
+ }
+
+
+ @Test
+ public void b01_allEmpty() {
+ assertTrue(allEmpty(new String[0]));
+ assertTrue(allEmpty(""));
+ assertTrue(allEmpty(null,""));
+ assertFalse(allEmpty(null,"","x"));
+ assertTrue(allEmpty(new String[0],new String[0]));
+ assertTrue(allEmpty(null,new String[0]));
+ assertFalse(allEmpty(null,new String[]{""}));
+ assertFalse(allEmpty(null,new String[]{"x"}));
+ }
+
+ @Test
+ public void b02_allTrue() {
+ assertTrue(allTrue());
+ assertTrue(allTrue(true));
+ assertTrue(allTrue(true,true));
+ assertFalse(allTrue(false,true));
+ assertFalse(allTrue(false));
+ }
+
+ @Test
+ public void b03_allFalse() {
+ assertTrue(allFalse());
+ assertTrue(allFalse(false));
+ assertTrue(allFalse(false,false));
+ assertFalse(allFalse(false,true));
+ assertFalse(allFalse(true));
+ }
+
+ @Test
+ public void b04_allMinusOne() {
+ assertTrue(allMinusOne());
+ assertTrue(allMinusOne(-1));
+ assertTrue(allMinusOne(-1,-1));
+ assertFalse(allMinusOne(-1,0));
+ assertFalse(allMinusOne(0));
+ }
+
+ @Test
+ public void b05_allMinusOneLongs() {
+ assertTrue(allMinusOne(-1l));
+ assertTrue(allMinusOne(-1l,-1l));
+ assertFalse(allMinusOne(-1l,0l));
+ assertFalse(allMinusOne(0l));
+ }
+
+ @Test
+ public void b06_other() throws Exception {
+ new AnnotationUtils();
+ }
+
+ //-----------------------------------------------------------------------------------------------------------------
+ // Helper methods.
+ //-----------------------------------------------------------------------------------------------------------------
+
+ private static BodyAnnotation body() {
+ return new BodyAnnotation();
+ }
+
+ private static ContactAnnotation contact() {
+ return new ContactAnnotation();
+ }
+
+ private static FormDataAnnotation formData() {
+ return new FormDataAnnotation();
+ }
+
+ private static HasFormDataAnnotation hasFormData() {
+ return new HasFormDataAnnotation();
+ }
+
+ private static QueryAnnotation query() {
+ return new QueryAnnotation();
+ }
+
+ private static HasQueryAnnotation hasQuery() {
+ return new HasQueryAnnotation();
+ }
+
+ private static HeaderAnnotation header() {
+ return new HeaderAnnotation();
+ }
+
+ private static LicenseAnnotation license() {
+ return new LicenseAnnotation();
+ }
+
+ private static PathAnnotation path() {
+ return new PathAnnotation();
+ }
+
+ private static RequestAnnotation request() {
+ return new RequestAnnotation();
+ }
+
+ private static ResponseAnnotation response() {
+ return new ResponseAnnotation();
+ }
+
+ private static ResponseBodyAnnotation responseBody() {
+ return new ResponseBodyAnnotation();
+ }
+
+ private static ResponseHeaderAnnotation responseHeader() {
+ return new ResponseHeaderAnnotation();
+ }
+
+ private static ResponseStatusAnnotation responseStatus() {
+ return new ResponseStatusAnnotation();
+ }
+
+ private static TagAnnotation tag() {
+ return new TagAnnotation();
+ }
+
+ private static SchemaAnnotation schema() {
+ return new SchemaAnnotation();
+ }
+
+ private static ItemsAnnotation items() {
+ return new ItemsAnnotation();
+ }
+
+ private static SubItemsAnnotation subItems() {
+ return new SubItemsAnnotation();
+ }
+
+ private static ExternalDocsAnnotation externalDocs() {
+ return new ExternalDocsAnnotation();
+ }
+
+ private static String[] a(String...s) {
+ return s;
+ }
+
+ private static int[] a(int...i) {
+ return i;
+ }
+}
\ No newline at end of file
diff --git a/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/http/annotation/CollectionFormatType_Test.java b/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/http/annotation/CollectionFormatType_Test.java
new file mode 100644
index 0000000..781d47c
--- /dev/null
+++ b/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/http/annotation/CollectionFormatType_Test.java
@@ -0,0 +1,26 @@
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
+// * with the License. You may obtain a copy of the License at *
+// * *
+// * http://www.apache.org/licenses/LICENSE-2.0 *
+// * *
+// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
+// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
+// * specific language governing permissions and limitations under the License. *
+// ***************************************************************************************************************************
+package org.apache.juneau.http.annotation;
+
+import static org.junit.runners.MethodSorters.*;
+
+import org.junit.*;
+
+@FixMethodOrder(NAME_ASCENDING)
+public class CollectionFormatType_Test {
+
+ @Test
+ public void a01_basic() {
+ new CollectionFormatType();
+ }
+}
diff --git a/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/http/annotation/FormatType_Test.java b/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/http/annotation/FormatType_Test.java
new file mode 100644
index 0000000..d91a73e
--- /dev/null
+++ b/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/http/annotation/FormatType_Test.java
@@ -0,0 +1,26 @@
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
+// * with the License. You may obtain a copy of the License at *
+// * *
+// * http://www.apache.org/licenses/LICENSE-2.0 *
+// * *
+// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
+// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
+// * specific language governing permissions and limitations under the License. *
+// ***************************************************************************************************************************
+package org.apache.juneau.http.annotation;
+
+import static org.junit.runners.MethodSorters.*;
+
+import org.junit.*;
+
+@FixMethodOrder(NAME_ASCENDING)
+public class FormatType_Test {
+
+ @Test
+ public void a01_basic() {
+ new FormatType();
+ }
+}
diff --git a/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/http/annotation/ParameterType_Test.java b/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/http/annotation/ParameterType_Test.java
new file mode 100644
index 0000000..4e2632e
--- /dev/null
+++ b/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/http/annotation/ParameterType_Test.java
@@ -0,0 +1,26 @@
+// ***************************************************************************************************************************
+// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file *
+// * distributed with this work for additional information regarding copyright ownership. The ASF licenses this file *
+// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance *
+// * with the License. You may obtain a copy of the License at *
+// * *
+// * http://www.apache.org/licenses/LICENSE-2.0 *
+// * *
+// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an *
+// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the *
+// * specific language governing permissions and limitations under the License. *
+// ***************************************************************************************************************************
+package org.apache.juneau.http.annotation;
+
+import static org.junit.runners.MethodSorters.*;
+
+import org.junit.*;
+
+@FixMethodOrder(NAME_ASCENDING)
+public class ParameterType_Test {
+
+ @Test
+ public void a01_basic() {
+ new ParameterType();
+ }
+}
diff --git a/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/rest/client2/Remote_FormDataAnnotation_Test.java b/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/rest/client2/Remote_FormDataAnnotation_Test.java
index a2f2c38..903bfd6 100644
--- a/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/rest/client2/Remote_FormDataAnnotation_Test.java
+++ b/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/rest/client2/Remote_FormDataAnnotation_Test.java
@@ -724,7 +724,7 @@ public class Remote_FormDataAnnotation_Test {
@Remote(path="/")
public static interface K1 {
@RemoteMethod(path="/") String postX1(@Request K1a rb);
- @RemoteMethod(path="/") String postX2(@Request(partSerializer=XSerializer.class) K1a rb);
+ @RemoteMethod(path="/") String postX2(@Request(serializer=XSerializer.class) K1a rb);
}
public static class K1a {
@@ -786,7 +786,7 @@ public class Remote_FormDataAnnotation_Test {
@Remote(path="/")
public static interface K2 {
@RemoteMethod(path="/") String postX1(@Request K2a rb);
- @RemoteMethod(path="/") String postX2(@Request(partSerializer=XSerializer.class) K2a rb);
+ @RemoteMethod(path="/") String postX2(@Request(serializer=XSerializer.class) K2a rb);
}
public static class K2a {
@@ -824,7 +824,7 @@ public class Remote_FormDataAnnotation_Test {
@Remote(path="/")
public static interface K3 {
@RemoteMethod(path="/") String postX1(@Request K3a rb);
- @RemoteMethod(path="/") String postX2(@Request(partSerializer=XSerializer.class) K3a rb);
+ @RemoteMethod(path="/") String postX2(@Request(serializer=XSerializer.class) K3a rb);
}
public static class K3a {
@@ -914,7 +914,7 @@ public class Remote_FormDataAnnotation_Test {
@Remote(path="/")
public static interface K6 {
@RemoteMethod(path="/") String postX1(@Request K6a rb);
- @RemoteMethod(path="/") String postX2(@Request(partSerializer=XSerializer.class) K6a rb);
+ @RemoteMethod(path="/") String postX2(@Request(serializer=XSerializer.class) K6a rb);
}
public static class K6a {
diff --git a/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/rest/client2/Remote_HeaderAnnotation_Test.java b/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/rest/client2/Remote_HeaderAnnotation_Test.java
index 008f67a..0aa4f9d 100644
--- a/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/rest/client2/Remote_HeaderAnnotation_Test.java
+++ b/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/rest/client2/Remote_HeaderAnnotation_Test.java
@@ -689,7 +689,7 @@ public class Remote_HeaderAnnotation_Test {
@Remote(path="/")
public static interface K1 {
@RemoteMethod(path="/") String getX1(@Request K1a rb);
- @RemoteMethod(path="/") String getX2(@Request(partSerializer=XSerializer.class) K1a rb);
+ @RemoteMethod(path="/") String getX2(@Request(serializer=XSerializer.class) K1a rb);
}
public static class K1a {
@@ -751,7 +751,7 @@ public class Remote_HeaderAnnotation_Test {
@Remote(path="/")
public static interface K2 {
@RemoteMethod(path="/") String getX1(@Request K2a rb);
- @RemoteMethod(path="/") String getX2(@Request(partSerializer=XSerializer.class) K2a rb);
+ @RemoteMethod(path="/") String getX2(@Request(serializer=XSerializer.class) K2a rb);
}
public static class K2a {
@@ -789,7 +789,7 @@ public class Remote_HeaderAnnotation_Test {
@Remote(path="/")
public static interface K3 {
@RemoteMethod(path="/") String getX1(@Request K3a rb);
- @RemoteMethod(path="/") String getX2(@Request(partSerializer=XSerializer.class) K3a rb);
+ @RemoteMethod(path="/") String getX2(@Request(serializer=XSerializer.class) K3a rb);
}
public static class K3a {
@@ -835,7 +835,7 @@ public class Remote_HeaderAnnotation_Test {
@Remote(path="/")
public static interface K4 {
@RemoteMethod(path="/") String getX1(@Request K4a rb);
- @RemoteMethod(path="/") String getX2(@Request(partSerializer=XSerializer.class) K4a rb);
+ @RemoteMethod(path="/") String getX2(@Request(serializer=XSerializer.class) K4a rb);
}
public static class K4a {
diff --git a/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/rest/client2/Remote_PathAnnotation_Test.java b/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/rest/client2/Remote_PathAnnotation_Test.java
index 292421f..71f1f2c 100644
--- a/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/rest/client2/Remote_PathAnnotation_Test.java
+++ b/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/rest/client2/Remote_PathAnnotation_Test.java
@@ -597,7 +597,7 @@ public class Remote_PathAnnotation_Test {
@Remote(path="/")
public static interface K1 {
@RemoteMethod(path="/{a}/{b}/{c}/{e}/{g}/{h}") String getX1(@Request K1a rb);
- @RemoteMethod(path="/{a}/{b}/{c}/{e}/{g}/{h}") String getX2(@Request(partSerializer=XSerializer.class) K1a rb);
+ @RemoteMethod(path="/{a}/{b}/{c}/{e}/{g}/{h}") String getX2(@Request(serializer=XSerializer.class) K1a rb);
}
public static class K1a {
@@ -643,7 +643,7 @@ public class Remote_PathAnnotation_Test {
@Remote(path="/")
public static interface K2 {
@RemoteMethod(path="/{a1}/{a2}/{a3}/{a4}/{b1}/{b2}/{b3}/{c1}/{c2}/{c3}/{c4}") String getX1(@Request K2a rb);
- @RemoteMethod(path="/{a1}/{a2}/{a3}/{a4}/{b1}/{b2}/{b3}/{c1}/{c2}/{c3}/{c4}") String getX2(@Request(partSerializer=XSerializer.class) K2a rb);
+ @RemoteMethod(path="/{a1}/{a2}/{a3}/{a4}/{b1}/{b2}/{b3}/{c1}/{c2}/{c3}/{c4}") String getX2(@Request(serializer=XSerializer.class) K2a rb);
}
public static class K2a {
@@ -681,7 +681,7 @@ public class Remote_PathAnnotation_Test {
@Remote(path="/")
public static interface K3 {
@RemoteMethod(path="/{a1}/{a2}/{a3}/{a4}/{b1}/{b2}/{b3}/{c1}/{c2}/{c3}/{c4}/{e1}/{e2}/{e3}/{e4}/{f1}/{f2}/{f3}/{f4}") String getX1(@Request K3a rb);
- @RemoteMethod(path="/{a1}/{a2}/{a3}/{a4}/{b1}/{b2}/{b3}/{c1}/{c2}/{c3}/{c4}/{e1}/{e2}/{e3}/{e4}/{f1}/{f2}/{f3}/{f4}") String getX2(@Request(partSerializer=XSerializer.class) K3a rb);
+ @RemoteMethod(path="/{a1}/{a2}/{a3}/{a4}/{b1}/{b2}/{b3}/{c1}/{c2}/{c3}/{c4}/{e1}/{e2}/{e3}/{e4}/{f1}/{f2}/{f3}/{f4}") String getX2(@Request(serializer=XSerializer.class) K3a rb);
}
public static class K3a {
@@ -727,7 +727,7 @@ public class Remote_PathAnnotation_Test {
@Remote(path="/")
public static interface K4 {
@RemoteMethod(path="/{a}/{b}/{c}/{d}/{f}/{g}/{h}") String getX1(@Request K4a rb);
- @RemoteMethod(path="/{a}/{b}/{c}/{d}/{f}/{g}/{h}") String getX2(@Request(partSerializer=XSerializer.class) K4a rb);
+ @RemoteMethod(path="/{a}/{b}/{c}/{d}/{f}/{g}/{h}") String getX2(@Request(serializer=XSerializer.class) K4a rb);
}
public static class K4a {
diff --git a/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/rest/client2/Remote_QueryAnnotation_Test.java b/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/rest/client2/Remote_QueryAnnotation_Test.java
index 4c0b834..59844ee 100644
--- a/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/rest/client2/Remote_QueryAnnotation_Test.java
+++ b/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/rest/client2/Remote_QueryAnnotation_Test.java
@@ -709,7 +709,7 @@ public class Remote_QueryAnnotation_Test {
@Remote(path="/")
public static interface K1 {
@RemoteMethod(path="/") String getX1(@Request K1b rb);
- @RemoteMethod(path="/") String getX2(@Request(partSerializer=XSerializer.class) K1b rb);
+ @RemoteMethod(path="/") String getX2(@Request(serializer=XSerializer.class) K1b rb);
}
public static interface K1a {
@@ -754,7 +754,7 @@ public class Remote_QueryAnnotation_Test {
@Remote(path="/")
public static interface K2 {
@RemoteMethod(path="/") String getX1(@Request K2a rb);
- @RemoteMethod(path="/") String getX2(@Request(partSerializer=XSerializer.class) K2a rb);
+ @RemoteMethod(path="/") String getX2(@Request(serializer=XSerializer.class) K2a rb);
}
public static class K2a {
@@ -792,7 +792,7 @@ public class Remote_QueryAnnotation_Test {
@Remote(path="/")
public static interface K3 {
@RemoteMethod(path="/") String getX1(@Request K3a rb);
- @RemoteMethod(path="/") String getX2(@Request(partSerializer=XSerializer.class) K3a rb);
+ @RemoteMethod(path="/") String getX2(@Request(serializer=XSerializer.class) K3a rb);
}
public static class K3a {
@@ -882,7 +882,7 @@ public class Remote_QueryAnnotation_Test {
@Remote(path="/")
public static interface K6 {
@RemoteMethod(path="/") String getX1(@Request K6a rb);
- @RemoteMethod(path="/") String getX2(@Request(partSerializer=XSerializer.class) K6a rb);
+ @RemoteMethod(path="/") String getX2(@Request(serializer=XSerializer.class) K6a rb);
}
public static class K6a {
diff --git a/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/rest/client2/Remote_RequestAnnotation_Test.java b/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/rest/client2/Remote_RequestAnnotation_Test.java
index f54dc76..e6baa3f 100644
--- a/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/rest/client2/Remote_RequestAnnotation_Test.java
+++ b/juneau-rest/juneau-rest-client-utest/src/test/java/org/apache/juneau/rest/client2/Remote_RequestAnnotation_Test.java
@@ -259,7 +259,7 @@ public class Remote_RequestAnnotation_Test {
}
}
- @Request(partSerializer=XPartSerializer.class)
+ @Request(serializer=XPartSerializer.class)
public static class E1 {
@Body
public String getBody() {