aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraclement <aclement>2005-09-23 15:46:10 +0000
committeraclement <aclement>2005-09-23 15:46:10 +0000
commit14bef379c8c721caa8abbffbbe5cf1dc2c94d68a (patch)
treeb00095e60e985173ecb35e30269f62d9ce8a4775
parent03b20bc1129e03d5e8594262b89021e54ab017f9 (diff)
downloadaspectj-14bef379c8c721caa8abbffbbe5cf1dc2c94d68a.tar.gz
aspectj-14bef379c8c721caa8abbffbbe5cf1dc2c94d68a.zip
AST support - factories for ensuring when the classes in JDT core initialize, they are able to build the correct AJ subtypes.
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/core/dom/AjASTConverterFactory.java29
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/core/dom/AjTypeDeclFactory.java27
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/core/dom/rewrite/AjASTRewriteAnalyzerFactory.java39
3 files changed, 95 insertions, 0 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/core/dom/AjASTConverterFactory.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/core/dom/AjASTConverterFactory.java
new file mode 100644
index 000000000..121e55f4f
--- /dev/null
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/core/dom/AjASTConverterFactory.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.aspectj.ajdt.core.dom;
+
+import java.util.Map;
+
+import org.aspectj.org.eclipse.jdt.core.dom.ASTConverter;
+import org.aspectj.org.eclipse.jdt.core.dom.AjASTConverter;
+import org.aspectj.org.eclipse.jdt.core.dom.ASTConverter.IASTConverterFactory;
+import org.eclipse.core.runtime.IProgressMonitor;
+
+/**
+ * Factory, dynamically loaded by the TypeDeclaration class in the shadows/dom tree.
+ * This is a factory for type declaration that returns the Aj subclass of typedeclaration.
+ * @author AndyClement
+ */
+public class AjASTConverterFactory implements IASTConverterFactory {
+ public ASTConverter getASTConverter(Map options, boolean resolveBindings, IProgressMonitor monitor) {
+ return new AjASTConverter(options,resolveBindings,monitor);
+ }
+}
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/core/dom/AjTypeDeclFactory.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/core/dom/AjTypeDeclFactory.java
new file mode 100644
index 000000000..b2d1788dd
--- /dev/null
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/core/dom/AjTypeDeclFactory.java
@@ -0,0 +1,27 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.aspectj.ajdt.core.dom;
+
+import org.aspectj.org.eclipse.jdt.core.dom.AST;
+import org.aspectj.org.eclipse.jdt.core.dom.AjTypeDeclaration;
+import org.aspectj.org.eclipse.jdt.core.dom.TypeDeclaration;
+import org.aspectj.org.eclipse.jdt.core.dom.TypeDeclaration.ITypeDeclFactory;
+
+/**
+ * Factory, dynamically loaded by the TypeDeclaration class in the shadows/dom tree.
+ * This is a factory for type declaration that returns the Aj subclass of typedeclaration.
+ * @author AndyClement
+ */
+public class AjTypeDeclFactory implements ITypeDeclFactory {
+ public TypeDeclaration createTypeFor(AST ast) {
+ return new AjTypeDeclaration(ast);
+ }
+}
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/core/dom/rewrite/AjASTRewriteAnalyzerFactory.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/core/dom/rewrite/AjASTRewriteAnalyzerFactory.java
new file mode 100644
index 000000000..5aef64d8b
--- /dev/null
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/core/dom/rewrite/AjASTRewriteAnalyzerFactory.java
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.aspectj.ajdt.core.dom.rewrite;
+
+import java.util.Map;
+
+import org.aspectj.org.eclipse.jdt.core.dom.AST;
+import org.aspectj.org.eclipse.jdt.core.dom.ASTVisitor;
+import org.aspectj.org.eclipse.jdt.core.dom.AjTypeDeclaration;
+import org.aspectj.org.eclipse.jdt.core.dom.TypeDeclaration;
+import org.aspectj.org.eclipse.jdt.core.dom.TypeDeclaration.ITypeDeclFactory;
+import org.aspectj.org.eclipse.jdt.core.dom.rewrite.TargetSourceRangeComputer;
+import org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer;
+import org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.AjASTRewriteAnalyzer;
+import org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.NodeInfoStore;
+import org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.RewriteEventStore;
+import org.aspectj.org.eclipse.jdt.internal.core.dom.rewrite.ASTRewriteAnalyzer.IASTRewriteAnalyzerFactory;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.text.edits.TextEdit;
+
+/**
+ * Factory, dynamically loaded by the TypeDeclaration class in the shadows/dom tree.
+ * This is a factory for type declaration that returns the Aj subclass of typedeclaration.
+ * @author AndyClement
+ */
+public class AjASTRewriteAnalyzerFactory implements IASTRewriteAnalyzerFactory {
+ public ASTVisitor getASTRewriteAnalyzer(IDocument document, TextEdit rootEdit, RewriteEventStore eventStore,
+ NodeInfoStore nodeInfos, Map options, TargetSourceRangeComputer extendedSourceRangeComputer) {
+ return new AjASTRewriteAnalyzer(document,rootEdit,eventStore,nodeInfos,options,extendedSourceRangeComputer);
+ }
+}