You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ca...@apache.org on 2017/09/06 22:35:03 UTC
[13/29] git commit: [flex-asjs] [refs/heads/develop] - move
ClassAliasBead so it can depend on Reflection APIs
move ClassAliasBead so it can depend on Reflection APIs
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/c01c4b39
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/c01c4b39
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/c01c4b39
Branch: refs/heads/develop
Commit: c01c4b39db44e74baca8c5357750261b2b4002fb
Parents: 85ccb27
Author: Alex Harui <ah...@apache.org>
Authored: Fri Sep 1 11:06:16 2017 -0700
Committer: Carlos Rovira <ca...@apache.org>
Committed: Thu Sep 7 00:24:03 2017 +0200
----------------------------------------------------------------------
.../src/main/config/compile-js-config.xml | 7 +-
.../flex/org/apache/flex/core/ClassAliasBead.as | 91 -------------------
.../Core/src/main/resources/basic-manifest.xml | 1 -
.../src/main/config/compile-swf-config.xml | 7 +-
.../flex/reflection/beads/ClassAliasBead.as | 94 ++++++++++++++++++++
.../src/main/resources/basic-manifest.xml | 26 ++++++
6 files changed, 132 insertions(+), 94 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c01c4b39/frameworks/js/FlexJS/projects/ReflectionJS/src/main/config/compile-js-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/js/FlexJS/projects/ReflectionJS/src/main/config/compile-js-config.xml b/frameworks/js/FlexJS/projects/ReflectionJS/src/main/config/compile-js-config.xml
index 296cc7c..203f678 100644
--- a/frameworks/js/FlexJS/projects/ReflectionJS/src/main/config/compile-js-config.xml
+++ b/frameworks/js/FlexJS/projects/ReflectionJS/src/main/config/compile-js-config.xml
@@ -64,6 +64,10 @@
</library-path>
<namespaces>
+ <namespace>
+ <uri>library://ns.apache.org/flexjs/basic</uri>
+ <manifest>../../../../../../../projects/Reflection/src/main/resources/basic-manifest.xml</manifest>
+ </namespace>
</namespaces>
<source-path>
@@ -84,7 +88,8 @@
</include-classes>
<include-namespaces>
+ <uri>library://ns.apache.org/flexjs/basic</uri>
</include-namespaces>
-
+
</flex-config>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c01c4b39/frameworks/projects/Core/src/main/flex/org/apache/flex/core/ClassAliasBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/ClassAliasBead.as b/frameworks/projects/Core/src/main/flex/org/apache/flex/core/ClassAliasBead.as
deleted file mode 100644
index 85ee702..0000000
--- a/frameworks/projects/Core/src/main/flex/org/apache/flex/core/ClassAliasBead.as
+++ /dev/null
@@ -1,91 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// Licensed to the Apache Software Foundation (ASF) under one or more
-// contributor license agreements. See the NOTICE file distributed with
-// this work for additional information regarding copyright ownership.
-// The ASF licenses this file to You under the Apache License, Version 2.0
-// (the "License"); you may not use this file except in compliance with
-// the License. You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-////////////////////////////////////////////////////////////////////////////////
-package org.apache.flex.core
-{
- COMPILE::SWF
- {
- import flash.net.registerClassAlias;
- import flash.utils.getDefinitionByName;
-
- import org.apache.flex.events.Event;
- import org.apache.flex.events.IEventDispatcher;
- import org.apache.flex.events.ValueEvent;
- }
-
- /**
- * The ClassAliasBead class is the registers class
- * aliases for serialization/deserialization.
- * Place this bead in the strand of the Application.
- * The compiler leaves information about class aliases
- * on the Application's info object.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public class ClassAliasBead implements IBead
- {
- /**
- * Constructor.
- *
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function ClassAliasBead()
- {
- }
-
- private var _strand:IStrand;
-
- /**
- * @copy org.apache.flex.core.IBead#strand
- *
- * @flexjsignorecoercion org.apache.flex.core.IFlexInfo
- * @flexjsignorecoercion Class
- * @langversion 3.0
- * @playerversion Flash 10.2
- * @playerversion AIR 2.6
- * @productversion FlexJS 0.0
- */
- public function set strand(value:IStrand):void
- {
- _strand = value;
- COMPILE::SWF
- {
- var app:IFlexInfo = value as IFlexInfo;
- var info:Object = app.info();
- var map:Object = info.remoteClassAliases;
- if (map)
- {
- for (var cn:String in map)
- {
- var alias:String = map[cn];
- var c:Class = getDefinitionByName(cn) as Class;
- registerClassAlias(alias, c);
- }
- }
- }
- }
-
-
- }
-}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c01c4b39/frameworks/projects/Core/src/main/resources/basic-manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/Core/src/main/resources/basic-manifest.xml b/frameworks/projects/Core/src/main/resources/basic-manifest.xml
index ec18097..007c691 100644
--- a/frameworks/projects/Core/src/main/resources/basic-manifest.xml
+++ b/frameworks/projects/Core/src/main/resources/basic-manifest.xml
@@ -31,7 +31,6 @@
<component id="SimpleStatesImpl" class="org.apache.flex.core.SimpleStatesImpl"/>
<component id="MXMLDragInitiator" class="org.apache.flex.core.MXMLDragInitiator" />
<component id="CallLaterBead" class="org.apache.flex.core.CallLaterBead" />
- <component id="ClassAliasBead" class="org.apache.flex.core.ClassAliasBead" />
<component id="BindableCSSStyles" class="org.apache.flex.core.BindableCSSStyles"/>
<component id="BindableCSSStylesWithFlex" class="org.apache.flex.core.BindableCSSStylesWithFlex"/>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c01c4b39/frameworks/projects/Reflection/src/main/config/compile-swf-config.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/Reflection/src/main/config/compile-swf-config.xml b/frameworks/projects/Reflection/src/main/config/compile-swf-config.xml
index 69f20db..68a1d4f 100644
--- a/frameworks/projects/Reflection/src/main/config/compile-swf-config.xml
+++ b/frameworks/projects/Reflection/src/main/config/compile-swf-config.xml
@@ -63,6 +63,10 @@
<library-path/>
<namespaces>
+ <namespace>
+ <uri>library://ns.apache.org/flexjs/basic</uri>
+ <manifest>../resources/basic-manifest.xml</manifest>
+ </namespace>
</namespaces>
<source-path>
@@ -78,8 +82,9 @@
</include-sources>
<include-namespaces>
+ <uri>library://ns.apache.org/flexjs/basic</uri>
</include-namespaces>
-
+
<target-player>${playerglobal.version}</target-player>
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c01c4b39/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/beads/ClassAliasBead.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/beads/ClassAliasBead.as b/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/beads/ClassAliasBead.as
new file mode 100644
index 0000000..d0c6448
--- /dev/null
+++ b/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/beads/ClassAliasBead.as
@@ -0,0 +1,94 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to You under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+////////////////////////////////////////////////////////////////////////////////
+package org.apache.flex.reflection.beads
+{
+ COMPILE::SWF
+ {
+ import flash.net.registerClassAlias;
+ import flash.utils.getDefinitionByName;
+ }
+ COMPILE::JS
+ {
+ import org.apache.flex.reflection.registerClassAlias;
+ import org.apache.flex.reflection.getDefinitionByName;
+ }
+
+ import org.apache.flex.core.IBead;
+ import org.apache.flex.core.IFlexInfo;
+ import org.apache.flex.core.IStrand;
+
+ /**
+ * The ClassAliasBead class is the registers class
+ * aliases for serialization/deserialization.
+ * Place this bead in the strand of the Application.
+ * The compiler leaves information about class aliases
+ * on the Application's info object.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public class ClassAliasBead implements IBead
+ {
+ /**
+ * Constructor.
+ *
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function ClassAliasBead()
+ {
+ }
+
+ private var _strand:IStrand;
+
+ /**
+ * @copy org.apache.flex.core.IBead#strand
+ *
+ * @flexjsignorecoercion org.apache.flex.core.IFlexInfo
+ * @flexjsignorecoercion Class
+ * @langversion 3.0
+ * @playerversion Flash 10.2
+ * @playerversion AIR 2.6
+ * @productversion FlexJS 0.0
+ */
+ public function set strand(value:IStrand):void
+ {
+ _strand = value;
+ var app:IFlexInfo = value as IFlexInfo;
+ var info:Object = app.info();
+ var map:Object = info.remoteClassAliases;
+ if (map)
+ {
+ for (var cn:String in map)
+ {
+ var alias:String = map[cn];
+ var c:Class = getDefinitionByName(cn) as Class;
+ if (c) // if no class, may have only been used in JS as a type and never actually instnatiated
+ registerClassAlias(alias, c);
+ }
+ }
+ }
+
+
+ }
+}
http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/c01c4b39/frameworks/projects/Reflection/src/main/resources/basic-manifest.xml
----------------------------------------------------------------------
diff --git a/frameworks/projects/Reflection/src/main/resources/basic-manifest.xml b/frameworks/projects/Reflection/src/main/resources/basic-manifest.xml
new file mode 100644
index 0000000..c816a34
--- /dev/null
+++ b/frameworks/projects/Reflection/src/main/resources/basic-manifest.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0"?>
+<!--
+
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements. See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+-->
+
+
+<componentPackage>
+
+ <component id="ClassAliasBead" class="org.apache.flex.reflection.beads.ClassAliasBead" />
+
+</componentPackage>