]> source.dussan.org Git - aspectj.git/commitdiff
new placeholder nodes for type patterns and signature patterns. Before this change...
authoraclement <aclement>
Thu, 26 Jan 2006 10:54:40 +0000 (10:54 +0000)
committeraclement <aclement>
Thu, 26 Jan 2006 10:54:40 +0000 (10:54 +0000)
org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/AndPointcut.java
org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/DefaultTypePattern.java [new file with mode: 0644]
org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/PatternNode.java [new file with mode: 0644]
org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/SignaturePattern.java [new file with mode: 0644]
org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/TypePattern.java [new file with mode: 0644]

index 6caa20013e25f507f26544d9767231c8cb1200d2..1cb2040072a7343b1b81d27e4f2d3dce8eb06f42 100644 (file)
@@ -96,8 +96,12 @@ public class AndPointcut extends PointcutDesignator {
        ASTNode clone0(AST target) {
                AndPointcut result = new AndPointcut(target);
                result.setSourceRange(this.getStartPosition(), this.getLength());
-               result.setRight((PointcutDesignator)getRight().clone(target));
-               result.setLeft((PointcutDesignator)getLeft().clone(target));
+               if (getRight() != null) {
+                       result.setRight((PointcutDesignator)getRight().clone(target));
+               }
+               if (getLeft() != null) {
+                       result.setLeft((PointcutDesignator)getLeft().clone(target));
+               }
                return result;
        }
        final boolean subtreeMatch0(ASTMatcher matcher, Object other) {
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/DefaultTypePattern.java b/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/DefaultTypePattern.java
new file mode 100644 (file)
index 0000000..a52d6e2
--- /dev/null
@@ -0,0 +1,66 @@
+/********************************************************************
+ * Copyright (c) 2006 Contributors. 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://eclipse.org/legal/epl-v10.html 
+ *  
+ * Contributors: IBM Corporation - initial API and implementation 
+ *                              Helen Hawkins   - iniital version
+ *******************************************************************/
+package org.aspectj.org.eclipse.jdt.core.dom;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * DefaultTypePattern DOM AST node.
+ * has:
+ *   nothing
+ *   
+ * This class is a stub and should be deleted when concrete subclasses
+ * exist for all the different TypePattern's in AspectJ.
+ */
+public class DefaultTypePattern extends TypePattern {
+
+       private String detail;
+       DefaultTypePattern(AST ast,String d) {
+               super(ast);
+               this.detail = d;
+       }
+       public String getDetail() { return detail;}
+       public void setDetail(String d) {
+               this.detail = d;
+       }
+       public static List propertyDescriptors(int apiLevel) {
+               List propertyList = new ArrayList(0);
+               createPropertyList(DefaultTypePattern.class, propertyList);
+               return reapPropertyList(propertyList);
+       }
+       final List internalStructuralPropertiesForType(int apiLevel) {
+               return propertyDescriptors(apiLevel);
+       }
+       final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) {
+               // allow default implementation to flag the error
+               return super.internalGetSetChildProperty(property, get, child);
+       }
+       ASTNode clone0(AST target) {
+               DefaultTypePattern result = new DefaultTypePattern(target,getDetail());
+               result.setSourceRange(this.getStartPosition(), this.getLength());
+               return result;
+       }
+       final boolean subtreeMatch0(ASTMatcher matcher, Object other) {
+               // dispatch to correct overloaded match method
+               return ((AjASTMatcher)matcher).match(this, other);
+       }
+       void accept0(ASTVisitor visitor) {
+               if (visitor instanceof AjASTVisitor) {
+                       boolean visitChildren = ((AjASTVisitor)visitor).visit(this);
+                       ((AjASTVisitor)visitor).endVisit(this);
+               }
+       }
+       int treeSize() {
+               return memSize();
+       }
+
+}
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/PatternNode.java b/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/PatternNode.java
new file mode 100644 (file)
index 0000000..fcb834c
--- /dev/null
@@ -0,0 +1,31 @@
+/********************************************************************
+ * Copyright (c) 2006 Contributors. 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://eclipse.org/legal/epl-v10.html 
+ *  
+ * Contributors: IBM Corporation - initial API and implementation 
+ *                              Helen Hawkins   - iniital version
+ *******************************************************************/
+package org.aspectj.org.eclipse.jdt.core.dom;
+
+
+/**
+ * abstract TypePattern DOM AST node.
+ * has:
+ *   nothing at the moment
+ */
+public abstract class PatternNode extends ASTNode {
+
+       PatternNode(AST ast) {
+               super(ast);
+       }
+       int getNodeType0() {
+               return FIELD_DECLARATION; // should make a PATTERN_NODE type constant
+       }
+       int memSize() {
+               return 0; // stub method
+       }
+
+}
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/SignaturePattern.java b/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/SignaturePattern.java
new file mode 100644 (file)
index 0000000..a33a884
--- /dev/null
@@ -0,0 +1,67 @@
+/********************************************************************
+ * Copyright (c) 2006 Contributors. 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://eclipse.org/legal/epl-v10.html 
+ *  
+ * Contributors: IBM Corporation - initial API and implementation 
+ *                              Helen Hawkins   - iniital version
+ *******************************************************************/
+package org.aspectj.org.eclipse.jdt.core.dom;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * SignaturePattern DOM AST node.
+ * has:
+ *   nothing
+ *   
+ * For the moment this does nothing except enable us to
+ * set a SignaturePattern for the declare annotation
+ * declarations
+ */
+public class SignaturePattern extends PatternNode {
+
+       private String detail;
+       SignaturePattern(AST ast,String d) {
+               super(ast);
+               this.detail = d;
+       }
+       public String getDetail() { return detail;}
+       public void setDetail(String d) {
+               this.detail = d;
+       }
+       public static List propertyDescriptors(int apiLevel) {
+               List propertyList = new ArrayList(0);
+               createPropertyList(SignaturePattern.class, propertyList);
+               return reapPropertyList(propertyList);
+       }
+       final List internalStructuralPropertiesForType(int apiLevel) {
+               return propertyDescriptors(apiLevel);
+       }
+       final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor property, boolean get, ASTNode child) {
+               // allow default implementation to flag the error
+               return super.internalGetSetChildProperty(property, get, child);
+       }
+       ASTNode clone0(AST target) {
+               SignaturePattern result = new SignaturePattern(target,getDetail());
+               result.setSourceRange(this.getStartPosition(), this.getLength());
+               return result;
+       }
+       final boolean subtreeMatch0(ASTMatcher matcher, Object other) {
+               // dispatch to correct overloaded match method
+               return ((AjASTMatcher)matcher).match(this, other);
+       }
+       void accept0(ASTVisitor visitor) {
+               if (visitor instanceof AjASTVisitor) {
+                       boolean visitChildren = ((AjASTVisitor)visitor).visit(this);
+                       ((AjASTVisitor)visitor).endVisit(this);
+               }
+       }
+       int treeSize() {
+               return memSize();
+       }
+
+}
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/TypePattern.java b/org.aspectj.ajdt.core/src/org/aspectj/org/eclipse/jdt/core/dom/TypePattern.java
new file mode 100644 (file)
index 0000000..d683b68
--- /dev/null
@@ -0,0 +1,29 @@
+/********************************************************************
+ * Copyright (c) 2006 Contributors. 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://eclipse.org/legal/epl-v10.html 
+ *  
+ * Contributors: IBM Corporation - initial API and implementation 
+ *                              Helen Hawkins   - iniital version
+ *******************************************************************/
+package org.aspectj.org.eclipse.jdt.core.dom;
+
+
+/**
+ * abstract TypePattern DOM AST node.
+ * has:
+ *   nothing at the moment
+ */
+public abstract class TypePattern extends PatternNode {
+
+       TypePattern(AST ast) {
+               super(ast);
+       }
+
+       int memSize() {
+               return 0; // stub method
+       }
+
+}