Package org.eclipse.steady.java.sign
Class CompilationUtils
- java.lang.Object
-
- org.eclipse.steady.java.sign.CompilationUtils
-
public final class CompilationUtils extends Object
Helper class to create the ASTSignature instances using ChangeDistiller.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ch.uzh.ifi.seal.changedistiller.ast.java.JavaCompilationcompileFile(String _filename)Returns the generatedJavaCompilationfrom the file identified by the given filename.static ch.uzh.ifi.seal.changedistiller.ast.java.JavaCompilationcompileSource(String source)compileSource.static List<ch.uzh.ifi.seal.changedistiller.ast.java.Comment>extractComments(ch.uzh.ifi.seal.changedistiller.ast.java.JavaCompilation sCompilationUnit)extractComments.static org.eclipse.jdt.internal.compiler.ast.FieldDeclarationfindField(org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration cu, String fieldName)findField.static org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclarationfindMethod(org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration cu, String methodName)findMethod.static org.eclipse.jdt.internal.compiler.ast.TypeDeclarationfindType(org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration cu, String typeName)findType.static FilegetFile(String filename)getFile.
-
-
-
Method Detail
-
compileSource
public static ch.uzh.ifi.seal.changedistiller.ast.java.JavaCompilation compileSource(String source)
compileSource.
- Parameters:
source- aStringobject.- Returns:
- a
JavaCompilationobject.
-
compileFile
public static ch.uzh.ifi.seal.changedistiller.ast.java.JavaCompilation compileFile(String _filename)
Returns the generatedJavaCompilationfrom the file identified by the given filename.- Parameters:
_filename- of the file to compile- Returns:
- the compilation of the file
-
extractComments
public static List<ch.uzh.ifi.seal.changedistiller.ast.java.Comment> extractComments(ch.uzh.ifi.seal.changedistiller.ast.java.JavaCompilation sCompilationUnit)
extractComments.
- Parameters:
sCompilationUnit- aJavaCompilationobject.- Returns:
- a
Listobject.
-
findMethod
public static org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration findMethod(org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration cu, String methodName)findMethod.
- Parameters:
cu- aCompilationUnitDeclarationobject.methodName- aStringobject.- Returns:
- a
AbstractMethodDeclarationobject.
-
findField
public static org.eclipse.jdt.internal.compiler.ast.FieldDeclaration findField(org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration cu, String fieldName)findField.
- Parameters:
cu- aCompilationUnitDeclarationobject.fieldName- aStringobject.- Returns:
- a
FieldDeclarationobject.
-
findType
public static org.eclipse.jdt.internal.compiler.ast.TypeDeclaration findType(org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration cu, String typeName)findType.
- Parameters:
cu- aCompilationUnitDeclarationobject.typeName- aStringobject.- Returns:
- a
TypeDeclarationobject.
-
-