new folders for reflection
Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/3c6af711 Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/3c6af711 Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/3c6af711 Branch: refs/heads/mavenfolders Commit: 3c6af711fc1795ba6bdefc0fe1938263db9fab3d Parents: 8dabc8a Author: Alex Harui <aha...@apache.org> Authored: Tue Feb 2 21:50:10 2016 -0800 Committer: Alex Harui <aha...@apache.org> Committed: Tue Feb 2 21:50:10 2016 -0800 ---------------------------------------------------------------------- .../apache/flex/reflection/DefinitionBase.as | 51 ---- .../flex/reflection/DefinitionWithMetaData.as | 79 ------ .../flex/reflection/FunctionDefinition.as | 37 --- .../flex/reflection/MetaDataArgDefinition.as | 45 ---- .../flex/reflection/MetaDataDefinition.as | 71 ----- .../apache/flex/reflection/MethodDefinition.as | 50 ---- .../apache/flex/reflection/TypeDefinition.as | 260 ------------------- .../flex/reflection/VariableDefinition.as | 38 --- .../org/apache/flex/reflection/describeType.as | 47 ---- .../flex/reflection/getDefinitionByName.as | 51 ---- .../flex/reflection/getQualifiedClassName.as | 51 ---- .../reflection/getQualifiedSuperclassName.as | 49 ---- .../projects/Reflection/compile-asjs-config.xml | 77 ------ .../projects/Reflection/compile-config.xml | 73 ------ .../apache/flex/reflection/DefinitionBase.as | 51 ++++ .../flex/reflection/DefinitionWithMetaData.as | 79 ++++++ .../flex/reflection/FunctionDefinition.as | 37 +++ .../flex/reflection/MetaDataArgDefinition.as | 45 ++++ .../flex/reflection/MetaDataDefinition.as | 71 +++++ .../apache/flex/reflection/MethodDefinition.as | 50 ++++ .../apache/flex/reflection/TypeDefinition.as | 260 +++++++++++++++++++ .../flex/reflection/VariableDefinition.as | 38 +++ .../org/apache/flex/reflection/describeType.as | 47 ++++ .../flex/reflection/getDefinitionByName.as | 51 ++++ .../flex/reflection/getQualifiedClassName.as | 51 ++++ .../reflection/getQualifiedSuperclassName.as | 49 ++++ .../src/main/resources/compile-asjs-config.xml | 77 ++++++ .../src/main/resources/compile-config.xml | 73 ++++++ 28 files changed, 979 insertions(+), 979 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3c6af711/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/DefinitionBase.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/DefinitionBase.as b/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/DefinitionBase.as deleted file mode 100755 index f8bdd82..0000000 --- a/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/DefinitionBase.as +++ /dev/null @@ -1,51 +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.reflection -{ - - /** - * The description of a Class or Interface - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public class DefinitionBase - { - public function DefinitionBase(name:String, rawData:Object = null) - { - _name = name; - _rawData = rawData; - } - - private var _name:String; - public function get name():String - { - return _name; - } - - protected var _rawData:Object; - - protected function get rawData():Object - { - return _rawData; - } - } -} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3c6af711/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/DefinitionWithMetaData.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/DefinitionWithMetaData.as b/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/DefinitionWithMetaData.as deleted file mode 100755 index 3ca31ba..0000000 --- a/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/DefinitionWithMetaData.as +++ /dev/null @@ -1,79 +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.reflection -{ - - /** - * The description of a Class or Interface - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public class DefinitionWithMetaData extends DefinitionBase - { - public function DefinitionWithMetaData(name:String, rawData:Object = null) - { - super(name, rawData); - } - - public function get metadata():Array - { - var results:Array = []; - - COMPILE::AS3 - { - var xml:XML = rawData as XML; - var data:XMLList = xml.metadata; - var n:int = data.length(); - for (var i:int = 0; i < n; i++) - { - var item:XML = data[i] as XML; - var qname:String = item.@name; - results.push(new MetaDataDefinition(qname, item)); - } - } - COMPILE::JS - { - var rdata:*; - var data:Object = rawData; - if (data.names !== undefined) - { - var name:String = data.names[0].qName; - var def:Object = getDefinitionByName(name); - rdata = def.prototype.FLEXJS_REFLECTION_INFO(); - } - else - rdata = data; - if (rdata !== undefined && rdata.metadata !== undefined) - { - var metadatas:Array = rdata.metadata(); - if (metadatas) - { - var n:int = metadatas.length; - for each (var mdDef:Object in metadatas) - results.push(new MetaDataDefinition(mdDef.name, mdDef)); - } - } - } - return results; - } - } -} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3c6af711/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/FunctionDefinition.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/FunctionDefinition.as b/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/FunctionDefinition.as deleted file mode 100755 index 5f1f829..0000000 --- a/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/FunctionDefinition.as +++ /dev/null @@ -1,37 +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.reflection -{ - - /** - * The description of a Class or Interface - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public class FunctionDefinition extends DefinitionBase - { - public function FunctionDefinition(rawData:Object, packageName:String, name:String) - { - super(packageName, name); - } - } -} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3c6af711/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/MetaDataArgDefinition.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/MetaDataArgDefinition.as b/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/MetaDataArgDefinition.as deleted file mode 100755 index 1f1366f..0000000 --- a/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/MetaDataArgDefinition.as +++ /dev/null @@ -1,45 +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.reflection -{ - - /** - * The description of a Class or Interface - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public class MetaDataArgDefinition extends DefinitionBase - { - public function MetaDataArgDefinition(name:String, value:String) - { - super(name); - _value = value; - } - - private var _value:String; - - public function get value():String - { - return _value; - } - } -} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3c6af711/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/MetaDataDefinition.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/MetaDataDefinition.as b/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/MetaDataDefinition.as deleted file mode 100755 index 4b9a8c9..0000000 --- a/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/MetaDataDefinition.as +++ /dev/null @@ -1,71 +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.reflection -{ - - /** - * The description of a Class or Interface - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public class MetaDataDefinition extends DefinitionBase - { - public function MetaDataDefinition(name:String, rawData:Object) - { - super(name, rawData); - } - - public function get args():Array - { - var results:Array = []; - - COMPILE::AS3 - { - var xml:XML = rawData as XML; - var data:XMLList = xml.arg; - var n:int = data.length(); - for (var i:int = 0; i < n; i++) - { - var item:XML = data[i] as XML; - var key:String = item.@key; - var value:String = item.@value; - results.push(new MetaDataArgDefinition(key, value)); - } - } - COMPILE::JS - { - var rdata:* = rawData; - if (rdata !== undefined) - { - var args:Array = rdata.args; - if (args) - { - var n:int = args.length; - for each (var argDef:Object in args) - results.push(new MetaDataArgDefinition(argDef.key, argDef.value)); - } - } - } - return results; - } - } -} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3c6af711/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/MethodDefinition.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/MethodDefinition.as b/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/MethodDefinition.as deleted file mode 100755 index a16c649..0000000 --- a/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/MethodDefinition.as +++ /dev/null @@ -1,50 +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.reflection -{ - - /** - * The description of a Class or Interface - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public class MethodDefinition extends DefinitionWithMetaData - { - public function MethodDefinition(name:String, declaredBy:String, rawData:Object = null) - { - super(name, rawData); - _declaredBy = declaredBy; - } - - private var _declaredBy:String; - private var declaredByDef:TypeDefinition; - - public function get declaredBy():TypeDefinition - { - if (declaredByDef == null) - declaredByDef = new TypeDefinition(_declaredBy); - - return declaredByDef; - } - - } -} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3c6af711/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/TypeDefinition.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/TypeDefinition.as b/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/TypeDefinition.as deleted file mode 100755 index 6035bab..0000000 --- a/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/TypeDefinition.as +++ /dev/null @@ -1,260 +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.reflection -{ - - /** - * The description of a Class or Interface - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public class TypeDefinition extends DefinitionWithMetaData - { - public function TypeDefinition(name:String, rawData:Object = null) - { - var c:int = name.indexOf("::"); - if (c > -1) - { - _packageName = name.substring(0, c); - name = name.substring(c+2); - } - else - _packageName = ""; - super(name, rawData); - } - - private var _packageName:String; - - public function get packageName():String - { - return _packageName; - } - - override protected function get rawData():Object - { - if (_rawData == null) - { - var def:Object = getDefinitionByName(packageName + "::" + name); - COMPILE::AS3 - { - _rawData = describeType(def); - } - COMPILE::JS - { - _rawData = def.prototype.FLEXJS_CLASS_INFO; - } - } - return _rawData; - } - /** - * @flexjsignorecoercion XML - */ - public function get baseClasses():Array - { - var results:Array = []; - - COMPILE::AS3 - { - var xml:XML = rawData as XML; - var data:XMLList = xml.extendsClass; - var n:int = data.length(); - for (var i:int = 0; i < n; i++) - { - var item:XML = data[i] as XML; - var qname:String = item.@type; - results.push(new TypeDefinition(qname)); - } - } - COMPILE::JS - { - var data:Object = rawData; - var name:String = data.names[0].qName; - var def:Object = getDefinitionByName(name); - var prototype:Object = def.prototype; - while (prototype.FLEXJS_CLASS_INFO !== undefined) - { - name = prototype.FLEXJS_CLASS_INFO.names[0].qName; - results.push(new TypeDefinition(name)); - def = getDefinitionByName(name); - prototype = def.prototype; - } - } - return results; - } - - public function get interfaces():Array - { - var results:Array = []; - - COMPILE::AS3 - { - var xml:XML = rawData as XML; - var data:XMLList = xml.implementsInterface; - var n:int = data.length(); - for (var i:int = 0; i < n; i++) - { - var item:XML = data[i] as XML; - var qname:String = item.@type; - results.push(new TypeDefinition(qname)); - } - } - COMPILE::JS - { - var data:* = rawData; - var name:String = data.names[0].qName; - var def:Object = getDefinitionByName(name); - var prototype:Object = def.prototype; - while (data !== undefined) - { - var interfaces:Array = data.interfaces; - if (interfaces) - { - var n:int = interfaces.length; - for each (var s:String in interfaces) - results.push(new TypeDefinition(s)); - } - name = data.names[0].qName; - results.push(new TypeDefinition(name)); - def = getDefinitionByName(name); - prototype = def.prototype; - data = prototype.FLEXJS_CLASS_INFO; - } - } - return results; - } - - public function get variables():Array - { - var results:Array = []; - - COMPILE::AS3 - { - var xml:XML = rawData as XML; - var data:XMLList = xml.variable; - var n:int = data.length(); - for (var i:int = 0; i < n; i++) - { - var item:XML = data[i] as XML; - var qname:String = item.@name; - results.push(new VariableDefinition(qname, item)); - } - } - COMPILE::JS - { - var data:Object = rawData; - var name:String = data.names[0].qName; - var def:Object = getDefinitionByName(name); - var rdata:* = def.prototype.FLEXJS_REFLECTION_INFO(); - if (rdata !== undefined) - { - var variables:Object = rdata.variables(); - if (variables) - { - for (var v:String in variables) - { - var varDef:Object = variables[v]; - results.push(new VariableDefinition(v, varDef)); - } - } - } - } - return results; - } - - public function get accessors():Array - { - var results:Array = []; - - COMPILE::AS3 - { - var xml:XML = rawData as XML; - var data:XMLList = xml.accessor; - var n:int = data.length(); - for (var i:int = 0; i < n; i++) - { - var item:XML = data[i] as XML; - var qname:String = item.@name; - results.push(new MethodDefinition(qname, item.@declaredBy, item)); - } - } - COMPILE::JS - { - var data:Object = rawData; - var name:String = data.names[0].qName; - var def:Object = getDefinitionByName(name); - var rdata:* = def.prototype.FLEXJS_REFLECTION_INFO(); - if (rdata !== undefined) - { - var accessors:Object = rdata.accessors(); - if (accessors) - { - for (var prop:String in accessors) - { - var propDef:Object = accessors[prop]; - results.push(new MethodDefinition(prop, propDef.declaredBy, propDef)); - } - } - } - } - return results; - } - - public function get methods():Array - { - var results:Array = []; - - COMPILE::AS3 - { - var xml:XML = rawData as XML; - var data:XMLList = xml.method; - var n:int = data.length(); - for (var i:int = 0; i < n; i++) - { - var item:XML = data[i] as XML; - var qname:String = item.@name; - results.push(new MethodDefinition(qname, item.@declaredBy, item)); - } - } - COMPILE::JS - { - var data:Object = rawData; - var name:String = data.names[0].qName; - var def:Object = getDefinitionByName(name); - var rdata:* = def.prototype.FLEXJS_REFLECTION_INFO(); - if (rdata !== undefined) - { - var methods:Object = rdata.methods(); - if (methods) - { - for (var fn:String in methods) - { - var fnDef:Object = methods[fn]; - results.push(new MethodDefinition(fn, fnDef.declaredBy, fnDef)); - } - } - } - } - return results; - } - - } -} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3c6af711/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/VariableDefinition.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/VariableDefinition.as b/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/VariableDefinition.as deleted file mode 100755 index 3e87566..0000000 --- a/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/VariableDefinition.as +++ /dev/null @@ -1,38 +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.reflection -{ - - /** - * The description of a Class or Interface - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public class VariableDefinition extends DefinitionWithMetaData - { - public function VariableDefinition(name:String, rawData:Object = null) - { - super(rawData, name); - } - - } -} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3c6af711/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/describeType.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/describeType.as b/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/describeType.as deleted file mode 100755 index 1114a1e..0000000 --- a/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/describeType.as +++ /dev/null @@ -1,47 +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.reflection -{ -COMPILE::AS3 -{ - import flash.utils.describeType; -} - - /** - * The equivalent of flash.utils.describeType. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function describeType(value:Object):TypeDefinition - { - COMPILE::AS3 - { - var xml:XML = flash.utils.describeType(value); - return new TypeDefinition(xml.@name, xml); - } - COMPILE::JS - { - var qname:String = getQualifiedClassName(value); - return new TypeDefinition(qname, value.FLEXJS_CLASS_INFO); - } - } -} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3c6af711/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/getDefinitionByName.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/getDefinitionByName.as b/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/getDefinitionByName.as deleted file mode 100755 index b18ab3c..0000000 --- a/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/getDefinitionByName.as +++ /dev/null @@ -1,51 +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.reflection -{ -COMPILE::AS3 -{ - import flash.utils.getDefinitionByName; -} - - /** - * The equivalent of flash.utils.getQualifiedClassName. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function getDefinitionByName(name:String):Object - { - COMPILE::AS3 - { - return flash.utils.getDefinitionByName(name); - } - COMPILE::JS - { - var parts:Array = name.split('.'); - var n:int = parts.length; - var o:Object = window; - for (var i:int = 0; i < n; i++) { - o = o[parts[i]]; - } - return o; - } - } -} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3c6af711/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/getQualifiedClassName.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/getQualifiedClassName.as b/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/getQualifiedClassName.as deleted file mode 100755 index 42eaa47..0000000 --- a/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/getQualifiedClassName.as +++ /dev/null @@ -1,51 +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.reflection -{ -COMPILE::AS3 -{ - import flash.utils.getQualifiedClassName; -} - - /** - * The equivalent of flash.utils.getQualifiedClassName. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function getQualifiedClassName(value:*):String - { - COMPILE::AS3 - { - return flash.utils.getQualifiedClassName(value); - } - COMPILE::JS - { - if (value.FLEXJS_CLASS_INFO == null) - { - if (value.prototype.FLEXJS_CLASS_INFO == null) - return null; - value = value.prototype; - } - return value.FLEXJS_CLASS_INFO.names[0].qName; - } - } -} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3c6af711/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/getQualifiedSuperclassName.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/getQualifiedSuperclassName.as b/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/getQualifiedSuperclassName.as deleted file mode 100755 index 95c75fa..0000000 --- a/frameworks/projects/Reflection/as/src/org/apache/flex/reflection/getQualifiedSuperclassName.as +++ /dev/null @@ -1,49 +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.reflection -{ -COMPILE::AS3 -{ - import flash.utils.getQualifiedSuperclassName; -} - - /** - * The equivalent of flash.utils.getQualifiedSuperclassName. - * - * @langversion 3.0 - * @playerversion Flash 10.2 - * @playerversion AIR 2.6 - * @productversion FlexJS 0.0 - */ - public function getQualifiedSuperclassName(value:*):String - { - COMPILE::AS3 - { - return flash.utils.getQualifiedSuperclassName(value); - } - COMPILE::JS - { - var constructorAsObject:Object = value["constructor"]; - value = constructorAsObject.superClass_; - if (value == null || value.FLEXJS_CLASS_INFO == null) - return null; - return value.FLEXJS_CLASS_INFO.names[0].qName; - } - } -} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3c6af711/frameworks/projects/Reflection/compile-asjs-config.xml ---------------------------------------------------------------------- diff --git a/frameworks/projects/Reflection/compile-asjs-config.xml b/frameworks/projects/Reflection/compile-asjs-config.xml deleted file mode 100644 index 92f5a0f..0000000 --- a/frameworks/projects/Reflection/compile-asjs-config.xml +++ /dev/null @@ -1,77 +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. - ---> -<flex-config> - - <compiler> - <accessible>false</accessible> - - <external-library-path> - </external-library-path> - - <mxml> - <children-as-data>true</children-as-data> - </mxml> - <binding-value-change-event>org.apache.flex.events.ValueChangeEvent</binding-value-change-event> - <binding-value-change-event-kind>org.apache.flex.events.ValueChangeEvent</binding-value-change-event-kind> - <binding-value-change-event-type>valueChange</binding-value-change-event-type> - - <keep-as3-metadata> - <name>Bindable</name> - <name>Managed</name> - <name>ChangeEvent</name> - <name>NonCommittingChangeEvent</name> - <name>Transient</name> - </keep-as3-metadata> - - <locale/> - - <library-path> - <!-- asjscompc won't 'link' these classes in, but will list their requires - if these swcs are on the external-library-path then their requires - will not be listed --> - <path-element>../../externs/Core.swc</path-element> - </library-path> - - <namespaces> - </namespaces> - - <source-path> - <path-element>as/src</path-element> - </source-path> - - <warn-no-constructor>false</warn-no-constructor> - </compiler> - - <include-file> - </include-file> - - <include-sources> - <path-element>as/src</path-element> - </include-sources> - - <include-classes> - </include-classes> - - <include-namespaces> - </include-namespaces> - - <target-player>${playerglobal.version}</target-player> - - -</flex-config> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3c6af711/frameworks/projects/Reflection/compile-config.xml ---------------------------------------------------------------------- diff --git a/frameworks/projects/Reflection/compile-config.xml b/frameworks/projects/Reflection/compile-config.xml deleted file mode 100644 index e02f6b2..0000000 --- a/frameworks/projects/Reflection/compile-config.xml +++ /dev/null @@ -1,73 +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. - ---> -<flex-config> - - <compiler> - <accessible>false</accessible> - - <external-library-path> - <path-element>${env.AIR_HOME}/frameworks/libs/air/airglobal.swc</path-element> - <path-element>../../libs/Core.swc</path-element> - </external-library-path> - - <mxml> - <children-as-data>true</children-as-data> - </mxml> - <binding-value-change-event>org.apache.flex.events.ValueChangeEvent</binding-value-change-event> - <binding-value-change-event-kind>org.apache.flex.events.ValueChangeEvent</binding-value-change-event-kind> - <binding-value-change-event-type>valueChange</binding-value-change-event-type> - - <keep-as3-metadata> - <name>Bindable</name> - <name>Managed</name> - <name>ChangeEvent</name> - <name>NonCommittingChangeEvent</name> - <name>Transient</name> - </keep-as3-metadata> - - <locale/> - - <library-path/> - - <namespaces> - </namespaces> - - <source-path> - <path-element>as/src</path-element> - </source-path> - - <warn-no-constructor>false</warn-no-constructor> - </compiler> - - <include-file> - <name>js/out/*</name> - <path>js/out/*</path> - </include-file> - - <include-sources> - <path-element>as/src</path-element> - </include-sources> - - <include-namespaces> - </include-namespaces> - - <target-player>${playerglobal.version}</target-player> - - -</flex-config> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3c6af711/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/DefinitionBase.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/DefinitionBase.as b/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/DefinitionBase.as new file mode 100755 index 0000000..f8bdd82 --- /dev/null +++ b/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/DefinitionBase.as @@ -0,0 +1,51 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 +{ + + /** + * The description of a Class or Interface + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public class DefinitionBase + { + public function DefinitionBase(name:String, rawData:Object = null) + { + _name = name; + _rawData = rawData; + } + + private var _name:String; + public function get name():String + { + return _name; + } + + protected var _rawData:Object; + + protected function get rawData():Object + { + return _rawData; + } + } +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3c6af711/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/DefinitionWithMetaData.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/DefinitionWithMetaData.as b/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/DefinitionWithMetaData.as new file mode 100755 index 0000000..3ca31ba --- /dev/null +++ b/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/DefinitionWithMetaData.as @@ -0,0 +1,79 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 +{ + + /** + * The description of a Class or Interface + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public class DefinitionWithMetaData extends DefinitionBase + { + public function DefinitionWithMetaData(name:String, rawData:Object = null) + { + super(name, rawData); + } + + public function get metadata():Array + { + var results:Array = []; + + COMPILE::AS3 + { + var xml:XML = rawData as XML; + var data:XMLList = xml.metadata; + var n:int = data.length(); + for (var i:int = 0; i < n; i++) + { + var item:XML = data[i] as XML; + var qname:String = item.@name; + results.push(new MetaDataDefinition(qname, item)); + } + } + COMPILE::JS + { + var rdata:*; + var data:Object = rawData; + if (data.names !== undefined) + { + var name:String = data.names[0].qName; + var def:Object = getDefinitionByName(name); + rdata = def.prototype.FLEXJS_REFLECTION_INFO(); + } + else + rdata = data; + if (rdata !== undefined && rdata.metadata !== undefined) + { + var metadatas:Array = rdata.metadata(); + if (metadatas) + { + var n:int = metadatas.length; + for each (var mdDef:Object in metadatas) + results.push(new MetaDataDefinition(mdDef.name, mdDef)); + } + } + } + return results; + } + } +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3c6af711/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/FunctionDefinition.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/FunctionDefinition.as b/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/FunctionDefinition.as new file mode 100755 index 0000000..5f1f829 --- /dev/null +++ b/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/FunctionDefinition.as @@ -0,0 +1,37 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 +{ + + /** + * The description of a Class or Interface + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public class FunctionDefinition extends DefinitionBase + { + public function FunctionDefinition(rawData:Object, packageName:String, name:String) + { + super(packageName, name); + } + } +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3c6af711/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/MetaDataArgDefinition.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/MetaDataArgDefinition.as b/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/MetaDataArgDefinition.as new file mode 100755 index 0000000..1f1366f --- /dev/null +++ b/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/MetaDataArgDefinition.as @@ -0,0 +1,45 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 +{ + + /** + * The description of a Class or Interface + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public class MetaDataArgDefinition extends DefinitionBase + { + public function MetaDataArgDefinition(name:String, value:String) + { + super(name); + _value = value; + } + + private var _value:String; + + public function get value():String + { + return _value; + } + } +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3c6af711/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/MetaDataDefinition.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/MetaDataDefinition.as b/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/MetaDataDefinition.as new file mode 100755 index 0000000..4b9a8c9 --- /dev/null +++ b/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/MetaDataDefinition.as @@ -0,0 +1,71 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 +{ + + /** + * The description of a Class or Interface + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public class MetaDataDefinition extends DefinitionBase + { + public function MetaDataDefinition(name:String, rawData:Object) + { + super(name, rawData); + } + + public function get args():Array + { + var results:Array = []; + + COMPILE::AS3 + { + var xml:XML = rawData as XML; + var data:XMLList = xml.arg; + var n:int = data.length(); + for (var i:int = 0; i < n; i++) + { + var item:XML = data[i] as XML; + var key:String = item.@key; + var value:String = item.@value; + results.push(new MetaDataArgDefinition(key, value)); + } + } + COMPILE::JS + { + var rdata:* = rawData; + if (rdata !== undefined) + { + var args:Array = rdata.args; + if (args) + { + var n:int = args.length; + for each (var argDef:Object in args) + results.push(new MetaDataArgDefinition(argDef.key, argDef.value)); + } + } + } + return results; + } + } +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3c6af711/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/MethodDefinition.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/MethodDefinition.as b/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/MethodDefinition.as new file mode 100755 index 0000000..a16c649 --- /dev/null +++ b/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/MethodDefinition.as @@ -0,0 +1,50 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 +{ + + /** + * The description of a Class or Interface + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public class MethodDefinition extends DefinitionWithMetaData + { + public function MethodDefinition(name:String, declaredBy:String, rawData:Object = null) + { + super(name, rawData); + _declaredBy = declaredBy; + } + + private var _declaredBy:String; + private var declaredByDef:TypeDefinition; + + public function get declaredBy():TypeDefinition + { + if (declaredByDef == null) + declaredByDef = new TypeDefinition(_declaredBy); + + return declaredByDef; + } + + } +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3c6af711/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/TypeDefinition.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/TypeDefinition.as b/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/TypeDefinition.as new file mode 100755 index 0000000..6035bab --- /dev/null +++ b/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/TypeDefinition.as @@ -0,0 +1,260 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 +{ + + /** + * The description of a Class or Interface + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public class TypeDefinition extends DefinitionWithMetaData + { + public function TypeDefinition(name:String, rawData:Object = null) + { + var c:int = name.indexOf("::"); + if (c > -1) + { + _packageName = name.substring(0, c); + name = name.substring(c+2); + } + else + _packageName = ""; + super(name, rawData); + } + + private var _packageName:String; + + public function get packageName():String + { + return _packageName; + } + + override protected function get rawData():Object + { + if (_rawData == null) + { + var def:Object = getDefinitionByName(packageName + "::" + name); + COMPILE::AS3 + { + _rawData = describeType(def); + } + COMPILE::JS + { + _rawData = def.prototype.FLEXJS_CLASS_INFO; + } + } + return _rawData; + } + /** + * @flexjsignorecoercion XML + */ + public function get baseClasses():Array + { + var results:Array = []; + + COMPILE::AS3 + { + var xml:XML = rawData as XML; + var data:XMLList = xml.extendsClass; + var n:int = data.length(); + for (var i:int = 0; i < n; i++) + { + var item:XML = data[i] as XML; + var qname:String = item.@type; + results.push(new TypeDefinition(qname)); + } + } + COMPILE::JS + { + var data:Object = rawData; + var name:String = data.names[0].qName; + var def:Object = getDefinitionByName(name); + var prototype:Object = def.prototype; + while (prototype.FLEXJS_CLASS_INFO !== undefined) + { + name = prototype.FLEXJS_CLASS_INFO.names[0].qName; + results.push(new TypeDefinition(name)); + def = getDefinitionByName(name); + prototype = def.prototype; + } + } + return results; + } + + public function get interfaces():Array + { + var results:Array = []; + + COMPILE::AS3 + { + var xml:XML = rawData as XML; + var data:XMLList = xml.implementsInterface; + var n:int = data.length(); + for (var i:int = 0; i < n; i++) + { + var item:XML = data[i] as XML; + var qname:String = item.@type; + results.push(new TypeDefinition(qname)); + } + } + COMPILE::JS + { + var data:* = rawData; + var name:String = data.names[0].qName; + var def:Object = getDefinitionByName(name); + var prototype:Object = def.prototype; + while (data !== undefined) + { + var interfaces:Array = data.interfaces; + if (interfaces) + { + var n:int = interfaces.length; + for each (var s:String in interfaces) + results.push(new TypeDefinition(s)); + } + name = data.names[0].qName; + results.push(new TypeDefinition(name)); + def = getDefinitionByName(name); + prototype = def.prototype; + data = prototype.FLEXJS_CLASS_INFO; + } + } + return results; + } + + public function get variables():Array + { + var results:Array = []; + + COMPILE::AS3 + { + var xml:XML = rawData as XML; + var data:XMLList = xml.variable; + var n:int = data.length(); + for (var i:int = 0; i < n; i++) + { + var item:XML = data[i] as XML; + var qname:String = item.@name; + results.push(new VariableDefinition(qname, item)); + } + } + COMPILE::JS + { + var data:Object = rawData; + var name:String = data.names[0].qName; + var def:Object = getDefinitionByName(name); + var rdata:* = def.prototype.FLEXJS_REFLECTION_INFO(); + if (rdata !== undefined) + { + var variables:Object = rdata.variables(); + if (variables) + { + for (var v:String in variables) + { + var varDef:Object = variables[v]; + results.push(new VariableDefinition(v, varDef)); + } + } + } + } + return results; + } + + public function get accessors():Array + { + var results:Array = []; + + COMPILE::AS3 + { + var xml:XML = rawData as XML; + var data:XMLList = xml.accessor; + var n:int = data.length(); + for (var i:int = 0; i < n; i++) + { + var item:XML = data[i] as XML; + var qname:String = item.@name; + results.push(new MethodDefinition(qname, item.@declaredBy, item)); + } + } + COMPILE::JS + { + var data:Object = rawData; + var name:String = data.names[0].qName; + var def:Object = getDefinitionByName(name); + var rdata:* = def.prototype.FLEXJS_REFLECTION_INFO(); + if (rdata !== undefined) + { + var accessors:Object = rdata.accessors(); + if (accessors) + { + for (var prop:String in accessors) + { + var propDef:Object = accessors[prop]; + results.push(new MethodDefinition(prop, propDef.declaredBy, propDef)); + } + } + } + } + return results; + } + + public function get methods():Array + { + var results:Array = []; + + COMPILE::AS3 + { + var xml:XML = rawData as XML; + var data:XMLList = xml.method; + var n:int = data.length(); + for (var i:int = 0; i < n; i++) + { + var item:XML = data[i] as XML; + var qname:String = item.@name; + results.push(new MethodDefinition(qname, item.@declaredBy, item)); + } + } + COMPILE::JS + { + var data:Object = rawData; + var name:String = data.names[0].qName; + var def:Object = getDefinitionByName(name); + var rdata:* = def.prototype.FLEXJS_REFLECTION_INFO(); + if (rdata !== undefined) + { + var methods:Object = rdata.methods(); + if (methods) + { + for (var fn:String in methods) + { + var fnDef:Object = methods[fn]; + results.push(new MethodDefinition(fn, fnDef.declaredBy, fnDef)); + } + } + } + } + return results; + } + + } +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3c6af711/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/VariableDefinition.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/VariableDefinition.as b/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/VariableDefinition.as new file mode 100755 index 0000000..3e87566 --- /dev/null +++ b/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/VariableDefinition.as @@ -0,0 +1,38 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 +{ + + /** + * The description of a Class or Interface + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public class VariableDefinition extends DefinitionWithMetaData + { + public function VariableDefinition(name:String, rawData:Object = null) + { + super(rawData, name); + } + + } +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3c6af711/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/describeType.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/describeType.as b/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/describeType.as new file mode 100755 index 0000000..1114a1e --- /dev/null +++ b/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/describeType.as @@ -0,0 +1,47 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 +{ +COMPILE::AS3 +{ + import flash.utils.describeType; +} + + /** + * The equivalent of flash.utils.describeType. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public function describeType(value:Object):TypeDefinition + { + COMPILE::AS3 + { + var xml:XML = flash.utils.describeType(value); + return new TypeDefinition(xml.@name, xml); + } + COMPILE::JS + { + var qname:String = getQualifiedClassName(value); + return new TypeDefinition(qname, value.FLEXJS_CLASS_INFO); + } + } +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3c6af711/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/getDefinitionByName.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/getDefinitionByName.as b/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/getDefinitionByName.as new file mode 100755 index 0000000..b18ab3c --- /dev/null +++ b/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/getDefinitionByName.as @@ -0,0 +1,51 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 +{ +COMPILE::AS3 +{ + import flash.utils.getDefinitionByName; +} + + /** + * The equivalent of flash.utils.getQualifiedClassName. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public function getDefinitionByName(name:String):Object + { + COMPILE::AS3 + { + return flash.utils.getDefinitionByName(name); + } + COMPILE::JS + { + var parts:Array = name.split('.'); + var n:int = parts.length; + var o:Object = window; + for (var i:int = 0; i < n; i++) { + o = o[parts[i]]; + } + return o; + } + } +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3c6af711/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/getQualifiedClassName.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/getQualifiedClassName.as b/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/getQualifiedClassName.as new file mode 100755 index 0000000..42eaa47 --- /dev/null +++ b/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/getQualifiedClassName.as @@ -0,0 +1,51 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 +{ +COMPILE::AS3 +{ + import flash.utils.getQualifiedClassName; +} + + /** + * The equivalent of flash.utils.getQualifiedClassName. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public function getQualifiedClassName(value:*):String + { + COMPILE::AS3 + { + return flash.utils.getQualifiedClassName(value); + } + COMPILE::JS + { + if (value.FLEXJS_CLASS_INFO == null) + { + if (value.prototype.FLEXJS_CLASS_INFO == null) + return null; + value = value.prototype; + } + return value.FLEXJS_CLASS_INFO.names[0].qName; + } + } +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3c6af711/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/getQualifiedSuperclassName.as ---------------------------------------------------------------------- diff --git a/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/getQualifiedSuperclassName.as b/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/getQualifiedSuperclassName.as new file mode 100755 index 0000000..95c75fa --- /dev/null +++ b/frameworks/projects/Reflection/src/main/flex/org/apache/flex/reflection/getQualifiedSuperclassName.as @@ -0,0 +1,49 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// 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 +{ +COMPILE::AS3 +{ + import flash.utils.getQualifiedSuperclassName; +} + + /** + * The equivalent of flash.utils.getQualifiedSuperclassName. + * + * @langversion 3.0 + * @playerversion Flash 10.2 + * @playerversion AIR 2.6 + * @productversion FlexJS 0.0 + */ + public function getQualifiedSuperclassName(value:*):String + { + COMPILE::AS3 + { + return flash.utils.getQualifiedSuperclassName(value); + } + COMPILE::JS + { + var constructorAsObject:Object = value["constructor"]; + value = constructorAsObject.superClass_; + if (value == null || value.FLEXJS_CLASS_INFO == null) + return null; + return value.FLEXJS_CLASS_INFO.names[0].qName; + } + } +} http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3c6af711/frameworks/projects/Reflection/src/main/resources/compile-asjs-config.xml ---------------------------------------------------------------------- diff --git a/frameworks/projects/Reflection/src/main/resources/compile-asjs-config.xml b/frameworks/projects/Reflection/src/main/resources/compile-asjs-config.xml new file mode 100644 index 0000000..92f5a0f --- /dev/null +++ b/frameworks/projects/Reflection/src/main/resources/compile-asjs-config.xml @@ -0,0 +1,77 @@ +<!-- + + 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. + +--> +<flex-config> + + <compiler> + <accessible>false</accessible> + + <external-library-path> + </external-library-path> + + <mxml> + <children-as-data>true</children-as-data> + </mxml> + <binding-value-change-event>org.apache.flex.events.ValueChangeEvent</binding-value-change-event> + <binding-value-change-event-kind>org.apache.flex.events.ValueChangeEvent</binding-value-change-event-kind> + <binding-value-change-event-type>valueChange</binding-value-change-event-type> + + <keep-as3-metadata> + <name>Bindable</name> + <name>Managed</name> + <name>ChangeEvent</name> + <name>NonCommittingChangeEvent</name> + <name>Transient</name> + </keep-as3-metadata> + + <locale/> + + <library-path> + <!-- asjscompc won't 'link' these classes in, but will list their requires + if these swcs are on the external-library-path then their requires + will not be listed --> + <path-element>../../externs/Core.swc</path-element> + </library-path> + + <namespaces> + </namespaces> + + <source-path> + <path-element>as/src</path-element> + </source-path> + + <warn-no-constructor>false</warn-no-constructor> + </compiler> + + <include-file> + </include-file> + + <include-sources> + <path-element>as/src</path-element> + </include-sources> + + <include-classes> + </include-classes> + + <include-namespaces> + </include-namespaces> + + <target-player>${playerglobal.version}</target-player> + + +</flex-config> http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/3c6af711/frameworks/projects/Reflection/src/main/resources/compile-config.xml ---------------------------------------------------------------------- diff --git a/frameworks/projects/Reflection/src/main/resources/compile-config.xml b/frameworks/projects/Reflection/src/main/resources/compile-config.xml new file mode 100644 index 0000000..e02f6b2 --- /dev/null +++ b/frameworks/projects/Reflection/src/main/resources/compile-config.xml @@ -0,0 +1,73 @@ +<!-- + + 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. + +--> +<flex-config> + + <compiler> + <accessible>false</accessible> + + <external-library-path> + <path-element>${env.AIR_HOME}/frameworks/libs/air/airglobal.swc</path-element> + <path-element>../../libs/Core.swc</path-element> + </external-library-path> + + <mxml> + <children-as-data>true</children-as-data> + </mxml> + <binding-value-change-event>org.apache.flex.events.ValueChangeEvent</binding-value-change-event> + <binding-value-change-event-kind>org.apache.flex.events.ValueChangeEvent</binding-value-change-event-kind> + <binding-value-change-event-type>valueChange</binding-value-change-event-type> + + <keep-as3-metadata> + <name>Bindable</name> + <name>Managed</name> + <name>ChangeEvent</name> + <name>NonCommittingChangeEvent</name> + <name>Transient</name> + </keep-as3-metadata> + + <locale/> + + <library-path/> + + <namespaces> + </namespaces> + + <source-path> + <path-element>as/src</path-element> + </source-path> + + <warn-no-constructor>false</warn-no-constructor> + </compiler> + + <include-file> + <name>js/out/*</name> + <path>js/out/*</path> + </include-file> + + <include-sources> + <path-element>as/src</path-element> + </include-sources> + + <include-namespaces> + </include-namespaces> + + <target-player>${playerglobal.version}</target-player> + + +</flex-config>