flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [11/38] git commit: [flex-falcon] [refs/heads/develop] - allow alternate params since sometimes we can't share a common base class when wrapping classes
Date Mon, 01 May 2017 03:47:37 GMT
allow alternate params since sometimes we can't share a common base class when wrapping classes


Project: http://git-wip-us.apache.org/repos/asf/flex-falcon/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-falcon/commit/af7cd26c
Tree: http://git-wip-us.apache.org/repos/asf/flex-falcon/tree/af7cd26c
Diff: http://git-wip-us.apache.org/repos/asf/flex-falcon/diff/af7cd26c

Branch: refs/heads/develop
Commit: af7cd26c61c7d08c6a098e164013dbe8c1d9b0b9
Parents: 72dd8a2
Author: Alex Harui <aharui@apache.org>
Authored: Fri Feb 10 11:19:09 2017 -0800
Committer: Alex Harui <aharui@apache.org>
Committed: Fri Feb 10 11:19:09 2017 -0800

----------------------------------------------------------------------
 .../constants/IMetaAttributeConstants.java      |  1 +
 .../compiler/internal/projects/FlexProject.java | 30 ++++++++++++++++++++
 2 files changed, 31 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/af7cd26c/compiler/src/main/java/org/apache/flex/compiler/constants/IMetaAttributeConstants.java
----------------------------------------------------------------------
diff --git a/compiler/src/main/java/org/apache/flex/compiler/constants/IMetaAttributeConstants.java
b/compiler/src/main/java/org/apache/flex/compiler/constants/IMetaAttributeConstants.java
index b30948c..6db2842 100644
--- a/compiler/src/main/java/org/apache/flex/compiler/constants/IMetaAttributeConstants.java
+++ b/compiler/src/main/java/org/apache/flex/compiler/constants/IMetaAttributeConstants.java
@@ -200,6 +200,7 @@ public interface IMetaAttributeConstants
     static final String ATTRIBUTE_SWFOVERRIDE = "SWFOverride";
     static final String NAME_SWFOVERRIDE_RETURNS = "returns";
     static final String NAME_SWFOVERRIDE_PARAMS = "params";
+    static final String NAME_SWFOVERRIDE_ALTPARAMS = "altparams";
     
 	// [VisualContentHolder]
     static final String ATTRIBUTE_VISUALCONTENTHOLDER = "VisualContentHolder";

http://git-wip-us.apache.org/repos/asf/flex-falcon/blob/af7cd26c/compiler/src/main/java/org/apache/flex/compiler/internal/projects/FlexProject.java
----------------------------------------------------------------------
diff --git a/compiler/src/main/java/org/apache/flex/compiler/internal/projects/FlexProject.java
b/compiler/src/main/java/org/apache/flex/compiler/internal/projects/FlexProject.java
index 9721d2a..5944ec0 100644
--- a/compiler/src/main/java/org/apache/flex/compiler/internal/projects/FlexProject.java
+++ b/compiler/src/main/java/org/apache/flex/compiler/internal/projects/FlexProject.java
@@ -2284,6 +2284,36 @@ public class FlexProject extends ASProject implements IFlexProject
                 }
             }
         }
+		IMetaTag[] metas = func.getAllMetaTags();
+		for (IMetaTag meta : metas)
+		{
+			if (meta.getTagName().equals(IMetaAttributeConstants.ATTRIBUTE_SWFOVERRIDE))
+			{
+				IMetaTagAttribute attr = meta.getAttribute(IMetaAttributeConstants.NAME_SWFOVERRIDE_ALTPARAMS);
+				if (attr != null)
+				{
+					// format is expectedQName:allowedQName,expectedQName:allowedQName.
+					// we don't know which parameter it is so we're assuming for now that any mapping
+					// applies to all occurences of that type in the parameter list
+					String paramList = attr.getValue();
+					String[] paramMap;
+					if (paramList.contains(","))
+						paramMap = paramList.split(",");
+					else
+					{
+						paramMap = new String[1];
+						paramMap[0] = paramList;
+					}
+					for (String item : paramMap)
+					{
+						String[] parts = item.split(":");
+						if (expectedDefinition.getQualifiedName().equals(parts[0]))
+							if (((ITypeDefinition)actualDefinition).isInstanceOf(parts[1], this))
+								return true;
+					}
+				}
+			}
+    	}
         return false;
     }
 


Mime
View raw message