From de095eb9fe1cb505f6a9a82cd8a621be3f66e508 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Mon, 7 Sep 2015 13:20:03 +0100 Subject: [PATCH] Add package-info.java to each package Closes gh-109 --- .../restdocs/constraints/package-info.java | 20 ++++++++++++++++++ .../restdocs/curl/package-info.java | 20 ++++++++++++++++++ .../restdocs/http/package-info.java | 21 +++++++++++++++++++ .../restdocs/hypermedia/package-info.java | 20 ++++++++++++++++++ .../restdocs/operation/package-info.java | 21 +++++++++++++++++++ .../operation/preprocess/package-info.java | 20 ++++++++++++++++++ .../restdocs/package-info.java | 20 ++++++++++++++++++ .../restdocs/payload/package-info.java | 20 ++++++++++++++++++ .../restdocs/request/package-info.java | 20 ++++++++++++++++++ .../restdocs/snippet/package-info.java | 20 ++++++++++++++++++ .../templates/mustache/package-info.java | 20 ++++++++++++++++++ .../restdocs/templates/package-info.java | 20 ++++++++++++++++++ .../{util => }/IterableEnumeration.java | 6 +++--- .../MockMvcOperationRequestFactory.java | 2 +- .../RestDocumentationResultHandler.java | 2 +- .../restdocs/mockmvc/package-info.java | 20 ++++++++++++++++++ 16 files changed, 267 insertions(+), 5 deletions(-) create mode 100644 spring-restdocs-core/src/main/java/org/springframework/restdocs/constraints/package-info.java create mode 100644 spring-restdocs-core/src/main/java/org/springframework/restdocs/curl/package-info.java create mode 100644 spring-restdocs-core/src/main/java/org/springframework/restdocs/http/package-info.java create mode 100644 spring-restdocs-core/src/main/java/org/springframework/restdocs/hypermedia/package-info.java create mode 100644 spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/package-info.java create mode 100644 spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/package-info.java create mode 100644 spring-restdocs-core/src/main/java/org/springframework/restdocs/package-info.java create mode 100644 spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/package-info.java create mode 100644 spring-restdocs-core/src/main/java/org/springframework/restdocs/request/package-info.java create mode 100644 spring-restdocs-core/src/main/java/org/springframework/restdocs/snippet/package-info.java create mode 100644 spring-restdocs-core/src/main/java/org/springframework/restdocs/templates/mustache/package-info.java create mode 100644 spring-restdocs-core/src/main/java/org/springframework/restdocs/templates/package-info.java rename spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/{util => }/IterableEnumeration.java (90%) create mode 100644 spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/package-info.java diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/constraints/package-info.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/constraints/package-info.java new file mode 100644 index 00000000..1692913c --- /dev/null +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/constraints/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright 2014-2015 the original author or authors. + * + * Licensed 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. + */ + +/** + * Documenting a RESTful API's constraints. + */ +package org.springframework.restdocs.constraints; \ No newline at end of file diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/curl/package-info.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/curl/package-info.java new file mode 100644 index 00000000..12409098 --- /dev/null +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/curl/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright 2014-2015 the original author or authors. + * + * Licensed 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. + */ + +/** + * Documenting the curl command required to make a request to a RESTful API. + */ +package org.springframework.restdocs.curl; \ No newline at end of file diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/http/package-info.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/http/package-info.java new file mode 100644 index 00000000..258da97d --- /dev/null +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/http/package-info.java @@ -0,0 +1,21 @@ +/* + * Copyright 2014-2015 the original author or authors. + * + * Licensed 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. + */ + +/** + * Documenting the HTTP request sent to a RESTful API and the HTTP response that is + * returned. + */ +package org.springframework.restdocs.http; \ No newline at end of file diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/hypermedia/package-info.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/hypermedia/package-info.java new file mode 100644 index 00000000..a792c083 --- /dev/null +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/hypermedia/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright 2014-2015 the original author or authors. + * + * Licensed 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. + */ + +/** + * Documenting a RESTful API that uses hypermedia. + */ +package org.springframework.restdocs.hypermedia; \ No newline at end of file diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/package-info.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/package-info.java new file mode 100644 index 00000000..2321f69e --- /dev/null +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/package-info.java @@ -0,0 +1,21 @@ +/* + * Copyright 2014-2015 the original author or authors. + * + * Licensed 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. + */ + +/** + * Operation API that describes a request that was sent and the response that was + * received when calling a RESTful API. + */ +package org.springframework.restdocs.operation; \ No newline at end of file diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/package-info.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/package-info.java new file mode 100644 index 00000000..2a50da0c --- /dev/null +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright 2014-2015 the original author or authors. + * + * Licensed 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. + */ + +/** + * Support for preprocessing an operation prior to it being documented. + */ +package org.springframework.restdocs.operation.preprocess; \ No newline at end of file diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/package-info.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/package-info.java new file mode 100644 index 00000000..c237f39a --- /dev/null +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright 2014-2015 the original author or authors. + * + * Licensed 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. + */ + +/** + * Core Spring REST Docs classes. + */ +package org.springframework.restdocs; \ No newline at end of file diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/package-info.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/package-info.java new file mode 100644 index 00000000..1e164515 --- /dev/null +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/payload/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright 2014-2015 the original author or authors. + * + * Licensed 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. + */ + +/** + * Documenting the payload of a RESTful API's requests and responses. + */ +package org.springframework.restdocs.payload; \ No newline at end of file diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/request/package-info.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/request/package-info.java new file mode 100644 index 00000000..9e78ff29 --- /dev/null +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/request/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright 2014-2015 the original author or authors. + * + * Licensed 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. + */ + +/** + * Documenting query and path parameters of requests sent to a RESTful API. + */ +package org.springframework.restdocs.request; \ No newline at end of file diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/snippet/package-info.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/snippet/package-info.java new file mode 100644 index 00000000..1e8540b9 --- /dev/null +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/snippet/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright 2014-2015 the original author or authors. + * + * Licensed 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. + */ + +/** + * Snippet generation. + */ +package org.springframework.restdocs.snippet; \ No newline at end of file diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/templates/mustache/package-info.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/templates/mustache/package-info.java new file mode 100644 index 00000000..0b4246df --- /dev/null +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/templates/mustache/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright 2014-2015 the original author or authors. + * + * Licensed 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. + */ + +/** + * JMustache-based implementation of the template API. + */ +package org.springframework.restdocs.templates.mustache; \ No newline at end of file diff --git a/spring-restdocs-core/src/main/java/org/springframework/restdocs/templates/package-info.java b/spring-restdocs-core/src/main/java/org/springframework/restdocs/templates/package-info.java new file mode 100644 index 00000000..7f9b1d10 --- /dev/null +++ b/spring-restdocs-core/src/main/java/org/springframework/restdocs/templates/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright 2014-2015 the original author or authors. + * + * Licensed 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. + */ + +/** + * Template API used to render documentation snippets. + */ +package org.springframework.restdocs.templates; \ No newline at end of file diff --git a/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/util/IterableEnumeration.java b/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/IterableEnumeration.java similarity index 90% rename from spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/util/IterableEnumeration.java rename to spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/IterableEnumeration.java index 663cef47..5e7a7580 100644 --- a/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/util/IterableEnumeration.java +++ b/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/IterableEnumeration.java @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.springframework.restdocs.mockmvc.util; +package org.springframework.restdocs.mockmvc; import java.util.Enumeration; import java.util.Iterator; @@ -26,7 +26,7 @@ import java.util.Iterator; * * @param the type of the Enumeration's contents */ -public final class IterableEnumeration implements Iterable { +final class IterableEnumeration implements Iterable { private final Enumeration enumeration; @@ -63,7 +63,7 @@ public final class IterableEnumeration implements Iterable { * @param enumeration The enumeration to expose as an {@code Iterable} * @return the iterable */ - public static Iterable iterable(Enumeration enumeration) { + static Iterable iterable(Enumeration enumeration) { return new IterableEnumeration(enumeration); } diff --git a/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/MockMvcOperationRequestFactory.java b/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/MockMvcOperationRequestFactory.java index 70d4351e..d3236e08 100644 --- a/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/MockMvcOperationRequestFactory.java +++ b/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/MockMvcOperationRequestFactory.java @@ -16,7 +16,7 @@ package org.springframework.restdocs.mockmvc; -import static org.springframework.restdocs.mockmvc.util.IterableEnumeration.iterable; +import static org.springframework.restdocs.mockmvc.IterableEnumeration.iterable; import java.io.IOException; import java.io.PrintWriter; diff --git a/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/RestDocumentationResultHandler.java b/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/RestDocumentationResultHandler.java index 32834c9e..35d65436 100644 --- a/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/RestDocumentationResultHandler.java +++ b/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/RestDocumentationResultHandler.java @@ -16,7 +16,7 @@ package org.springframework.restdocs.mockmvc; -import static org.springframework.restdocs.mockmvc.util.IterableEnumeration.iterable; +import static org.springframework.restdocs.mockmvc.IterableEnumeration.iterable; import java.util.ArrayList; import java.util.Arrays; diff --git a/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/package-info.java b/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/package-info.java new file mode 100644 index 00000000..7ba1cf22 --- /dev/null +++ b/spring-restdocs-mockmvc/src/main/java/org/springframework/restdocs/mockmvc/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright 2014-2015 the original author or authors. + * + * Licensed 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. + */ + +/** + * Core classes for using Spring REST Docs with Spring Test's MockMvc. + */ +package org.springframework.restdocs.mockmvc; \ No newline at end of file