Fix javadoc checkstyle issues

Fix checkstyle violations for javadoc.

Issue: SPR-16968
This commit is contained in:
Phillip Webb
2018-06-20 18:45:54 -07:00
committed by Juergen Hoeller
parent 032096d699
commit e0480f75ac
928 changed files with 3729 additions and 2686 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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,7 +22,7 @@ import org.springframework.lang.Nullable;
* Super class for exceptions that can occur whilst processing expressions.
*
* @author Andy Clement
* @author Phil Webb
* @author Phillip Webb
* @since 3.0
*/
@SuppressWarnings("serial")

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2018 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.
@@ -25,16 +25,34 @@ package org.springframework.expression;
*/
public enum Operation {
/**
* Add operation.
*/
ADD,
/**
* Subtract operation.
*/
SUBTRACT,
/**
* Divide operation.
*/
DIVIDE,
/**
* Multiply operation.
*/
MULTIPLY,
/**
* Modulus operation.
*/
MODULUS,
/**
* Power operation.
*/
POWER
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -31,6 +31,9 @@ import org.springframework.util.ObjectUtils;
*/
public class TypedValue {
/**
* {@link TypedValue} for {@code null}.
*/
public static final TypedValue NULL = new TypedValue(null);

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -44,7 +44,7 @@ public class CompositeStringExpression implements Expression {
private final String expressionString;
/** The array of expressions that make up the composite expression */
/** The array of expressions that make up the composite expression. */
private final Expression[] expressions;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -35,7 +35,7 @@ import org.springframework.lang.Nullable;
*/
public class LiteralExpression implements Expression {
/** Fixed literal value of this expression */
/** Fixed literal value of this expression. */
private final String literalValue;

View File

@@ -530,24 +530,27 @@ public class CodeFlow implements Opcodes {
}
/**
* Returns if the descriptor is for a boolean primitive or boolean reference type.
* @param descriptor type descriptor
* @return {@code true} if the descriptor is for a boolean primitive or boolean reference type
* @return {@code true} if the descriptor is boolean compatible
*/
public static boolean isBooleanCompatible(@Nullable String descriptor) {
return (descriptor != null && (descriptor.equals("Z") || descriptor.equals("Ljava/lang/Boolean")));
}
/**
* Returns if the descriptor is for a primitive type.
* @param descriptor type descriptor
* @return {@code true} if the descriptor is for a primitive type
* @return {@code true} if a primitive type
*/
public static boolean isPrimitive(@Nullable String descriptor) {
return (descriptor != null && descriptor.length() == 1);
}
/**
* Returns if the descriptor is for a primitive array (e.g. "[[I").
* @param descriptor the descriptor for a possible primitive array
* @return {@code true} if the descriptor is for a primitive array (e.g. "[[I")
* @return {@code true} if the descriptor a primitive array
*/
public static boolean isPrimitiveArray(@Nullable String descriptor) {
if (descriptor == null) {
@@ -662,6 +665,7 @@ public class CodeFlow implements Opcodes {
}
/**
* Convert a type descriptor to the single character primitive descriptor.
* @param descriptor a descriptor for a type that should have a primitive representation
* @return the single character descriptor for a primitive input descriptor
*/
@@ -941,7 +945,7 @@ public class CodeFlow implements Opcodes {
}
/**
* @return true if the supplied array type has a core component reference type
* Returns if the supplied array type has a core component reference type.
*/
public static boolean isReferenceTypeArray(String arraytype) {
int length = arraytype.length();
@@ -1004,6 +1008,9 @@ public class CodeFlow implements Opcodes {
}
/**
* Interface used to generate fields.
*/
@FunctionalInterface
public interface FieldAdder {
@@ -1011,6 +1018,9 @@ public class CodeFlow implements Opcodes {
}
/**
* Interface used to generate {@code clinit} static initializer blocks.
*/
@FunctionalInterface
public interface ClinitAdder {

View File

@@ -293,6 +293,9 @@ public enum SpelMessage {
}
/**
* Message kinds.
*/
public enum Kind { INFO, WARNING, ERROR }
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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,7 +21,7 @@ import org.springframework.expression.TypedValue;
import org.springframework.lang.Nullable;
/**
* Represents a node in the Ast for a parsed expression.
* Represents a node in the AST for a parsed expression.
*
* @author Andy Clement
* @since 3.0
@@ -66,12 +66,14 @@ public interface SpelNode {
void setValue(ExpressionState expressionState, @Nullable Object newValue) throws EvaluationException;
/**
* @return the string form of this AST node
* Return the string form the this AST node.
* @return the string form
*/
String toStringAST();
/**
* @return the number of children under this node
* Return the number of children under this node.
* @return the child count
*/
int getChildCount();
@@ -91,12 +93,14 @@ public interface SpelNode {
Class<?> getObjectClass(@Nullable Object obj);
/**
* @return the start position of this Ast node in the expression string
* Return the start position of this AST node in the expression string.
* @return the start position
*/
int getStartPosition();
/**
* @return the end position of this Ast node in the expression string
* Return the end position of this AST node in the expression string.
* @return the end position
*/
int getEndPosition();

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -25,7 +25,8 @@ import org.springframework.expression.spel.SpelEvaluationException;
import org.springframework.lang.Nullable;
/**
* Represents a DOT separated expression sequence, such as 'property1.property2.methodOne()'
* Represents a DOT separated expression sequence, such as
* {@code 'property1.property2.methodOne()'}.
*
* @author Andy Clement
* @since 3.0
@@ -112,7 +113,7 @@ public class CompoundExpression extends SpelNodeImpl {
}
return sb.toString();
}
@Override
public boolean isCompilable() {
for (SpelNodeImpl child: this.children) {
@@ -122,7 +123,7 @@ public class CompoundExpression extends SpelNodeImpl {
}
return true;
}
@Override
public void generateCode(MethodVisitor mv, CodeFlow cf) {
for (int i = 0; i < this.children.length;i++) {

View File

@@ -63,7 +63,7 @@ public class ConstructorReference extends SpelNodeImpl {
private SpelNodeImpl[] dimensions;
// TODO is this caching safe - passing the expression around will mean this executor is also being passed around
/** The cached executor that may be reused on subsequent evaluations */
/** The cached executor that may be reused on subsequent evaluations. */
@Nullable
private volatile ConstructorExecutor cachedExecutor;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -18,8 +18,11 @@ package org.springframework.expression.spel.ast;
import org.springframework.expression.TypedValue;
import org.springframework.expression.spel.ExpressionState;
import org.springframework.expression.spel.SpelNode;
/**
* An 'identifier' {@link SpelNode}.
*
* @author Andy Clement
* @since 3.0
*/

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -73,7 +73,8 @@ public abstract class Operator extends SpelNodeImpl {
}
/**
* String format for all operators is the same '(' [operand] [operator] [operand] ')'
* String format for all operators is the same
* {@code '(' [operand] [operator] [operand] ')'}.
*/
@Override
public String toStringAST() {

View File

@@ -49,11 +49,20 @@ import org.springframework.util.ObjectUtils;
*/
public class Selection extends SpelNodeImpl {
public static final int ALL = 0; // ?[]
/**
* All items ({@code ?[]}).
*/
public static final int ALL = 0;
public static final int FIRST = 1; // ^[]
/**
* The first item ({@code ^[]}).
*/
public static final int FIRST = 1;
public static final int LAST = 2; // $[]
/**
* The last item ({@code $[]}).
*/
public static final int LAST = 2;
private final int variant;

View File

@@ -24,22 +24,49 @@ package org.springframework.expression.spel.ast;
*/
public enum TypeCode {
/**
* An {@link Object}.
*/
OBJECT(Object.class),
/**
* A {@code boolean}.
*/
BOOLEAN(Boolean.TYPE),
/**
* A {@code byte}.
*/
BYTE(Byte.TYPE),
/**
* A {@code char}.
*/
CHAR(Character.TYPE),
/**
* A {@code double}.
*/
DOUBLE(Double.TYPE),
/**
* A {@code float}.
*/
FLOAT(Float.TYPE),
/**
* An {@code int}.
*/
INT(Integer.TYPE),
/**
* A {@code long}.
*/
LONG(Long.TYPE),
/**
* An {@link Object}.
*/
SHORT(Short.TYPE);

View File

@@ -28,7 +28,8 @@ import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
/**
* Represents a reference to a type, for example "T(String)" or "T(com.somewhere.Foo)"
* Represents a reference to a type, for example
* {@code "T(String)" or "T(com.somewhere.Foo)"}.
*
* @author Andy Clement
*/
@@ -92,12 +93,12 @@ public class TypeReference extends SpelNodeImpl {
sb.append(")");
return sb.toString();
}
@Override
public boolean isCompilable() {
return (this.exitTypeDescriptor != null);
}
@Override
public void generateCode(MethodVisitor mv, CodeFlow cf) {
// TODO Future optimization - if followed by a static method call, skip generating code here

View File

@@ -456,7 +456,7 @@ class InternalSpelExpressionParser extends TemplateAwareExpressionParser {
}
/**
* Used for consuming arguments for either a method or a constructor call
* Used for consuming arguments for either a method or a constructor call.
*/
private void consumeArguments(List<SpelNodeImpl> accumulatedArguments) {
Token t = peekToken();

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2018 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.
@@ -19,13 +19,21 @@ package org.springframework.expression.spel.support;
import org.springframework.expression.TypedValue;
/**
* A {@link TypedValue} for booleans.
*
* @author Andy Clement
* @since 3.0
*/
public class BooleanTypedValue extends TypedValue {
/**
* True.
*/
public static final BooleanTypedValue TRUE = new BooleanTypedValue(true);
/**
* False.
*/
public static final BooleanTypedValue FALSE = new BooleanTypedValue(false);

View File

@@ -373,15 +373,18 @@ public abstract class ReflectionHelper {
}
/**
* Arguments match kinds.
*/
enum ArgumentsMatchKind {
/** An exact match is where the parameter types exactly match what the method/constructor is expecting */
/** An exact match is where the parameter types exactly match what the method/constructor is expecting. */
EXACT,
/** A close match is where the parameter types either exactly match or are assignment-compatible */
/** A close match is where the parameter types either exactly match or are assignment-compatible. */
CLOSE,
/** A conversion match is where the type converter must be used to transform some of the parameter types */
/** A conversion match is where the type converter must be used to transform some of the parameter types. */
REQUIRES_CONVERSION
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@@ -29,6 +29,8 @@ import org.springframework.lang.Nullable;
import org.springframework.util.ReflectionUtils;
/**
* {@link MethodExecutor} that works via reflection.
*
* @author Andy Clement
* @author Juergen Hoeller
* @since 3.0

View File

@@ -327,6 +327,7 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
}
/**
* Get the last read invoker pair.
* @deprecated as of 4.3.15 since it is not used within the framework anymore
*/
@Deprecated
@@ -639,6 +640,9 @@ public class ReflectivePropertyAccessor implements PropertyAccessor {
*/
public static class OptimalPropertyAccessor implements CompilablePropertyAccessor {
/**
* The member being accessed.
*/
public final Member member;
private final TypeDescriptor typeDescriptor;

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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,8 @@ import org.springframework.expression.OperatorOverloader;
import org.springframework.lang.Nullable;
/**
* Standard implementation of {@link OperatorOverloader}.
*
* @author Juergen Hoeller
* @since 3.0
*/