Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Commit

Permalink
ran the java formatter over all the source to cleanup tabs/spaces and…
Browse files Browse the repository at this point in the history
… indentation.
  • Loading branch information
David Habib committed Jan 23, 2015
1 parent 463ff7f commit ddf2d89
Show file tree
Hide file tree
Showing 9 changed files with 1,372 additions and 1,310 deletions.
404 changes: 210 additions & 194 deletions src/org/salesforce/apexdoc/ApexDoc.css

Large diffs are not rendered by default.

1,034 changes: 520 additions & 514 deletions src/org/salesforce/apexdoc/ApexDoc.java

Large diffs are not rendered by default.

48 changes: 30 additions & 18 deletions src/org/salesforce/apexdoc/ApexModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,59 @@

public class ApexModel {
public String getNameLine() {
return nameLine;
return nameLine;
}

public int getInameLine() {
return inameLine;
}
}

public void setNameLine(String nameLine, int iLine) {
this.nameLine = nameLine.trim();
this.inameLine = iLine;
parseScope();
this.nameLine = nameLine.trim();
this.inameLine = iLine;
parseScope();
}

public String getDescription() {
return description == null ? "" : description;
return description == null ? "" : description;
}

public void setDescription(String description) {
this.description = description;
this.description = description;
}

public String getAuthor() {
return author == null ? "" : author;
return author == null ? "" : author;
}

public void setAuthor(String author) {
this.author = author;
this.author = author;
}

public String getDate() {
return date == null ? "" : date;
return date == null ? "" : date;
}

public void setDate(String date) {
this.date = date;
}
this.date = date;
}

public String getReturns() {
return returns == null ? "" : returns;
return returns == null ? "" : returns;
}

public void setReturns(String returns) {
this.returns = returns;
this.returns = returns;
}

public String getScope() {
return scope == null ? "" : scope;
}

public void setScope(String scope) {
this.scope = scope;
this.scope = scope;
}

private void parseScope() {
scope = null;
if (nameLine != null) {
Expand All @@ -51,13 +63,13 @@ private void parseScope() {
scope = str;
}
}

private String nameLine;
private int inameLine;
private String description;
private String author;
private String date;
private String returns;
private String scope;

}
12 changes: 6 additions & 6 deletions src/org/salesforce/apexdoc/ClassGroup.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,29 @@ public ClassGroup(String strName, String strContent) {
this.strName = strName;
this.strContentSource = strContent;
}

public String getName() {
return strName;
}

public void setName(String strName) {
this.strName = strName;
}

public String getContentSource() {
return strContentSource;
}

public void setContentSource(String strContent) {
this.strContentSource = strContent;
}

