* It directly extends AstNode because a class cannot appear anywhere in php
* @author Matthieu Casanova
*/
-public class ClassDeclaration extends Statement implements OutlineableWithChildren {
+public final class ClassDeclaration extends Statement implements OutlineableWithChildren {
/** The name of the class. */
- public String name;
+ private final String name;
/** The superclass. */
- public String superclass;
+ private String superclass;
public int declarationSourceStart;
public int declarationSourceEnd;
/** The methods of the class. */
private final ArrayList methods = new ArrayList();
/** The constructor of the class. */
- public MethodDeclaration constructor;
+ private MethodDeclaration constructor;
/** The fields of the class. */
- private ArrayList fields = new ArrayList();
+ private final ArrayList fields = new ArrayList();
- private Object parent;
+ private final Object parent;
/** The outlineable children (those will be in the node array too. */
- private ArrayList children = new ArrayList();
+ private final ArrayList children = new ArrayList();
- private Position position;
+ private final Position position;
/**
- * Create a class giving starting and ending offset
+ * Create a class giving starting and ending offset.
* @param sourceStart starting offset
* @param sourceEnd ending offset
*/
}
/**
- * Create a class giving starting and ending offset
+ * Create a class giving starting and ending offset.
* @param sourceStart starting offset
* @param sourceEnd ending offset
*/
* @param tab how many tabs before the body of the class
* @return the body as String
*/
- public String toStringBody(final int tab) {
+ private String toStringBody(final int tab) {
final StringBuffer buff = new StringBuffer(" {");//$NON-NLS-1$
if (fields != null) {
for (int i = 0; i < fields.size(); i++) {
* Return the header of the class as String.
* @return the header of the class
*/
- public String toStringHeader() {
+ private String toStringHeader() {
final StringBuffer buff = new StringBuffer("class ").append(name);//$NON-NLS-1$
if (superclass != null) {
buff.append(" extends "); //$NON-NLS-1$
/**
* Get the variables from outside (parameters, globals ...)
+ *
+ * @param list the list where we will put variables
*/
- public void getOutsideVariable(final List list) {
- }
+ public void getOutsideVariable(final List list) {}
/**
* get the modified variables.
+ *
+ * @param list the list where we will put variables
*/
- public void getModifiedVariable(final List list) {
- }
+ public void getModifiedVariable(final List list) {}
/**
* Get the variables used.
+ *
+ * @param list the list where we will put variables
*/
- public void getUsedVariable(final List list) {
- }
+ public void getUsedVariable(final List list) {}
}