]> source.dussan.org Git - aspectj.git/commitdiff
itd inner classes: partial
authoraclement <aclement>
Fri, 4 Jun 2010 23:28:44 +0000 (23:28 +0000)
committeraclement <aclement>
Fri, 4 Jun 2010 23:28:44 +0000 (23:28 +0000)
org.aspectj.matcher/src/org/aspectj/weaver/NewMemberClassTypeMunger.java [new file with mode: 0644]

diff --git a/org.aspectj.matcher/src/org/aspectj/weaver/NewMemberClassTypeMunger.java b/org.aspectj.matcher/src/org/aspectj/weaver/NewMemberClassTypeMunger.java
new file mode 100644 (file)
index 0000000..732fced
--- /dev/null
@@ -0,0 +1,66 @@
+/* *******************************************************************
+ * Copyright (c) 2010 SpringSource, 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://www.eclipse.org/legal/epl-v10.html 
+ * ******************************************************************/
+package org.aspectj.weaver;
+
+import java.io.IOException;
+import java.util.List;
+
+import org.aspectj.bridge.ISourceLocation;
+
+/**
+ * Weaver representation of an intertype declared member class. The munger captures the name of the type being declared and the
+ * target.
+ * 
+ * @author Andy Clement
+ * @since 1.6.9
+ */
+public class NewMemberClassTypeMunger extends ResolvedTypeMunger {
+
+       private UnresolvedType targetType;
+       private String memberTypeName;
+       private int version = 1; // 1.6.9m2
+
+       public NewMemberClassTypeMunger(UnresolvedType targetType, String memberTypeName) {
+               super(ResolvedTypeMunger.InnerClass, null);
+               this.targetType = targetType;
+               this.memberTypeName = memberTypeName;
+       }
+
+       @Override
+       public void write(CompressingDataOutputStream stream) throws IOException {
+               kind.write(stream);
+               stream.writeInt(version);
+               targetType.write(stream);
+               stream.writeUTF(memberTypeName);
+               writeSourceLocation(stream);
+               writeOutTypeAliases(stream);
+       }
+
+       public static ResolvedTypeMunger read(VersionedDataInputStream stream, ISourceContext context) throws IOException {
+               /* int version = */stream.readInt();
+               String memberTypeName = stream.readUTF();
+               UnresolvedType targetType = UnresolvedType.read(stream);
+               ISourceLocation sourceLocation = readSourceLocation(stream);
+               List<String> typeVarAliases = readInTypeAliases(stream);
+
+               NewMemberClassTypeMunger newInstance = new NewMemberClassTypeMunger(targetType, memberTypeName);
+               newInstance.setTypeVariableAliases(typeVarAliases);
+               newInstance.setSourceLocation(sourceLocation);
+               return newInstance;
+       }
+
+       public UnresolvedType getDeclaringType() {
+               return targetType;
+       }
+
+       public String getMemberTypeName() {
+               return memberTypeName;
+       }
+
+}
\ No newline at end of file