aboutsummaryrefslogtreecommitdiff
path: root/javaparser-core/src/main/java/com
diff options
context:
space:
mode:
authorNicholas Smith <nicholas.p.smith@live.co.uk>2015-01-13 10:19:20 +0000
committerNicholas Smith <nicholas.p.smith@live.co.uk>2015-01-13 10:19:20 +0000
commit28e1d75307a27c67af7f8030bf8ab854ecf5f1ee (patch)
treefb092c318271d9c65d9a594524bb511d36392dfb /javaparser-core/src/main/java/com
parent1fcc2b642c65643b16fa6fc1e456355efa7815f2 (diff)
downloadjavaparser-28e1d75307a27c67af7f8030bf8ab854ecf5f1ee.tar.gz
#80 Errors in Javadoc corrected
Diffstat (limited to 'javaparser-core/src/main/java/com')
-rw-r--r--javaparser-core/src/main/java/com/github/javaparser/ASTHelper.java8
-rw-r--r--javaparser-core/src/main/java/com/github/javaparser/JavaParser.java21
-rw-r--r--javaparser-core/src/main/java/com/github/javaparser/ast/CompilationUnit.java21
-rw-r--r--javaparser-core/src/main/java/com/github/javaparser/ast/ImportDeclaration.java17
-rw-r--r--javaparser-core/src/main/java/com/github/javaparser/ast/Node.java16
-rw-r--r--javaparser-core/src/main/java/com/github/javaparser/ast/PackageDeclaration.java17
-rw-r--r--javaparser-core/src/main/java/com/github/javaparser/ast/TypeParameter.java17
-rw-r--r--javaparser-core/src/main/java/com/github/javaparser/ast/body/MethodDeclaration.java2
-rw-r--r--javaparser-core/src/main/java/com/github/javaparser/ast/body/ModifierSet.java13
-rw-r--r--javaparser-core/src/main/java/com/github/javaparser/ast/body/WithDeclaration.java2
10 files changed, 52 insertions, 82 deletions
diff --git a/javaparser-core/src/main/java/com/github/javaparser/ASTHelper.java b/javaparser-core/src/main/java/com/github/javaparser/ASTHelper.java
index 53c664aeb..8dfc4e37a 100644
--- a/javaparser-core/src/main/java/com/github/javaparser/ASTHelper.java
+++ b/javaparser-core/src/main/java/com/github/javaparser/ASTHelper.java
@@ -241,8 +241,8 @@ public final class ASTHelper {
* Adds the given statement to the specified block. The list of statements
* will be initialized if it is <code>null</code>.
*
- * @param block
- * @param stmt
+ * @param block to have expression added to
+ * @param stmt to be added
*/
public static void addStmt(BlockStmt block, Statement stmt) {
List<Statement> stmts = block.getStmts();
@@ -257,8 +257,8 @@ public final class ASTHelper {
* Adds the given expression to the specified block. The list of statements
* will be initialized if it is <code>null</code>.
*
- * @param block
- * @param stmt
+ * @param block to have expression added to
+ * @param expr to be added
*/
public static void addStmt(BlockStmt block, Expression expr) {
addStmt(block, new ExpressionStmt(expr));
diff --git a/javaparser-core/src/main/java/com/github/javaparser/JavaParser.java b/javaparser-core/src/main/java/com/github/javaparser/JavaParser.java
index 47002353f..9c1a47f78 100644
--- a/javaparser-core/src/main/java/com/github/javaparser/JavaParser.java
+++ b/javaparser-core/src/main/java/com/github/javaparser/JavaParser.java
@@ -203,7 +203,6 @@ public final class JavaParser {
* @return BlockStmt representing the Java block
* @throws ParseException
* if the source code has parser errors
- * @throws IOException
*/
public static BlockStmt parseBlock(final String blockStatement)
throws ParseException {
@@ -222,10 +221,8 @@ public final class JavaParser {
* @return Statement representing the Java statement
* @throws ParseException
* if the source code has parser errors
- * @throws IOException
*/
- public static Statement parseStatement(final String statement)
- throws ParseException {
+ public static Statement parseStatement(final String statement) throws ParseException {
StringReader sr = new StringReader(statement);
Statement stmt = new ASTParser(sr).Statement();
sr.close();
@@ -241,10 +238,8 @@ public final class JavaParser {
* @return ImportDeclaration representing the Java import declaration
* @throws ParseException
* if the source code has parser errors
- * @throws IOException
*/
- public static ImportDeclaration parseImport(final String importDeclaration)
- throws ParseException {
+ public static ImportDeclaration parseImport(final String importDeclaration) throws ParseException {
StringReader sr = new StringReader(importDeclaration);
ImportDeclaration id = new ASTParser(sr).ImportDeclaration();
sr.close();
@@ -260,10 +255,8 @@ public final class JavaParser {
* @return Expression representing the Java expression
* @throws ParseException
* if the source code has parser errors
- * @throws IOException
*/
- public static Expression parseExpression(final String expression)
- throws ParseException {
+ public static Expression parseExpression(final String expression) throws ParseException {
StringReader sr = new StringReader(expression);
Expression e = new ASTParser(sr).Expression();
sr.close();
@@ -279,10 +272,8 @@ public final class JavaParser {
* @return AnnotationExpr representing the Java annotation
* @throws ParseException
* if the source code has parser errors
- * @throws IOException
*/
- public static AnnotationExpr parseAnnotation(final String annotation)
- throws ParseException {
+ public static AnnotationExpr parseAnnotation(final String annotation) throws ParseException {
StringReader sr = new StringReader(annotation);
AnnotationExpr ae = new ASTParser(sr).Annotation();
sr.close();
@@ -298,10 +289,8 @@ public final class JavaParser {
* @return BodyDeclaration representing the Java annotation
* @throws ParseException
* if the source code has parser errors
- * @throws IOException
*/
- public static BodyDeclaration parseBodyDeclaration(final String body)
- throws ParseException {
+ public static BodyDeclaration parseBodyDeclaration(final String body) throws ParseException {
StringReader sr = new StringReader(body);
BodyDeclaration bd = new ASTParser(sr).AnnotationBodyDeclaration();
sr.close();
diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/CompilationUnit.java b/javaparser-core/src/main/java/com/github/javaparser/ast/CompilationUnit.java
index d927b9aa5..911f95333 100644
--- a/javaparser-core/src/main/java/com/github/javaparser/ast/CompilationUnit.java
+++ b/javaparser-core/src/main/java/com/github/javaparser/ast/CompilationUnit.java
@@ -39,20 +39,13 @@ import java.util.List;
* compilation unit.
* </p>
* The CompilationUnit is constructed following the syntax:<br>
- * <code>
- * <table>
- * <tr valign=baseline>
- * <td align=right>CompilationUnit</td>
- * <td align=center>::=</td>
- * <td align=left>
- * ( {@link PackageDeclaration} )?<br>
- * ( {@link ImportDeclaration} )*<br>
- * ( {@link TypeDeclaration} )*<br>
- * </td>
- * </tr>
- * </table>
- * </code>
- *
+ * <pre>
+ * {@code
+ * CompilationUnit ::= ( }{@link PackageDeclaration}{@code )?
+ * ( }{@link ImportDeclaration}{@code )*
+ * ( }{@link TypeDeclaration}{@code )*
+ * }
+ * </pre>
* @author Julio Vilmar Gesser
*/
public final class CompilationUnit extends Node {
diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/ImportDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/ast/ImportDeclaration.java
index e2089317a..a460351ed 100644
--- a/javaparser-core/src/main/java/com/github/javaparser/ast/ImportDeclaration.java
+++ b/javaparser-core/src/main/java/com/github/javaparser/ast/ImportDeclaration.java
@@ -31,18 +31,11 @@ import com.github.javaparser.ast.visitor.VoidVisitor;
* {@link CompilationUnit}.
* </p>
* The ImportDeclaration is constructed following the syntax:<br>
- * <code>
- * <table>
- * <tr valign=baseline>
- * <td align=right>ImportDeclaration</td>
- * <td align=center>::=</td>
- * <td align=left>
- * "import" ( "static" )? {@link NameExpr} ( "." "*" )? ";"
- * </td>
- * </tr>
- * </table>
- * </code>
- *
+ * <pre>
+ * {@code
+ * ImportDeclaration ::= "import" ( "static" )? }{@link NameExpr}{@code ( "." "*" )? ";"
+ * }
+ * </pre>
* @author Julio Vilmar Gesser
*/
public final class ImportDeclaration extends Node {
diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/Node.java b/javaparser-core/src/main/java/com/github/javaparser/ast/Node.java
index ae9eccc48..5ab9fd14a 100644
--- a/javaparser-core/src/main/java/com/github/javaparser/ast/Node.java
+++ b/javaparser-core/src/main/java/com/github/javaparser/ast/Node.java
@@ -119,6 +119,8 @@ public abstract class Node {
/**
* This is a comment associated with this node.
+ *
+ * @return comment property
*/
public final Comment getComment() {
return comment;
@@ -126,6 +128,8 @@ public abstract class Node {
/**
* Use this to retrieve additional information associated to this node.
+ *
+ * @return data property
*/
public final Object getData() {
return data;
@@ -171,6 +175,8 @@ public abstract class Node {
/**
* Use this to store additional information to this node.
+ *
+ * @param comment to be set
*/
public final void setComment(final Comment comment) {
if (comment!=null && (this instanceof Comment)){
@@ -188,6 +194,8 @@ public abstract class Node {
/**
* Use this to store additional information to this node.
+ *
+ * @param data to be set
*/
public final void setData(final Object data) {
this.data = data;
@@ -271,7 +279,7 @@ public abstract class Node {
*
* When more than one comments preceed a statement, the one immediately preceeding it
* it is associated with the statements, while the others are "orphan".
- * @return
+ * @return all comments that cannot be attributed to a concept
*/
public List<Comment> getOrphanComments(){
return orphanComments;
@@ -280,8 +288,8 @@ public abstract class Node {
/**
* This is the list of Comment which are contained in the Node either because
* they are properly associated to one of its children or because they are floating
- * around inside the Node.
- * @return
+ * around inside the Node
+ * @return all Comments within the node as a list
*/
public List<Comment> getAllContainedComments(){
List<Comment> comments = new LinkedList<Comment>();
@@ -300,6 +308,8 @@ public abstract class Node {
/**
* Assign a new parent to this node, removing it
* from the list of children of the previous parent, if any.
+ *
+ * @param parentNode node to be set as parent
*/
public void setParentNode(Node parentNode) {
// remove from old parent, if any
diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/PackageDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/ast/PackageDeclaration.java
index 64cfa8370..c76a4a5a8 100644
--- a/javaparser-core/src/main/java/com/github/javaparser/ast/PackageDeclaration.java
+++ b/javaparser-core/src/main/java/com/github/javaparser/ast/PackageDeclaration.java
@@ -34,18 +34,11 @@ import java.util.List;
* optional for the {@link CompilationUnit}.
* </p>
* The PackageDeclaration is constructed following the syntax:<br>
- * <code>
- * <table>
- * <tr valign=baseline>
- * <td align=right>PackageDeclaration</td>
- * <td align=center>::=</td>
- * <td align=left>
- * ( {@link AnnotationExpr} )* "package" {@link NameExpr} ) ";"
- * </td>
- * </tr>
- * </table>
- * </code>
- *
+ * <pre>
+ * {@code
+ * PackageDeclaration ::= ( }{@link AnnotationExpr}{@code )* "package" }{@link NameExpr}{@code ) ";"
+ * }
+ * </pre>
* @author Julio Vilmar Gesser
*/
public final class PackageDeclaration extends Node {
diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/TypeParameter.java b/javaparser-core/src/main/java/com/github/javaparser/ast/TypeParameter.java
index 906fd7260..6a3951dc3 100644
--- a/javaparser-core/src/main/java/com/github/javaparser/ast/TypeParameter.java
+++ b/javaparser-core/src/main/java/com/github/javaparser/ast/TypeParameter.java
@@ -33,18 +33,11 @@ import java.util.List;
* This class represents the declaration of a generics argument.
* </p>
* The TypeParameter is constructed following the syntax:<br>
- * <code>
- * <table>
- * <tr valign=baseline>
- * <td align=right>TypeParameter</td>
- * <td align=center>::=</td>
- * <td align=left>
- * &lt;IDENTIFIER&gt; ( "extends" {@link ClassOrInterfaceType} ( "&" {@link ClassOrInterfaceType} )* )?
- * </td>
- * </tr>
- * </table>
- * </code>
- *
+ * <pre>
+ * {@code
+ * TypeParameter ::= <IDENTIFIER> ( "extends" }{@link ClassOrInterfaceType}{@code ( "&" }{@link ClassOrInterfaceType}{@code )* )?
+ * }
+ * </pre>
* @author Julio Vilmar Gesser
*/
public final class TypeParameter extends Node {
diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/body/MethodDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/ast/body/MethodDeclaration.java
index b2c5044fb..748dff011 100644
--- a/javaparser-core/src/main/java/com/github/javaparser/ast/body/MethodDeclaration.java
+++ b/javaparser-core/src/main/java/com/github/javaparser/ast/body/MethodDeclaration.java
@@ -219,7 +219,7 @@ public final class MethodDeclaration extends BodyDeclaration implements Document
* [accessSpecifier] [static] [abstract] [final] [native]
* [synchronized] returnType methodName ([paramlist])
* [throws exceptionsList]
- * @return
+ * @return method declaration as String
*/
@Override
public String getDeclarationAsString() {
diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/body/ModifierSet.java b/javaparser-core/src/main/java/com/github/javaparser/ast/body/ModifierSet.java
index c4f20bc75..5008d3fe0 100644
--- a/javaparser-core/src/main/java/com/github/javaparser/ast/body/ModifierSet.java
+++ b/javaparser-core/src/main/java/com/github/javaparser/ast/body/ModifierSet.java
@@ -65,9 +65,6 @@ public final class ModifierSet {
}
}
- /**
- * Adds the given modifier.
- */
public static int addModifier(int modifiers, int mod) {
return modifiers | mod;
}
@@ -100,16 +97,13 @@ public final class ModifierSet {
* Is the element accessible from within the package?
* It is the level of access which is applied if no modifiers are chosen,
* it is sometimes called "default".
+ * @param modifiers indicator
+ * @return true if modifier denotes package level access
*/
public static boolean hasPackageLevelAccess(int modifiers) {
return !isPublic(modifiers) && !isProtected(modifiers) && !isPrivate(modifiers);
}
- /*
- * A set of accessors that indicate whether the specified modifier is in the
- * set.
- */
-
public static boolean isPublic(int modifiers) {
return (modifiers & PUBLIC) != 0;
}
@@ -136,6 +130,9 @@ public final class ModifierSet {
/**
* Removes the given modifier.
+ * @param modifiers existing modifiers
+ * @param mod modifier to be removed
+ * @return result for removing modifier
*/
public static int removeModifier(int modifiers, int mod) {
return modifiers & ~mod;
diff --git a/javaparser-core/src/main/java/com/github/javaparser/ast/body/WithDeclaration.java b/javaparser-core/src/main/java/com/github/javaparser/ast/body/WithDeclaration.java
index 5efa149c8..d5c0e6b2c 100644
--- a/javaparser-core/src/main/java/com/github/javaparser/ast/body/WithDeclaration.java
+++ b/javaparser-core/src/main/java/com/github/javaparser/ast/body/WithDeclaration.java
@@ -11,6 +11,7 @@ public interface WithDeclaration {
/**
* As {@link WithDeclaration#getDeclarationAsString(boolean, boolean)} including
* both the modifiers and the throws clause.
+ * @return String representation of declaration
*/
String getDeclarationAsString();
@@ -19,6 +20,7 @@ public interface WithDeclaration {
* It should fit one string.
* @param includingModifiers flag to include the modifiers (if present) in the string produced
* @param includingThrows flag to include the throws clause (if present) in the string produced
+ * @return String representation of declaration based on parameter flags
*/
String getDeclarationAsString(boolean includingModifiers, boolean includingThrows);
}