emptyList(), true);
+ }
+
+ public static TypeArguments withArguments(List typeArguments) {
+ return new TypeArguments(typeArguments, false);
+ }
+}
\ No newline at end of file
diff --git a/bin/app/data/projects/javaparser/src/main/java/com/github/javaparser/ast/TypeParameter.java b/bin/app/data/projects/javaparser/src/main/java/com/github/javaparser/ast/TypeParameter.java
new file mode 100644
index 00000000..8b6b6f56
--- /dev/null
+++ b/bin/app/data/projects/javaparser/src/main/java/com/github/javaparser/ast/TypeParameter.java
@@ -0,0 +1,136 @@
+/*
+ * Copyright (C) 2007-2010 Júlio Vilmar Gesser.
+ * Copyright (C) 2011, 2013-2016 The JavaParser Team.
+ *
+ * This file is part of JavaParser.
+ *
+ * JavaParser can be used either under the terms of
+ * a) the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * b) the terms of the Apache License
+ *
+ * You should have received a copy of both licenses in LICENCE.LGPL and
+ * LICENCE.APACHE. Please refer to those files for details.
+ *
+ * JavaParser is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ */
+
+package com.github.javaparser.ast;
+
+import static com.github.javaparser.utils.Utils.ensureNotNull;
+
+import java.util.List;
+
+import com.github.javaparser.Range;
+import com.github.javaparser.ast.expr.AnnotationExpr;
+import com.github.javaparser.ast.nodeTypes.NodeWithName;
+import com.github.javaparser.ast.type.ClassOrInterfaceType;
+import com.github.javaparser.ast.visitor.GenericVisitor;
+import com.github.javaparser.ast.visitor.VoidVisitor;
+
+/**
+ *
+ * This class represents the declaration of a generics argument.
+ *
+ * The TypeParameter is constructed following the syntax:
+ *
+ * {@code
+ * TypeParameter ::= ( "extends" }{@link ClassOrInterfaceType}{@code ( "&" }{@link ClassOrInterfaceType}{@code )* )?
+ * }
+ *
+ * @author Julio Vilmar Gesser
+ */
+public final class TypeParameter extends Node implements NodeWithName {
+
+ private String name;
+
+ private List annotations;
+
+ private List typeBound;
+
+ public TypeParameter() {
+ }
+
+ public TypeParameter(final String name, final List typeBound) {
+ setName(name);
+ setTypeBound(typeBound);
+ }
+
+ public TypeParameter(Range range, final String name, final List typeBound) {
+ super(range);
+ setName(name);
+ setTypeBound(typeBound);
+ }
+
+ public TypeParameter(Range range, String name, List typeBound, List annotations) {
+ this(range, name, typeBound);
+ setTypeBound(typeBound);
+ setAnnotations(annotations);
+ }
+
+ @Override public R accept(final GenericVisitor v, final A arg) {
+ return v.visit(this, arg);
+ }
+
+ @Override public void accept(final VoidVisitor v, final A arg) {
+ v.visit(this, arg);
+ }
+
+ /**
+ * Return the name of the paramenter.
+ *
+ * @return the name of the paramenter
+ */
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Return the list of {@link ClassOrInterfaceType} that this parameter
+ * extends. Return null null if there are no type.
+ *
+ * @return list of types that this paramente extends or null
+ */
+ public List getTypeBound() {
+ typeBound = ensureNotNull(typeBound);
+ return typeBound;
+ }
+
+ /**
+ * Sets the name of this type parameter.
+ *
+ * @param name
+ * the name to set
+ */
+ @Override
+ public TypeParameter setName(final String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Sets the list o types.
+ *
+ * @param typeBound
+ * the typeBound to set
+ */
+ public void setTypeBound(final List typeBound) {
+ this.typeBound = typeBound;
+ setAsParentNodeOf(typeBound);
+ }
+
+ public List getAnnotations() {
+ annotations = ensureNotNull(annotations);
+ return annotations;
+ }
+
+ public void setAnnotations(List annotations) {
+ this.annotations = annotations;
+ setAsParentNodeOf(this.annotations);
+ }
+}
diff --git a/bin/app/data/projects/javaparser/src/main/java/com/github/javaparser/ast/body/AnnotationDeclaration.java b/bin/app/data/projects/javaparser/src/main/java/com/github/javaparser/ast/body/AnnotationDeclaration.java
new file mode 100644
index 00000000..74d84e82
--- /dev/null
+++ b/bin/app/data/projects/javaparser/src/main/java/com/github/javaparser/ast/body/AnnotationDeclaration.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2007-2010 Júlio Vilmar Gesser.
+ * Copyright (C) 2011, 2013-2016 The JavaParser Team.
+ *
+ * This file is part of JavaParser.
+ *
+ * JavaParser can be used either under the terms of
+ * a) the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * b) the terms of the Apache License
+ *
+ * You should have received a copy of both licenses in LICENCE.LGPL and
+ * LICENCE.APACHE. Please refer to those files for details.
+ *
+ * JavaParser is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ */
+
+package com.github.javaparser.ast.body;
+
+import java.util.List;
+
+import java.util.EnumSet;
+
+import com.github.javaparser.Range;
+import com.github.javaparser.ast.Modifier;
+import com.github.javaparser.ast.expr.AnnotationExpr;
+import com.github.javaparser.ast.visitor.GenericVisitor;
+import com.github.javaparser.ast.visitor.VoidVisitor;
+
+/**
+ * @author Julio Vilmar Gesser
+ */
+public final class AnnotationDeclaration extends TypeDeclaration {
+
+ public AnnotationDeclaration() {
+ }
+
+ public AnnotationDeclaration(EnumSet modifiers, String name) {
+ super(modifiers, name);
+ }
+
+ public AnnotationDeclaration(EnumSet modifiers, List annotations, String name,
+ List> members) {
+ super(annotations, modifiers, name, members);
+ }
+
+ public AnnotationDeclaration(Range range, EnumSet modifiers, List annotations, String name,
+ List> members) {
+ super(range, annotations, modifiers, name, members);
+ }
+
+ @Override
+ public R accept(GenericVisitor v, A arg) {
+ return v.visit(this, arg);
+ }
+
+ @Override
+ public void accept(VoidVisitor v, A arg) {
+ v.visit(this, arg);
+ }
+}
diff --git a/bin/app/data/projects/javaparser/src/main/java/com/github/javaparser/ast/body/AnnotationMemberDeclaration.java b/bin/app/data/projects/javaparser/src/main/java/com/github/javaparser/ast/body/AnnotationMemberDeclaration.java
new file mode 100644
index 00000000..58a78f41
--- /dev/null
+++ b/bin/app/data/projects/javaparser/src/main/java/com/github/javaparser/ast/body/AnnotationMemberDeclaration.java
@@ -0,0 +1,149 @@
+/*
+ * Copyright (C) 2007-2010 Júlio Vilmar Gesser.
+ * Copyright (C) 2011, 2013-2016 The JavaParser Team.
+ *
+ * This file is part of JavaParser.
+ *
+ * JavaParser can be used either under the terms of
+ * a) the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * b) the terms of the Apache License
+ *
+ * You should have received a copy of both licenses in LICENCE.LGPL and
+ * LICENCE.APACHE. Please refer to those files for details.
+ *
+ * JavaParser is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ */
+
+package com.github.javaparser.ast.body;
+
+import java.util.EnumSet;
+import java.util.List;
+
+import com.github.javaparser.Range;
+import com.github.javaparser.ast.Modifier;
+import com.github.javaparser.ast.comments.JavadocComment;
+import com.github.javaparser.ast.expr.AnnotationExpr;
+import com.github.javaparser.ast.expr.Expression;
+import com.github.javaparser.ast.nodeTypes.NodeWithJavaDoc;
+import com.github.javaparser.ast.nodeTypes.NodeWithModifiers;
+import com.github.javaparser.ast.nodeTypes.NodeWithName;
+import com.github.javaparser.ast.nodeTypes.NodeWithType;
+import com.github.javaparser.ast.type.Type;
+import com.github.javaparser.ast.visitor.GenericVisitor;
+import com.github.javaparser.ast.visitor.VoidVisitor;
+
+/**
+ * @author Julio Vilmar Gesser
+ */
+public final class AnnotationMemberDeclaration extends BodyDeclaration
+ implements NodeWithJavaDoc, NodeWithName,
+ NodeWithType, NodeWithModifiers {
+
+ private EnumSet modifiers = EnumSet.noneOf(Modifier.class);
+
+ private Type type;
+
+ private String name;
+
+ private Expression defaultValue;
+
+ public AnnotationMemberDeclaration() {
+ }
+
+ public AnnotationMemberDeclaration(EnumSet modifiers, Type type, String name, Expression defaultValue) {
+ setModifiers(modifiers);
+ setType(type);
+ setName(name);
+ setDefaultValue(defaultValue);
+ }
+
+ public AnnotationMemberDeclaration(EnumSet modifiers, List annotations, Type type, String name,
+ Expression defaultValue) {
+ super(annotations);
+ setModifiers(modifiers);
+ setType(type);
+ setName(name);
+ setDefaultValue(defaultValue);
+ }
+
+ public AnnotationMemberDeclaration(Range range, EnumSet modifiers, List annotations, Type type,
+ String name, Expression defaultValue) {
+ super(range, annotations);
+ setModifiers(modifiers);
+ setType(type);
+ setName(name);
+ setDefaultValue(defaultValue);
+ }
+
+ @Override
+ public R accept(GenericVisitor v, A arg) {
+ return v.visit(this, arg);
+ }
+
+ @Override
+ public void accept(VoidVisitor v, A arg) {
+ v.visit(this, arg);
+ }
+
+ public Expression getDefaultValue() {
+ return defaultValue;
+ }
+
+ /**
+ * Return the modifiers of this member declaration.
+ *
+ * @see Modifier
+ * @return modifiers
+ */
+ @Override
+ public EnumSet getModifiers() {
+ return modifiers;
+ }
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ @Override
+ public Type getType() {
+ return type;
+ }
+
+ public void setDefaultValue(Expression defaultValue) {
+ this.defaultValue = defaultValue;
+ setAsParentNodeOf(defaultValue);
+ }
+
+ @Override
+ public AnnotationMemberDeclaration setModifiers(EnumSet modifiers) {
+ this.modifiers = modifiers;
+ return this;
+ }
+
+ @Override
+ public AnnotationMemberDeclaration setName(String name) {
+ this.name = name;
+ return this;
+ }
+
+ @Override
+ public AnnotationMemberDeclaration setType(Type type) {
+ this.type = type;
+ setAsParentNodeOf(type);
+ return this;
+ }
+
+ @Override
+ public JavadocComment getJavaDoc() {
+ if (getComment() instanceof JavadocComment) {
+ return (JavadocComment) getComment();
+ }
+ return null;
+ }
+}
diff --git a/bin/app/data/projects/javaparser/src/main/java/com/github/javaparser/ast/body/BaseParameter.java b/bin/app/data/projects/javaparser/src/main/java/com/github/javaparser/ast/body/BaseParameter.java
new file mode 100644
index 00000000..0010f44b
--- /dev/null
+++ b/bin/app/data/projects/javaparser/src/main/java/com/github/javaparser/ast/body/BaseParameter.java
@@ -0,0 +1,133 @@
+/*
+ * Copyright (C) 2007-2010 Júlio Vilmar Gesser.
+ * Copyright (C) 2011, 2013-2016 The JavaParser Team.
+ *
+ * This file is part of JavaParser.
+ *
+ * JavaParser can be used either under the terms of
+ * a) the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * b) the terms of the Apache License
+ *
+ * You should have received a copy of both licenses in LICENCE.LGPL and
+ * LICENCE.APACHE. Please refer to those files for details.
+ *
+ * JavaParser is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ */
+
+package com.github.javaparser.ast.body;
+
+import static com.github.javaparser.utils.Utils.ensureNotNull;
+
+import java.util.EnumSet;
+import java.util.List;
+
+import com.github.javaparser.Range;
+import com.github.javaparser.ast.Modifier;
+import com.github.javaparser.ast.Node;
+import com.github.javaparser.ast.expr.AnnotationExpr;
+import com.github.javaparser.ast.nodeTypes.NodeWithAnnotations;
+import com.github.javaparser.ast.nodeTypes.NodeWithModifiers;
+import com.github.javaparser.ast.nodeTypes.NodeWithName;
+
+public abstract class BaseParameter
+ extends Node
+ implements NodeWithAnnotations, NodeWithName, NodeWithModifiers {
+ private EnumSet modifiers = EnumSet.noneOf(Modifier.class);
+
+ private List annotations;
+
+ private VariableDeclaratorId id;
+
+ public BaseParameter() {
+ }
+
+ public BaseParameter(VariableDeclaratorId id) {
+ setId(id);
+ }
+
+ public BaseParameter(EnumSet modifiers, VariableDeclaratorId id) {
+ setModifiers(modifiers);
+ setId(id);
+ }
+
+ public BaseParameter(EnumSet modifiers, List annotations, VariableDeclaratorId id) {
+ setModifiers(modifiers);
+ setAnnotations(annotations);
+ setId(id);
+ }
+
+ public BaseParameter(final Range range, EnumSet modifiers, List annotations, VariableDeclaratorId id) {
+ super(range);
+ setModifiers(modifiers);
+ setAnnotations(annotations);
+ setId(id);
+ }
+
+ /**
+ * @return the list returned could be immutable (in that case it will be empty)
+ */
+ @Override
+ public List getAnnotations() {
+ annotations = ensureNotNull(annotations);
+ return annotations;
+ }
+
+ public VariableDeclaratorId getId() {
+ return id;
+ }
+
+ @Override
+ public String getName() {
+ return getId().getName();
+ }
+
+ @SuppressWarnings("unchecked")
+ @Override
+ public T setName(String name) {
+ if (id != null)
+ id.setName(name);
+ else
+ id = new VariableDeclaratorId(name);
+ return (T) this;
+ }
+
+ /**
+ * Return the modifiers of this parameter declaration.
+ *
+ * @see Modifier
+ * @return modifiers
+ */
+ @Override
+ public EnumSet getModifiers() {
+ return modifiers;
+ }
+
+ /**
+ * @param annotations a null value is currently treated as an empty list. This behavior could change
+ * in the future, so please avoid passing null
+ */
+ @Override
+ @SuppressWarnings("unchecked")
+ public T setAnnotations(List annotations) {
+ this.annotations = annotations;
+ setAsParentNodeOf(this.annotations);
+ return (T) this;
+ }
+
+ public void setId(VariableDeclaratorId id) {
+ this.id = id;
+ setAsParentNodeOf(this.id);
+ }
+
+ @Override
+ @SuppressWarnings("unchecked")
+ public T setModifiers(EnumSet modifiers) {
+ this.modifiers = modifiers;
+ return (T) this;
+ }
+}
diff --git a/bin/app/data/projects/javaparser/src/main/java/com/github/javaparser/ast/body/BodyDeclaration.java b/bin/app/data/projects/javaparser/src/main/java/com/github/javaparser/ast/body/BodyDeclaration.java
new file mode 100644
index 00000000..9055d96a
--- /dev/null
+++ b/bin/app/data/projects/javaparser/src/main/java/com/github/javaparser/ast/body/BodyDeclaration.java
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2007-2010 Júlio Vilmar Gesser.
+ * Copyright (C) 2011, 2013-2016 The JavaParser Team.
+ *
+ * This file is part of JavaParser.
+ *
+ * JavaParser can be used either under the terms of
+ * a) the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * b) the terms of the Apache License
+ *
+ * You should have received a copy of both licenses in LICENCE.LGPL and
+ * LICENCE.APACHE. Please refer to those files for details.
+ *
+ * JavaParser is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ */
+
+package com.github.javaparser.ast.body;
+
+import java.util.List;
+
+import com.github.javaparser.Range;
+import com.github.javaparser.ast.Node;
+import com.github.javaparser.ast.expr.AnnotationExpr;
+import com.github.javaparser.utils.Utils;
+import com.github.javaparser.ast.nodeTypes.NodeWithAnnotations;
+
+/**
+ * @author Julio Vilmar Gesser
+ */
+public abstract class BodyDeclaration extends Node implements NodeWithAnnotations {
+
+ private List annotations;
+
+ public BodyDeclaration() {
+ }
+
+ public BodyDeclaration(List annotations) {
+ setAnnotations(annotations);
+ }
+
+ public BodyDeclaration(Range range, List annotations) {
+ super(range);
+ setAnnotations(annotations);
+ }
+
+ @Override
+ public final List getAnnotations() {
+ annotations = Utils.ensureNotNull(annotations);
+ return annotations;
+ }
+
+ /**
+ *
+ * @param annotations a null value is currently treated as an empty list. This behavior could change
+ * in the future, so please avoid passing null
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public final T setAnnotations(List annotations) {
+ this.annotations = annotations;
+ setAsParentNodeOf(this.annotations);
+ return (T) this;
+ }
+}
diff --git a/bin/app/data/projects/javaparser/src/main/java/com/github/javaparser/ast/body/ClassOrInterfaceDeclaration.java b/bin/app/data/projects/javaparser/src/main/java/com/github/javaparser/ast/body/ClassOrInterfaceDeclaration.java
new file mode 100644
index 00000000..798e7983
--- /dev/null
+++ b/bin/app/data/projects/javaparser/src/main/java/com/github/javaparser/ast/body/ClassOrInterfaceDeclaration.java
@@ -0,0 +1,200 @@
+/*
+ * Copyright (C) 2007-2010 Júlio Vilmar Gesser.
+ * Copyright (C) 2011, 2013-2016 The JavaParser Team.
+ *
+ * This file is part of JavaParser.
+ *
+ * JavaParser can be used either under the terms of
+ * a) the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * b) the terms of the Apache License
+ *
+ * You should have received a copy of both licenses in LICENCE.LGPL and
+ * LICENCE.APACHE. Please refer to those files for details.
+ *
+ * JavaParser is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ */
+
+package com.github.javaparser.ast.body;
+
+import static com.github.javaparser.utils.Utils.ensureNotNull;
+
+import java.util.EnumSet;
+import java.util.List;
+
+import com.github.javaparser.Range;
+import com.github.javaparser.ast.Modifier;
+import com.github.javaparser.ast.TypeParameter;
+import com.github.javaparser.ast.expr.AnnotationExpr;
+import com.github.javaparser.ast.type.ClassOrInterfaceType;
+import com.github.javaparser.ast.visitor.GenericVisitor;
+import com.github.javaparser.ast.visitor.VoidVisitor;
+
+/**
+ * @author Julio Vilmar Gesser
+ */
+public final class ClassOrInterfaceDeclaration extends TypeDeclaration {
+
+ private boolean interface_;
+
+ private List typeParameters;
+
+ // Can contain more than one item if this is an interface
+ private List extendsList;
+
+ private List implementsList;
+
+ public ClassOrInterfaceDeclaration() {
+ }
+
+ public ClassOrInterfaceDeclaration(final EnumSet modifiers, final boolean isInterface,
+ final String name) {
+ super(modifiers, name);
+ setInterface(isInterface);
+ }
+
+ public ClassOrInterfaceDeclaration(final EnumSet modifiers,
+ final List annotations, final boolean isInterface,
+ final String name,
+ final List typeParameters,
+ final List extendsList,
+ final List implementsList,
+ final List> members) {
+ super(annotations, modifiers, name, members);
+ setInterface(isInterface);
+ setTypeParameters(typeParameters);
+ setExtends(extendsList);
+ setImplements(implementsList);
+ }
+
+ public ClassOrInterfaceDeclaration(Range range, final EnumSet modifiers,
+ final List annotations, final boolean isInterface,
+ final String name,
+ final List typeParameters,
+ final List extendsList,
+ final List implementsList,
+ final List> members) {
+ super(range, annotations, modifiers, name, members);
+ setInterface(isInterface);
+ setTypeParameters(typeParameters);
+ setExtends(extendsList);
+ setImplements(implementsList);
+ }
+
+ @Override
+ public R accept(final GenericVisitor v, final A arg) {
+ return v.visit(this, arg);
+ }
+
+ @Override
+ public void accept(final VoidVisitor v, final A arg) {
+ v.visit(this, arg);
+ }
+
+ public List getExtends() {
+ extendsList = ensureNotNull(extendsList);
+ return extendsList;
+ }
+
+ public List getImplements() {
+ implementsList = ensureNotNull(implementsList);
+ return implementsList;
+ }
+
+ public List getTypeParameters() {
+ typeParameters = ensureNotNull(typeParameters);
+ return typeParameters;
+ }
+
+ public boolean isInterface() {
+ return interface_;
+ }
+
+ /**
+ *
+ * @param extendsList a null value is currently treated as an empty list. This behavior could change
+ * in the future, so please avoid passing null
+ */
+ public void setExtends(final List extendsList) {
+ this.extendsList = extendsList;
+ setAsParentNodeOf(this.extendsList);
+ }
+
+ /**
+ *
+ * @param implementsList a null value is currently treated as an empty list. This behavior could change
+ * in the future, so please avoid passing null
+ */
+ public void setImplements(final List implementsList) {
+ this.implementsList = implementsList;
+ setAsParentNodeOf(this.implementsList);
+ }
+
+ public void setInterface(final boolean interface_) {
+ this.interface_ = interface_;
+ }
+
+ /**
+ *
+ * @param typeParameters a null value is currently treated as an empty list. This behavior could change
+ * in the future, so please avoid passing null
+ */
+ public void setTypeParameters(final List typeParameters) {
+ this.typeParameters = typeParameters;
+ setAsParentNodeOf(this.typeParameters);
+ }
+
+ /**
+ * Add an extends to this class or interface and automatically add the import
+ *
+ * @param clazz the class to extand from
+ * @return this, the {@link ClassOrInterfaceDeclaration}
+ */
+ public ClassOrInterfaceDeclaration addExtends(Class> clazz) {
+ tryAddImportToParentCompilationUnit(clazz);
+ return addExtends(clazz.getSimpleName());
+ }
+
+ /**
+ * Add an extends to this class or interface
+ *
+ * @param name the name of the type to extends from
+ * @return this, the {@link ClassOrInterfaceDeclaration}
+ */
+ public ClassOrInterfaceDeclaration addExtends(String name) {
+ ClassOrInterfaceType classOrInterfaceType = new ClassOrInterfaceType(name);
+ getExtends().add(classOrInterfaceType);
+ classOrInterfaceType.setParentNode(this);
+ return this;
+ }
+
+ /**
+ * Add an implements to this class or interface
+ *
+ * @param name the name of the type to extends from
+ * @return this, the {@link ClassOrInterfaceDeclaration}
+ */
+ public ClassOrInterfaceDeclaration addImplements(String name) {
+ ClassOrInterfaceType classOrInterfaceType = new ClassOrInterfaceType(name);
+ getImplements().add(classOrInterfaceType);
+ classOrInterfaceType.setParentNode(this);
+ return this;
+ }
+
+ /**
+ * Add an implements to this class or interface and automatically add the import
+ *
+ * @param clazz the type to implements from
+ * @return this, the {@link ClassOrInterfaceDeclaration}
+ */
+ public ClassOrInterfaceDeclaration addImplements(Class> clazz) {
+ tryAddImportToParentCompilationUnit(clazz);
+ return addImplements(clazz.getSimpleName());
+ }
+
+
+}
diff --git a/bin/app/data/projects/javaparser/src/main/java/com/github/javaparser/ast/body/ConstructorDeclaration.java b/bin/app/data/projects/javaparser/src/main/java/com/github/javaparser/ast/body/ConstructorDeclaration.java
new file mode 100644
index 00000000..7fa54a0a
--- /dev/null
+++ b/bin/app/data/projects/javaparser/src/main/java/com/github/javaparser/ast/body/ConstructorDeclaration.java
@@ -0,0 +1,261 @@
+/*
+ * Copyright (C) 2007-2010 Júlio Vilmar Gesser.
+ * Copyright (C) 2011, 2013-2016 The JavaParser Team.
+ *
+ * This file is part of JavaParser.
+ *
+ * JavaParser can be used either under the terms of
+ * a) the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * b) the terms of the Apache License
+ *
+ * You should have received a copy of both licenses in LICENCE.LGPL and
+ * LICENCE.APACHE. Please refer to those files for details.
+ *
+ * JavaParser is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ */
+
+package com.github.javaparser.ast.body;
+
+import static com.github.javaparser.utils.Utils.ensureNotNull;
+
+import java.util.EnumSet;
+import java.util.List;
+
+import com.github.javaparser.Range;
+import com.github.javaparser.ast.AccessSpecifier;
+import com.github.javaparser.ast.Modifier;
+import com.github.javaparser.ast.TypeParameter;
+import com.github.javaparser.ast.comments.JavadocComment;
+import com.github.javaparser.ast.expr.AnnotationExpr;
+import com.github.javaparser.ast.expr.NameExpr;
+import com.github.javaparser.ast.nodeTypes.NodeWithBlockStmt;
+import com.github.javaparser.ast.nodeTypes.NodeWithDeclaration;
+import com.github.javaparser.ast.nodeTypes.NodeWithJavaDoc;
+import com.github.javaparser.ast.nodeTypes.NodeWithModifiers;
+import com.github.javaparser.ast.nodeTypes.NodeWithName;
+import com.github.javaparser.ast.nodeTypes.NodeWithParameters;
+import com.github.javaparser.ast.nodeTypes.NodeWithThrowable;
+import com.github.javaparser.ast.stmt.BlockStmt;
+import com.github.javaparser.ast.type.ReferenceType;
+import com.github.javaparser.ast.visitor.GenericVisitor;
+import com.github.javaparser.ast.visitor.VoidVisitor;
+
+/**
+ * @author Julio Vilmar Gesser
+ */
+public final class ConstructorDeclaration extends BodyDeclaration
+ implements NodeWithJavaDoc, NodeWithDeclaration,
+ NodeWithName, NodeWithModifiers,
+ NodeWithParameters, NodeWithThrowable,
+ NodeWithBlockStmt {
+
+ private EnumSet modifiers = EnumSet.noneOf(Modifier.class);
+
+ private List typeParameters;
+
+ private NameExpr name;
+
+ private List parameters;
+
+ private List throws_;
+
+ private BlockStmt body;
+
+ public ConstructorDeclaration() {
+ }
+
+ public ConstructorDeclaration(EnumSet modifiers, String name) {
+ setModifiers(modifiers);
+ setName(name);
+ }
+
+ public ConstructorDeclaration(EnumSet modifiers, List annotations,
+ List typeParameters,
+ String name, List parameters, List throws_,
+ BlockStmt block) {
+ super(annotations);
+ setModifiers(modifiers);
+ setTypeParameters(typeParameters);
+ setName(name);
+ setParameters(parameters);
+ setThrows(throws_);
+ setBody(block);
+ }
+
+ public ConstructorDeclaration(Range range, EnumSet modifiers,
+ List annotations, List typeParameters, String name,
+ List parameters, List throws_, BlockStmt block) {
+ super(range, annotations);
+ setModifiers(modifiers);
+ setTypeParameters(typeParameters);
+ setName(name);
+ setParameters(parameters);
+ setThrows(throws_);
+ setBody(block);
+ }
+
+ @Override
+ public R accept(GenericVisitor v, A arg) {
+ return v.visit(this, arg);
+ }
+
+ @Override
+ public void accept(VoidVisitor v, A arg) {
+ v.visit(this, arg);
+ }
+
+ /**
+ * Return the modifiers of this member declaration.
+ *
+ * @see Modifier
+ * @return modifiers
+ */
+ @Override
+ public EnumSet getModifiers() {
+ return modifiers;
+ }
+
+ @Override
+ public String getName() {
+ return name == null ? null : name.getName();
+ }
+
+ public NameExpr getNameExpr() {
+ return name;
+ }
+
+ @Override
+ public List getParameters() {
+ parameters = ensureNotNull(parameters);
+ return parameters;
+ }
+
+ @Override
+ public List getThrows() {
+ throws_ = ensureNotNull(throws_);
+ return throws_;
+ }
+
+ public List getTypeParameters() {
+ typeParameters = ensureNotNull(typeParameters);
+ return typeParameters;
+ }
+
+ @Override
+ public ConstructorDeclaration setModifiers(EnumSet modifiers) {
+ this.modifiers = modifiers;
+ return this;
+ }
+
+ @Override
+ public ConstructorDeclaration setName(String name) {
+ setNameExpr(new NameExpr(name));
+ return this;
+ }
+
+ public ConstructorDeclaration setNameExpr(NameExpr name) {
+ this.name = name;
+ setAsParentNodeOf(this.name);
+ return this;
+ }
+
+ @Override
+ public ConstructorDeclaration setParameters(List parameters) {
+ this.parameters = parameters;
+ setAsParentNodeOf(this.parameters);
+ return this;
+ }
+
+ @Override
+ public ConstructorDeclaration setThrows(List throws_) {
+ this.throws_ = throws_;
+ setAsParentNodeOf(this.throws_);
+ return this;
+ }
+
+ public void setTypeParameters(List typeParameters) {
+ this.typeParameters = typeParameters;
+ setAsParentNodeOf(this.typeParameters);
+ }
+
+ /**
+ * The declaration returned has this schema:
+ *
+ * [accessSpecifier] className ([paramType [paramName]])
+ * [throws exceptionsList]
+ */
+ @Override
+ public String getDeclarationAsString(boolean includingModifiers, boolean includingThrows,
+ boolean includingParameterName) {
+ StringBuilder sb = new StringBuilder();
+ if (includingModifiers) {
+ AccessSpecifier accessSpecifier = Modifier.getAccessSpecifier(getModifiers());
+ sb.append(accessSpecifier.getCodeRepresenation());
+ sb.append(accessSpecifier == AccessSpecifier.DEFAULT ? "" : " ");
+ }
+ sb.append(getName());
+ sb.append("(");
+ boolean firstParam = true;
+ for (Parameter param : getParameters()) {
+ if (firstParam) {
+ firstParam = false;
+ } else {
+ sb.append(", ");
+ }
+ if (includingParameterName) {
+ sb.append(param.toStringWithoutComments());
+ } else {
+ sb.append(param.getType().toStringWithoutComments());
+ }
+ }
+ sb.append(")");
+ if (includingThrows) {
+ boolean firstThrow = true;
+ for (ReferenceType thr : getThrows()) {
+ if (firstThrow) {
+ firstThrow = false;
+ sb.append(" throws ");
+ } else {
+ sb.append(", ");
+ }
+ sb.append(thr.toStringWithoutComments());
+ }
+ }
+ return sb.toString();
+ }
+
+ @Override
+ public String getDeclarationAsString(boolean includingModifiers, boolean includingThrows) {
+ return getDeclarationAsString(includingModifiers, includingThrows, true);
+ }
+
+ @Override
+ public String getDeclarationAsString() {
+ return getDeclarationAsString(true, true, true);
+ }
+
+ @Override
+ public JavadocComment getJavaDoc() {
+ if (getComment() instanceof JavadocComment) {
+ return (JavadocComment) getComment();
+ }
+ return null;
+ }
+
+ @Override
+ public BlockStmt getBody() {
+ return body;
+ }
+
+ @Override
+ public ConstructorDeclaration setBody(BlockStmt body) {
+ this.body = body;
+ setAsParentNodeOf(body);
+ return this;
+ }
+}
diff --git a/bin/app/data/projects/javaparser/src/main/java/com/github/javaparser/ast/body/EmptyMemberDeclaration.java b/bin/app/data/projects/javaparser/src/main/java/com/github/javaparser/ast/body/EmptyMemberDeclaration.java
new file mode 100644
index 00000000..102eb7aa
--- /dev/null
+++ b/bin/app/data/projects/javaparser/src/main/java/com/github/javaparser/ast/body/EmptyMemberDeclaration.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2007-2010 Júlio Vilmar Gesser.
+ * Copyright (C) 2011, 2013-2016 The JavaParser Team.
+ *
+ * This file is part of JavaParser.
+ *
+ * JavaParser can be used either under the terms of
+ * a) the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * b) the terms of the Apache License
+ *
+ * You should have received a copy of both licenses in LICENCE.LGPL and
+ * LICENCE.APACHE. Please refer to those files for details.
+ *
+ * JavaParser is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ */
+
+package com.github.javaparser.ast.body;
+
+import com.github.javaparser.Range;
+import com.github.javaparser.ast.comments.JavadocComment;
+import com.github.javaparser.ast.nodeTypes.NodeWithJavaDoc;
+import com.github.javaparser.ast.visitor.GenericVisitor;
+import com.github.javaparser.ast.visitor.VoidVisitor;
+
+/**
+ * @author Julio Vilmar Gesser
+ */
+public final class EmptyMemberDeclaration extends BodyDeclaration
+ implements NodeWithJavaDoc {
+
+ public EmptyMemberDeclaration() {
+ super(null);
+ }
+
+ public EmptyMemberDeclaration(Range range) {
+ super(range, null);
+ }
+
+ @Override
+ public R accept(GenericVisitor v, A arg) {
+ return v.visit(this, arg);
+ }
+
+ @Override
+ public void accept(VoidVisitor v, A arg) {
+ v.visit(this, arg);
+ }
+
+ @Override
+ public JavadocComment getJavaDoc() {
+ if(getComment() instanceof JavadocComment){
+ return (JavadocComment) getComment();
+ }
+ return null;
+ }
+}
diff --git a/bin/app/data/projects/javaparser/src/main/java/com/github/javaparser/ast/body/EmptyTypeDeclaration.java b/bin/app/data/projects/javaparser/src/main/java/com/github/javaparser/ast/body/EmptyTypeDeclaration.java
new file mode 100644
index 00000000..3a774de9
--- /dev/null
+++ b/bin/app/data/projects/javaparser/src/main/java/com/github/javaparser/ast/body/EmptyTypeDeclaration.java
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2007-2010 Júlio Vilmar Gesser.
+ * Copyright (C) 2011, 2013-2016 The JavaParser Team.
+ *
+ * This file is part of JavaParser.
+ *
+ * JavaParser can be used either under the terms of
+ * a) the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * b) the terms of the Apache License
+ *
+ * You should have received a copy of both licenses in LICENCE.LGPL and
+ * LICENCE.APACHE. Please refer to those files for details.
+ *
+ * JavaParser is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ */
+
+package com.github.javaparser.ast.body;
+
+import java.util.EnumSet;
+
+import com.github.javaparser.Range;
+import com.github.javaparser.ast.Modifier;
+import com.github.javaparser.ast.visitor.GenericVisitor;
+import com.github.javaparser.ast.visitor.VoidVisitor;
+
+/**
+ * @author Julio Vilmar Gesser
+ */
+public final class EmptyTypeDeclaration extends TypeDeclaration {
+
+ public EmptyTypeDeclaration() {
+ super(null, EnumSet.noneOf(Modifier.class), null, null);
+ }
+
+ public EmptyTypeDeclaration(Range range) {
+ super(range, null, EnumSet.noneOf(Modifier.class), null, null);
+ }
+
+ @Override
+ public R accept(GenericVisitor v, A arg) {
+ return v.visit(this, arg);
+ }
+
+ @Override
+ public void accept(VoidVisitor v, A arg) {
+ v.visit(this, arg);
+ }
+}
diff --git a/bin/app/data/projects/javaparser/src/main/java/com/github/javaparser/ast/body/EnumConstantDeclaration.java b/bin/app/data/projects/javaparser/src/main/java/com/github/javaparser/ast/body/EnumConstantDeclaration.java
new file mode 100644
index 00000000..becbce6b
--- /dev/null
+++ b/bin/app/data/projects/javaparser/src/main/java/com/github/javaparser/ast/body/EnumConstantDeclaration.java
@@ -0,0 +1,126 @@
+/*
+ * Copyright (C) 2007-2010 Júlio Vilmar Gesser.
+ * Copyright (C) 2011, 2013-2016 The JavaParser Team.
+ *
+ * This file is part of JavaParser.
+ *
+ * JavaParser can be used either under the terms of
+ * a) the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * b) the terms of the Apache License
+ *
+ * You should have received a copy of both licenses in LICENCE.LGPL and
+ * LICENCE.APACHE. Please refer to those files for details.
+ *
+ * JavaParser is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ */
+
+package com.github.javaparser.ast.body;
+
+import static com.github.javaparser.utils.Utils.ensureNotNull;
+
+import java.util.List;
+
+import com.github.javaparser.Range;
+import com.github.javaparser.ast.comments.JavadocComment;
+import com.github.javaparser.ast.expr.AnnotationExpr;
+import com.github.javaparser.ast.expr.Expression;
+import com.github.javaparser.ast.expr.NameExpr;
+import com.github.javaparser.ast.nodeTypes.NodeWithJavaDoc;
+import com.github.javaparser.ast.nodeTypes.NodeWithName;
+import com.github.javaparser.ast.visitor.GenericVisitor;
+import com.github.javaparser.ast.visitor.VoidVisitor;
+
+/**
+ * @author Julio Vilmar Gesser
+ */
+public final class EnumConstantDeclaration extends BodyDeclaration
+ implements NodeWithJavaDoc, NodeWithName {
+
+ private String name;
+
+ private List args;
+
+ private List> classBody;
+
+ public EnumConstantDeclaration() {
+ }
+
+ public EnumConstantDeclaration(String name) {
+ setName(name);
+ }
+
+ public EnumConstantDeclaration(List annotations, String name, List args,
+ List> classBody) {
+ super(annotations);
+ setName(name);
+ setArgs(args);
+ setClassBody(classBody);
+ }
+
+ public EnumConstantDeclaration(Range range, List annotations, String name, List args,
+ List> classBody) {
+ super(range, annotations);
+ setName(name);
+ setArgs(args);
+ setClassBody(classBody);
+ }
+
+ @Override
+ public R accept(GenericVisitor v, A arg) {
+ return v.visit(this, arg);
+ }
+
+ @Override
+ public void accept(VoidVisitor v, A arg) {
+ v.visit(this, arg);
+ }
+
+ public List getArgs() {
+ args = ensureNotNull(args);
+ return args;
+ }
+
+ public List> getClassBody() {
+ classBody = ensureNotNull(classBody);
+ return classBody;
+ }
+
+ @Override
+ public String getName() {
+ return name;
+ }
+
+ public void setArgs(List args) {
+ this.args = args;
+ setAsParentNodeOf(this.args);
+ }
+
+ public void setClassBody(List> classBody) {
+ this.classBody = classBody;
+ setAsParentNodeOf(this.classBody);
+ }
+
+ @Override
+ public EnumConstantDeclaration setName(String name) {
+ this.name = name;
+ return this;
+ }
+
+ @Override
+ public JavadocComment getJavaDoc() {
+ if(getComment() instanceof JavadocComment){
+ return (JavadocComment) getComment();
+ }
+ return null;
+ }
+
+ public EnumConstantDeclaration addArgument(String valueExpr) {
+ getArgs().add(NameExpr.create(valueExpr));
+ return this;
+ }
+}
diff --git a/bin/app/data/projects/javaparser/src/main/java/com/github/javaparser/ast/body/EnumDeclaration.java b/bin/app/data/projects/javaparser/src/main/java/com/github/javaparser/ast/body/EnumDeclaration.java
new file mode 100644
index 00000000..b54c6a0e
--- /dev/null
+++ b/bin/app/data/projects/javaparser/src/main/java/com/github/javaparser/ast/body/EnumDeclaration.java
@@ -0,0 +1,132 @@
+/*
+ * Copyright (C) 2007-2010 Júlio Vilmar Gesser.
+ * Copyright (C) 2011, 2013-2016 The JavaParser Team.
+ *
+ * This file is part of JavaParser.
+ *
+ * JavaParser can be used either under the terms of
+ * a) the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * b) the terms of the Apache License
+ *
+ * You should have received a copy of both licenses in LICENCE.LGPL and
+ * LICENCE.APACHE. Please refer to those files for details.
+ *
+ * JavaParser is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ */
+
+package com.github.javaparser.ast.body;
+
+import static com.github.javaparser.utils.Utils.ensureNotNull;
+
+import java.util.EnumSet;
+import java.util.List;
+
+import com.github.javaparser.Range;
+import com.github.javaparser.ast.Modifier;
+import com.github.javaparser.ast.expr.AnnotationExpr;
+import com.github.javaparser.ast.type.ClassOrInterfaceType;
+import com.github.javaparser.ast.visitor.GenericVisitor;
+import com.github.javaparser.ast.visitor.VoidVisitor;
+
+/**
+ * @author Julio Vilmar Gesser
+ */
+public final class EnumDeclaration extends TypeDeclaration {
+
+ private List implementsList;
+
+ private List entries;
+
+ public EnumDeclaration() {
+ }
+
+ public EnumDeclaration(EnumSet modifiers, String name) {
+ super(modifiers, name);
+ }
+
+ public EnumDeclaration(EnumSet modifiers, List annotations, String name,
+ List implementsList, List entries,
+ List> members) {
+ super(annotations, modifiers, name, members);
+ setImplements(implementsList);
+ setEntries(entries);
+ }
+
+ public EnumDeclaration(Range range, EnumSet modifiers, List annotations, String name,
+ List implementsList, List entries,
+ List> members) {
+ super(range, annotations, modifiers, name, members);
+ setImplements(implementsList);
+ setEntries(entries);
+ }
+
+ @Override
+ public R accept(GenericVisitor v, A arg) {
+ return v.visit(this, arg);
+ }
+
+
+ @Override
+ public void accept(VoidVisitor v, A arg) {
+ v.visit(this, arg);
+ }
+
+ public List getEntries() {
+ entries = ensureNotNull(entries);
+ return entries;
+ }
+
+ public List getImplements() {
+ implementsList = ensureNotNull(implementsList);
+ return implementsList;
+ }
+
+ public EnumDeclaration setEntries(List entries) {
+ this.entries = entries;
+ setAsParentNodeOf(this.entries);
+ return this;
+ }
+
+ public EnumDeclaration setImplements(List implementsList) {
+ this.implementsList = implementsList;
+ setAsParentNodeOf(this.implementsList);
+ return this;
+ }
+
+ /**
+ * Add an implements to this enum
+ *
+ * @param name the name of the type to extends from
+ * @return this, the {@link EnumDeclaration}
+ */
+ public EnumDeclaration addImplements(String name) {
+ ClassOrInterfaceType classOrInterfaceType = new ClassOrInterfaceType(name);
+ getImplements().add(classOrInterfaceType);
+ classOrInterfaceType.setParentNode(this);
+ return this;
+ }
+
+ /**
+ * Add an implements to this enum and automatically add the import
+ *
+ * @param clazz the type to implements from
+ * @return this, the {@link EnumDeclaration}
+ */
+ public EnumDeclaration addImplements(Class> clazz) {
+ tryAddImportToParentCompilationUnit(clazz);
+ return addImplements(clazz.getSimpleName());
+ }
+
+ public EnumConstantDeclaration addEnumConstant(String name) {
+ EnumConstantDeclaration enumConstant = new EnumConstantDeclaration(name);
+ getEntries().add(enumConstant);
+ enumConstant.setParentNode(this);
+ return enumConstant;
+ }
+
+}
diff --git a/bin/app/data/projects/javaparser/src/main/java/com/github/javaparser/ast/body/FieldDeclaration.java b/bin/app/data/projects/javaparser/src/main/java/com/github/javaparser/ast/body/FieldDeclaration.java
new file mode 100644
index 00000000..a85b273c
--- /dev/null
+++ b/bin/app/data/projects/javaparser/src/main/java/com/github/javaparser/ast/body/FieldDeclaration.java
@@ -0,0 +1,251 @@
+/*
+ * Copyright (C) 2007-2010 Júlio Vilmar Gesser.
+ * Copyright (C) 2011, 2013-2016 The JavaParser Team.
+ *
+ * This file is part of JavaParser.
+ *
+ * JavaParser can be used either under the terms of
+ * a) the GNU Lesser General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ * b) the terms of the Apache License
+ *
+ * You should have received a copy of both licenses in LICENCE.LGPL and
+ * LICENCE.APACHE. Please refer to those files for details.
+ *
+ * JavaParser is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ */
+
+package com.github.javaparser.ast.body;
+
+import static com.github.javaparser.ast.Modifier.*;
+import static com.github.javaparser.ast.type.VoidType.*;
+import static com.github.javaparser.utils.Utils.ensureNotNull;
+
+import java.util.ArrayList;
+import java.util.EnumSet;
+import java.util.List;
+
+import com.github.javaparser.Range;
+import com.github.javaparser.ast.Modifier;
+import com.github.javaparser.ast.comments.JavadocComment;
+import com.github.javaparser.ast.expr.AnnotationExpr;
+import com.github.javaparser.ast.expr.AssignExpr;
+import com.github.javaparser.ast.expr.AssignExpr.Operator;
+import com.github.javaparser.ast.expr.NameExpr;
+import com.github.javaparser.ast.nodeTypes.NodeWithJavaDoc;
+import com.github.javaparser.ast.nodeTypes.NodeWithModifiers;
+import com.github.javaparser.ast.nodeTypes.NodeWithType;
+import com.github.javaparser.ast.stmt.BlockStmt;
+import com.github.javaparser.ast.stmt.ReturnStmt;
+import com.github.javaparser.ast.type.Type;
+import com.github.javaparser.ast.type.VoidType;
+import com.github.javaparser.ast.visitor.GenericVisitor;
+import com.github.javaparser.ast.visitor.VoidVisitor;
+
+/**
+ * @author Julio Vilmar Gesser
+ */
+public final class FieldDeclaration extends BodyDeclaration
+ implements NodeWithJavaDoc, NodeWithType,
+ NodeWithModifiers {
+
+ private EnumSet modifiers = EnumSet.noneOf(Modifier.class);
+
+ private Type type;
+
+ private List variables;
+
+ public FieldDeclaration() {
+ }
+
+ public FieldDeclaration(EnumSet modifiers, Type type, VariableDeclarator variable) {
+ setModifiers(modifiers);
+ setType(type);
+ List aux = new ArrayList<>();
+ aux.add(variable);
+ setVariables(aux);
+ }
+
+ public FieldDeclaration(EnumSet modifiers, Type type, List variables) {
+ setModifiers(modifiers);
+ setType(type);
+ setVariables(variables);
+ }
+
+ public FieldDeclaration(EnumSet modifiers, List annotations, Type type,
+ List variables) {
+ super(annotations);
+ setModifiers(modifiers);
+ setType(type);
+ setVariables(variables);
+ }
+
+ public FieldDeclaration(Range range, EnumSet modifiers, List annotations, Type type,
+ List variables) {
+ super(range, annotations);
+ setModifiers(modifiers);
+ setType(type);
+ setVariables(variables);
+ }
+
+ /**
+ * Creates a {@link FieldDeclaration}.
+ *
+ * @param modifiers
+ * modifiers
+ * @param type
+ * type
+ * @param variable
+ * variable declarator
+ * @return instance of {@link FieldDeclaration}
+ */
+ public static FieldDeclaration create(EnumSet