gr.uom.java.xmi.decomposition.AnonymousClassDeclarationObject Maven / Gradle / Ivy
package gr.uom.java.xmi.decomposition;
import static gr.uom.java.xmi.decomposition.Visitor.stringify;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.jdt.core.dom.AnonymousClassDeclaration;
import org.eclipse.jdt.core.dom.CompilationUnit;
import gr.uom.java.xmi.LocationInfo;
import gr.uom.java.xmi.LocationInfo.CodeElementType;
import gr.uom.java.xmi.diff.CodeRange;
import gr.uom.java.xmi.LocationInfoProvider;
public class AnonymousClassDeclarationObject implements LocationInfoProvider {
private LocationInfo locationInfo;
private AnonymousClassDeclaration astNode;
private String astNodeString;
private List variables = new ArrayList<>();
private List types = new ArrayList<>();
private List methodInvocations = new ArrayList<>();
private List variableDeclarations = new ArrayList();
private List anonymousClassDeclarations = new ArrayList();
private List textBlocks = new ArrayList<>();
private List stringLiterals = new ArrayList<>();
private List charLiterals = new ArrayList<>();
private List numberLiterals = new ArrayList<>();
private List nullLiterals = new ArrayList<>();
private List booleanLiterals = new ArrayList<>();
private List typeLiterals = new ArrayList<>();
private List creations = new ArrayList<>();
private List infixExpressions = new ArrayList<>();
private List assignments = new ArrayList<>();
private List infixOperators = new ArrayList<>();
private List arrayAccesses = new ArrayList<>();
private List prefixExpressions = new ArrayList<>();
private List postfixExpressions = new ArrayList<>();
private List thisExpressions = new ArrayList<>();
private List arguments = new ArrayList<>();
private List parenthesizedExpressions = new ArrayList<>();
private List castExpressions = new ArrayList<>();
private List ternaryOperatorExpressions = new ArrayList();
private List lambdas = new ArrayList();
public AnonymousClassDeclarationObject(CompilationUnit cu, String filePath, AnonymousClassDeclaration anonymous) {
this.locationInfo = new LocationInfo(cu, filePath, anonymous, CodeElementType.ANONYMOUS_CLASS_DECLARATION);
this.astNode = anonymous;
this.astNodeString = stringify(anonymous);
}
public LocationInfo getLocationInfo() {
return locationInfo;
}
public AnonymousClassDeclaration getAstNode() {
return astNode;
}
public void setAstNode(AnonymousClassDeclaration node) {
this.astNode = node;
}
public String toString() {
return astNodeString;
}
public List getMethodInvocations() {
return methodInvocations;
}
public List getVariableDeclarations() {
return variableDeclarations;
}
public List getTypes() {
return types;
}
public List getAnonymousClassDeclarationsRecursively() {
List list = new ArrayList();
for(AnonymousClassDeclarationObject anonymous : anonymousClassDeclarations) {
list.add(anonymous);
list.addAll(anonymous.getAnonymousClassDeclarationsRecursively());
}
return list;
}
public List getAnonymousClassDeclarations() {
return anonymousClassDeclarations;
}
public List getTextBlocks() {
return textBlocks;
}
public List getStringLiterals() {
return stringLiterals;
}
public List getCharLiterals() {
return charLiterals;
}
public List getNumberLiterals() {
return numberLiterals;
}
public List getNullLiterals() {
return nullLiterals;
}
public List getBooleanLiterals() {
return booleanLiterals;
}
public List getTypeLiterals() {
return typeLiterals;
}
public List getCreations() {
return creations;
}
public List getInfixExpressions() {
return infixExpressions;
}
public List getAssignments() {
return assignments;
}
public List getInfixOperators() {
return infixOperators;
}
public List getArrayAccesses() {
return arrayAccesses;
}
public List getPrefixExpressions() {
return prefixExpressions;
}
public List getPostfixExpressions() {
return postfixExpressions;
}
public List getThisExpressions() {
return thisExpressions;
}
public List getArguments() {
return this.arguments;
}
public List getParenthesizedExpressions() {
return parenthesizedExpressions;
}
public List getCastExpressions() {
return castExpressions;
}
public List getTernaryOperatorExpressions() {
return ternaryOperatorExpressions;
}
public List getVariables() {
return variables;
}
public List getLambdas() {
return lambdas;
}
public CodeRange codeRange() {
return locationInfo.codeRange();
}
}