public String getContentFilename() {
if (strContentSource != null) {
int idx1 = strContentSource.lastIndexOf("/");
int idx2 = strContentSource.lastIndexOf(".");
if (idx1 != -1 && idx2 != -1) {
return strContentSource.substring(idx1+1, idx2);
return strContentSource.substring(idx1 + 1, idx2);
}
}
return null;
Expand Down
220 changes: 111 additions & 109 deletions src/org/salesforce/apexdoc/ClassModel.java
Original file line number Diff line number Diff line change
@@ -1,121 +1,123 @@
package org.salesforce.apexdoc;

import java.util.ArrayList;
import java.util.TreeMap;

public class ClassModel extends ApexModel {

public ClassModel(ClassModel cmodelParent){
methods = new ArrayList<MethodModel>();
properties = new ArrayList<PropertyModel>();
this.cmodelParent = cmodelParent;
childClasses = new ArrayList<ClassModel>();
}

private ArrayList<MethodModel> methods;
private ArrayList<PropertyModel> properties;
private String strClassGroup;
private String strClassGroupContent;
private ClassModel cmodelParent;
private ArrayList<ClassModel> childClasses;
private boolean isInterface;

public ArrayList<PropertyModel> getProperties() {
return properties;
}

public ArrayList<PropertyModel> getPropertiesSorted() {
TreeMap<String, PropertyModel> tm = new TreeMap<String, PropertyModel>();
for (PropertyModel prop : properties)
tm.put(prop.getPropertyName().toLowerCase(), prop);
return new ArrayList<PropertyModel>(tm.values());
}
public ClassModel(ClassModel cmodelParent) {
methods = new ArrayList<MethodModel>();
properties = new ArrayList<PropertyModel>();
this.cmodelParent = cmodelParent;
childClasses = new ArrayList<ClassModel>();
}

public void setProperties(ArrayList<PropertyModel> properties) {
this.properties = properties;
}
private ArrayList<MethodModel> methods;
private ArrayList<PropertyModel> properties;
private String strClassGroup;
private String strClassGroupContent;
private ClassModel cmodelParent;
private ArrayList<ClassModel> childClasses;
private boolean isInterface;

public ArrayList<MethodModel> getMethods() {
return methods;
}
public ArrayList<PropertyModel> getProperties() {
return properties;
}

public ArrayList<MethodModel> getMethodsSorted() {
TreeMap<String, MethodModel> tm = new TreeMap<String, MethodModel>();
for (MethodModel method : methods)
tm.put(method.getMethodName().toLowerCase(), method);
return new ArrayList<MethodModel>(tm.values());
}
public ArrayList<PropertyModel> getPropertiesSorted() {
TreeMap<String, PropertyModel> tm = new TreeMap<String, PropertyModel>();
for (PropertyModel prop : properties)
tm.put(prop.getPropertyName().toLowerCase(), prop);
return new ArrayList<PropertyModel>(tm.values());
}

public void setMethods(ArrayList<MethodModel> methods) {
this.methods = methods;
}

public ArrayList<ClassModel> getChildClasses() {
return childClasses;
}

public void addChildClass(ClassModel child) {
childClasses.add(child);
}

public String getClassName() {
String nameLine = getNameLine();
String strParent = cmodelParent == null ? "" : cmodelParent.getClassName() + ".";
if (nameLine != null) nameLine = nameLine.trim();
if (nameLine != null && nameLine.trim().length() > 0 ) {
int fFound = nameLine.toLowerCase().indexOf("class ");
int cch = 6;
if (fFound == -1) {
fFound = nameLine.toLowerCase().indexOf("interface ");
cch = 10;
}
if (fFound > -1)
nameLine = nameLine.substring(fFound + cch).trim();
int lFound = nameLine.indexOf(" ");
if (lFound == -1)
return strParent + nameLine;
try {
String name = nameLine.substring(0, lFound);
return strParent + name;
} catch(Exception ex) {
return strParent + nameLine.substring(nameLine.lastIndexOf(" ") + 1);
}
} else {
return "";
}

}

public String getTopmostClassName() {
if (cmodelParent != null)
return cmodelParent.getClassName();
else
return getClassName();
}

public String getClassGroup() {
if (this.cmodelParent != null)
return cmodelParent.getClassGroup();
else
return strClassGroup;
}

public void setClassGroup(String strGroup) {
strClassGroup = strGroup;
}

public String getClassGroupContent() {
return strClassGroupContent;
}

public void setClassGroupContent(String strGroupContent) {
strClassGroupContent = strGroupContent;
}

public boolean getIsInterface() {
return isInterface;
}

public void setIsInterface(boolean isInterface) {
this.isInterface = isInterface;
public void setProperties(ArrayList<PropertyModel> properties) {
this.properties = properties;
}

public ArrayList<MethodModel> getMethods() {
return methods;
}

public ArrayList<MethodModel> getMethodsSorted() {
TreeMap<String, MethodModel> tm = new TreeMap<String, MethodModel>();
for (MethodModel method : methods)
tm.put(method.getMethodName().toLowerCase(), method);
return new ArrayList<MethodModel>(tm.values());
}

public void setMethods(ArrayList<MethodModel> methods) {
this.methods = methods;
}

public ArrayList<ClassModel> getChildClasses() {
return childClasses;
}

public void addChildClass(ClassModel child) {
childClasses.add(child);
}

public String getClassName() {
String nameLine = getNameLine();
String strParent = cmodelParent == null ? "" : cmodelParent.getClassName() + ".";
if (nameLine != null)
nameLine = nameLine.trim();
if (nameLine != null && nameLine.trim().length() > 0) {
int fFound = nameLine.toLowerCase().indexOf("class ");
int cch = 6;
if (fFound == -1) {
fFound = nameLine.toLowerCase().indexOf("interface ");
cch = 10;
}
if (fFound > -1)
nameLine = nameLine.substring(fFound + cch).trim();
int lFound = nameLine.indexOf(" ");
if (lFound == -1)
return strParent + nameLine;
try {
String name = nameLine.substring(0, lFound);
return strParent + name;
} catch (Exception ex) {
return strParent + nameLine.substring(nameLine.lastIndexOf(" ") + 1);
}
} else {
return "";
}

}

public String getTopmostClassName() {
if (cmodelParent != null)
return cmodelParent.getClassName();
else
return getClassName();
}

public String getClassGroup() {
if (this.cmodelParent != null)
return cmodelParent.getClassGroup();
else
return strClassGroup;
}

public void setClassGroup(String strGroup) {
strClassGroup = strGroup;
}

public String getClassGroupContent() {
return strClassGroupContent;
}

public void setClassGroupContent(String strGroupContent) {
strClassGroupContent = strGroupContent;
}

public boolean getIsInterface() {
return isInterface;
}

public void setIsInterface(boolean isInterface) {
this.isInterface = isInterface;
}
}
Loading

0 comments on commit ddf2d89

Please sign in to comment.