1 24 25 package org.aspectj.compiler.base.ast; 26 27 import org.aspectj.compiler.base.*; 28 29 import java.util.*; 30 import java.io.File ; 31 32 public class SyntheticSourceLocation extends SourceLocation { 33 protected CompilerObject reference; 34 35 public SyntheticSourceLocation(CompilerObject reference) { 36 this.reference = reference; 37 } 38 39 public String toString() { return "SyntheticSourceLocation(" + reference + ")"; } 40 41 public JavaCompiler getCompiler() { return reference.getCompiler(); } 42 43 public boolean isSynthetic() { 44 return true; 45 } 46 47 public CompilationUnit getCompilationUnit() { 48 if (getSourceObject() != null) return getSourceObject().getCompilationUnit(); 49 return super.getCompilationUnit(); 50 } 51 52 public ASTObject getSourceObject() { 53 if (reference instanceof ASTObject) return (ASTObject)reference; 54 return null; 55 } 56 } 57 | Popular Tags |