Polishing

- Correct copyright years
- Add `@since` to javadoc of new public classes
- Make new classes final where appropriate
This commit is contained in:
Andy Wilkinson
2016-05-25 11:26:02 +01:00
parent 42353a0b5f
commit 0446c99a10
57 changed files with 71 additions and 46 deletions

File diff suppressed because one or more lines are too long

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2016 the original author or authors.
* Copyright 2014-2016 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2016 the original author or authors.
* Copyright 2014-2016 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.
@@ -27,9 +27,9 @@ import static org.springframework.restdocs.mockmvc.RestDocumentationRequestBuild
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
public class MockMvcSnippetReuse extends SnippetReuse {
private MockMvc mockMvc;
public void documentation() throws Exception {
// tag::use[]
this.mockMvc.perform(get("/").accept(MediaType.APPLICATION_JSON))

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2016 the original author or authors.
* Copyright 2014-2016 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.
@@ -26,9 +26,9 @@ import static org.springframework.restdocs.hypermedia.HypermediaDocumentation.li
import static org.springframework.restdocs.restassured.RestAssuredRestDocumentation.document;
public class RestAssuredSnippetReuse extends SnippetReuse {
private RequestSpecification spec;
public void documentation() throws Exception {
// tag::use[]
RestAssured.given(this.spec)

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2016 the original author or authors.
* Copyright 2014-2016 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2016 the original author or authors.
* Copyright 2014-2016 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2016 the original author or authors.
* Copyright 2014-2016 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.
@@ -27,6 +27,7 @@ import org.springframework.restdocs.snippet.Snippet;
* @author Andy Wilkinson
* @author Paul-Christian Volkmer
* @author Raman Gupta
* @since 1.1.0
*/
public abstract class CliDocumentation {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2016 the original author or authors.
* Copyright 2014-2016 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.

View File

@@ -39,6 +39,7 @@ import org.springframework.util.StringUtils;
* @author Paul-Christian Volkmer
* @see CliDocumentation#curlRequest()
* @see CliDocumentation#curlRequest(Map)
* @since 1.1.0
*/
public class CurlRequestSnippet extends TemplatedSnippet {

View File

@@ -40,6 +40,7 @@ import org.springframework.util.StringUtils;
* @author Andy Wilkinson
* @see CliDocumentation#httpieRequest()
* @see CliDocumentation#httpieRequest(Map)
* @since 1.1.0
*/
public class HttpieRequestSnippet extends TemplatedSnippet {

View File

@@ -25,6 +25,7 @@ import org.springframework.restdocs.RestDocumentationContext;
* configuration implementation.
*
* @author Andy Wilkinson
* @since 1.1.0
*/
public abstract class AbstractConfigurer {

View File

@@ -21,6 +21,7 @@ package org.springframework.restdocs.config;
*
* @param <PARENT> The type of the configurer's parent
* @author Andy Wilkinson
* @since 1.1.0
*/
public abstract class AbstractNestedConfigurer<PARENT> extends AbstractConfigurer
implements NestedConfigurer<PARENT> {

View File

@@ -21,6 +21,7 @@ package org.springframework.restdocs.config;
*
* @param <PARENT> The parent's type
* @author Andy Wilkinson
* @since 1.1.0
*/
interface NestedConfigurer<PARENT> {

View File

@@ -39,6 +39,7 @@ import org.springframework.restdocs.templates.mustache.MustacheTemplateEngine;
* @param <T> The concrete type of this configurer, to be returned from methods that
* support chaining
* @author Andy Wilkinson
* @since 1.1.0
*/
public abstract class RestDocumentationConfigurer<S extends AbstractConfigurer, T> {

View File

@@ -22,6 +22,7 @@ import org.springframework.restdocs.templates.TemplateFormat;
* An encapsulation of the configuration for documentation snippets.
*
* @author Andy Wilkinson
* @since 1.1.0
*/
class SnippetConfiguration {

View File

@@ -35,6 +35,7 @@ import org.springframework.restdocs.templates.TemplateFormats;
* @param <PARENT> The type of the configurer's parent
* @param <TYPE> The concrete type of the configurer to be returned from chained methods
* @author Andy Wilkinson
* @since 1.1.0
*/
public abstract class SnippetConfigurer<PARENT, TYPE>
extends AbstractNestedConfigurer<PARENT> {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2016 the original author or authors.
* Copyright 2014-2016 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.
@@ -21,6 +21,7 @@ package org.springframework.restdocs.generate;
* generation.
*
* @author Andy Wilkinson
* @since 1.1.0
*/
public class RestDocumentationGenerationException extends RuntimeException {

View File

@@ -41,7 +41,7 @@ import org.springframework.util.Assert;
* @param <REQ> the request type that can be handled
* @param <RESP> the response type that can be handled
* @author Andy Wilkinson
* @since 1.1
* @since 1.1.0
*/
public final class RestDocumentationGenerator<REQ, RESP> {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2015 the original author or authors.
* Copyright 2014-2016 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.
@@ -15,6 +15,6 @@
*/
/**
* Classes that drive the generation of the documentaiton snippets.
* Classes that drive the generation of the documentation snippets.
*/
package org.springframework.restdocs.generate;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2016 the original author or authors.
* Copyright 2014-2016 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.
@@ -24,6 +24,7 @@ package org.springframework.restdocs.operation;
* @author Andy Wilkinson
* @see RequestConverter#convert(Object)
* @see ResponseConverter#convert(Object)
* @since 1.1.0
*/
public class ConversionException extends RuntimeException {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2016 the original author or authors.
* Copyright 2014-2016 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.
@@ -22,6 +22,7 @@ package org.springframework.restdocs.operation;
*
* @param <R> The implementation-specific request type
* @author Andy Wilkinson
* @since 1.1.0
*/
public interface RequestConverter<R> {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2016 the original author or authors.
* Copyright 2014-2016 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.
@@ -22,6 +22,7 @@ package org.springframework.restdocs.operation;
*
* @param <R> The implementation-specific response type
* @author Andy Wilkinson
* @since 1.1.0
*/
public interface ResponseConverter<R> {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2016 the original author or authors.
* Copyright 2014-2016 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2016 the original author or authors.
* Copyright 2014-2016 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.

View File

@@ -23,6 +23,7 @@ import org.springframework.restdocs.snippet.IgnorableDescriptor;
*
* @author Andy Wilkinson
* @see RequestDocumentation#partWithName
* @since 1.1.0
*/
public class RequestPartDescriptor extends IgnorableDescriptor<RequestPartDescriptor> {

View File

@@ -42,6 +42,7 @@ import org.springframework.util.Assert;
* @see RequestDocumentation#requestParts(Map, RequestPartDescriptor...)
* @see RequestDocumentation#relaxedRequestParts(RequestPartDescriptor...)
* @see RequestDocumentation#relaxedRequestParts(Map, RequestPartDescriptor...)
* @since 1.1.0
*/
public class RequestPartsSnippet extends TemplatedSnippet {

View File

@@ -23,7 +23,7 @@ import org.springframework.util.PropertyPlaceholderHelper.PlaceholderResolver;
* A factory for creating {@link PlaceholderResolver} instances.
*
* @author Andy Wilkinson
* @since 1.1
* @since 1.1.0
*/
public interface PlaceholderResolverFactory {

View File

@@ -24,7 +24,7 @@ import org.springframework.util.PropertyPlaceholderHelper.PlaceholderResolver;
* {@link RestDocumentationContextPlaceholderResolver} instances.
*
* @author Andy Wilkinson
* @since 1.1
* @since 1.1.0
*/
public final class RestDocumentationContextPlaceholderResolverFactory
implements PlaceholderResolverFactory {

View File

@@ -21,6 +21,7 @@ package org.springframework.restdocs.templates;
* as Asciidoctor or Markdown.
*
* @author Andy Wilkinson
* @since 1.1.0
*/
public interface TemplateFormat {

View File

@@ -20,6 +20,7 @@ package org.springframework.restdocs.templates;
* An enumeration of the built-in formats for which templates are provuded.
*
* @author Andy Wilkinson
* @since 1.1.0
*/
public abstract class TemplateFormats {

View File

@@ -27,6 +27,7 @@ import org.springframework.restdocs.mustache.Template.Fragment;
* formatting.
*
* @author Andy Wilkinson
* @since 1.1.0
*/
public final class AsciidoctorTableCellContentLambda implements Lambda {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2016 the original author or authors.
* Copyright 2014-2016 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2016 the original author or authors.
* Copyright 2014-2016 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2015 the original author or authors.
* 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2016 the original author or authors.
* Copyright 2014-2016 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2016 the original author or authors.
* Copyright 2014-2016 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2016 the original author or authors.
* Copyright 2014-2016 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2016 the original author or authors.
* Copyright 2014-2016 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2016 the original author or authors.
* Copyright 2014-2016 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2016 the original author or authors.
* Copyright 2014-2016 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2016 the original author or authors.
* Copyright 2014-2016 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2016 the original author or authors.
* Copyright 2014-2016 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2016 the original author or authors.
* Copyright 2014-2016 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2016 the original author or authors.
* Copyright 2014-2016 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2016 the original author or authors.
* Copyright 2014-2016 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.

View File

@@ -50,7 +50,6 @@ import static org.springframework.restdocs.mockmvc.IterableEnumeration.iterable;
* {@link MockHttpServletRequest}.
*
* @author Andy Wilkinson
*
*/
class MockMvcRequestConverter implements RequestConverter<MockHttpServletRequest> {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2016 the original author or authors.
* Copyright 2014-2016 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.
@@ -33,8 +33,9 @@ import org.springframework.web.context.WebApplicationContext;
* A MockMvc-specific {@link RestDocumentationConfigurer}.
*
* @author Andy Wilkinson
* @since 1.1.0
*/
public class MockMvcRestDocumentationConfigurer extends
public final class MockMvcRestDocumentationConfigurer extends
RestDocumentationConfigurer<MockMvcSnippetConfigurer, MockMvcRestDocumentationConfigurer>
implements MockMvcConfigurer {

View File

@@ -26,8 +26,9 @@ import org.springframework.web.context.WebApplicationContext;
* A configurer that can be used to configure the generated documentation snippets.
*
* @author Andy Wilkinson
* @since 1.1.0
*/
public class MockMvcSnippetConfigurer extends
public final class MockMvcSnippetConfigurer extends
SnippetConfigurer<MockMvcRestDocumentationConfigurer, MockMvcSnippetConfigurer>
implements MockMvcConfigurer {

View File

@@ -26,6 +26,7 @@ import org.springframework.restdocs.snippet.Snippet;
* Static factory methods for documenting RESTful APIs using REST Assured.
*
* @author Andy Wilkinson
* @since 1.1.0
*/
public abstract class RestAssuredRestDocumentation {

View File

@@ -33,6 +33,7 @@ import org.springframework.restdocs.config.RestDocumentationConfigurer;
* A REST Assured-specific {@link RestDocumentationConfigurer}.
*
* @author Andy Wilkinson
* @since 1.1.0
*/
public final class RestAssuredRestDocumentationConfigurer extends
RestDocumentationConfigurer<RestAssuredSnippetConfigurer, RestAssuredRestDocumentationConfigurer>

View File

@@ -29,6 +29,7 @@ import org.springframework.restdocs.config.SnippetConfigurer;
* using REST Assured.
*
* @author Andy Wilkinson
* @since 1.1.0
*/
public final class RestAssuredSnippetConfigurer extends
SnippetConfigurer<RestAssuredRestDocumentationConfigurer, RestAssuredSnippetConfigurer>

View File

@@ -34,6 +34,7 @@ import org.springframework.util.Assert;
* A REST Assured {@link Filter} for documenting RESTful APIs.
*
* @author Andy Wilkinson
* @since 1.1.0
*/
public class RestDocumentationFilter implements Filter {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2016 the original author or authors.
* Copyright 2014-2016 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.
@@ -28,6 +28,7 @@ import org.springframework.restdocs.operation.OperationResponse;
* {@link OperationResponse response} before it is documented.
*
* @author Andy Wilkinson
* @since 1.1.0
*/
public abstract class RestAssuredPreprocessors {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2016 the original author or authors.
* Copyright 2014-2016 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.
@@ -53,6 +53,7 @@ import org.springframework.web.util.UriComponentsBuilder;
* </ul>
*
* @author Andy Wilkinson
* @since 1.1.0
*/
public final class UriModifyingOperationPreprocessor implements OperationPreprocessor {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2016 the original author or authors.
* Copyright 2014-2016 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2016 the original author or authors.
* Copyright 2014-2016 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.

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2016 the original author or authors.
* Copyright 2014-2016 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.