From ec091a1fc1c4e12693c628cf6a2c8f4c791141b4 Mon Sep 17 00:00:00 2001 From: aclement Date: Fri, 4 Jun 2010 23:28:44 +0000 Subject: [PATCH] itd inner classes: partial --- .../weaver/NewMemberClassTypeMunger.java | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 org.aspectj.matcher/src/org/aspectj/weaver/NewMemberClassTypeMunger.java 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 index 000000000..732fced23 --- /dev/null +++ b/org.aspectj.matcher/src/org/aspectj/weaver/NewMemberClassTypeMunger.java @@ -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 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 -- 2.39.5