You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by Erik de Bruin <er...@ixsoftware.nl> on 2013/11/05 14:42:33 UTC

[FLEXJS] describeType

Hi,

flash.utils.describeType has an XML return type. JavaScript doesn't
have anything like that and I'm sure we don't want to simulate it for
the purpose of this exercise.

I suggest we create a utility class
"org.apache.flex.utils.DescribeType" and put some static methods on it
that allow us to get tailored introspection... Maybe start with
'DescribeType.getMetaData(value:*)'?

What metadata are you thinking of, specifically?

EdB



-- 
Ix Multimedia Software

Jan Luykenstraat 27
3521 VB Utrecht

T. 06-51952295
I. www.ixsoftware.nl

Re: [FLEXJS] describeType

Posted by Roland Zwaga <ro...@stackandheap.com>.
Or check out these as3-reflect classes:
https://code.google.com/p/as3-commons/source/browse/trunk/as3-commons-reflect/src/main/actionscript/org/as3commons/reflect/JSONTypeProvider.as
and
https://code.google.com/p/as3-commons/source/browse/trunk/as3-commons-lang/src/main/actionscript/org/as3commons/lang/typedescription/JSONTypeDescription.as
Both being used to create the as3-reflect types...

Roland


On 5 November 2013 19:05, Maurice Amsellem <ma...@systar.com>wrote:

> I confirm, it's avmplus.describeTypeJSON()
>
> This is a typical use:
>
>   typeInfo = avmplus. describeTypeJSON (cls, avmplus.INCLUDE_BASES
>                        | avmplus.INCLUDE_INTERFACES
>                        | avmplus.INCLUDE_VARIABLES
>                        | avmplus.INCLUDE_ACCESSORS
>                        | avmplus.INCLUDE_METHODS
>                        | avmplus.INCLUDE_METADATA
>                        | avmplus.INCLUDE_CONSTRUCTOR
>                       |avmplus.INCLUDE_TRAITS);
>
> And it will return an object with dynamic properties...
>
> Maurice
>
> -----Message d'origine-----
> De : Alex Harui [mailto:aharui@adobe.com]
> Envoyé : mardi 5 novembre 2013 19:03
> À : dev@flex.apache.org
> Objet : Re: [FLEXJS] describeType
>
> Told you it was under-documented ;-). The secret handshake is apparently
> to ignore autocomplete and use google.  Looks like it is
> avmplus.describeTypeJSON().  I've not used it, but there was a recent
> thread about it.
>
> On 11/5/13 9:54 AM, "Erik de Bruin" <er...@ixsoftware.nl> wrote:
>
> >My FlashBuilder's autocomplete is not aware of such a method. Any
> >secret handshakes I should be aware of to activate it?
> >
> >EdB
> >
> >
> >
> >On Tue, Nov 5, 2013 at 6:32 PM, Alex Harui <ah...@adobe.com> wrote:
> >> Apparently, there is a under-documented describeTypeJSON which I
> >>think the  application frameworks are using to get any and all
> >>metadata on a class  and its methods because it is much faster than
> >>regular describeType.
> >> Maybe we should do that.
> >>
> >> -Alex
> >>
> >> On 11/5/13 5:42 AM, "Erik de Bruin" <er...@ixsoftware.nl> wrote:
> >>
> >>>Hi,
> >>>
> >>>flash.utils.describeType has an XML return type. JavaScript doesn't
> >>>have anything like that and I'm sure we don't want to simulate it for
> >>>the purpose of this exercise.
> >>>
> >>>I suggest we create a utility class
> >>>"org.apache.flex.utils.DescribeType" and put some static methods on
> >>>it that allow us to get tailored introspection... Maybe start with
> >>>'DescribeType.getMetaData(value:*)'?
> >>>
> >>>What metadata are you thinking of, specifically?
> >>>
> >>>EdB
> >>>
> >>>
> >>>
> >>>--
> >>>Ix Multimedia Software
> >>>
> >>>Jan Luykenstraat 27
> >>>3521 VB Utrecht
> >>>
> >>>T. 06-51952295
> >>>I. www.ixsoftware.nl
> >>
> >
> >
> >
> >--
> >Ix Multimedia Software
> >
> >Jan Luykenstraat 27
> >3521 VB Utrecht
> >
> >T. 06-51952295
> >I. www.ixsoftware.nl
>
>


-- 
regards,
Roland

-- 
Roland Zwaga
Senior Consultant | Stack & Heap BVBA

+32 (0)486 16 12 62 | roland@stackandheap.com | http://www.stackandheap.com

http://randoriframework.com
http://zwaga.blogspot.com
http://www.springactionscript.org
http://www.as3commons.org

RE: [FLEXJS] describeType

Posted by Maurice Amsellem <ma...@systar.com>.
I confirm, it's avmplus.describeTypeJSON() 

This is a typical use:

  typeInfo = avmplus. describeTypeJSON (cls, avmplus.INCLUDE_BASES
                       | avmplus.INCLUDE_INTERFACES
                       | avmplus.INCLUDE_VARIABLES
                       | avmplus.INCLUDE_ACCESSORS
                       | avmplus.INCLUDE_METHODS
                       | avmplus.INCLUDE_METADATA
                       | avmplus.INCLUDE_CONSTRUCTOR
                      |avmplus.INCLUDE_TRAITS);

And it will return an object with dynamic properties...

Maurice 

-----Message d'origine-----
De : Alex Harui [mailto:aharui@adobe.com] 
Envoyé : mardi 5 novembre 2013 19:03
À : dev@flex.apache.org
Objet : Re: [FLEXJS] describeType

Told you it was under-documented ;-). The secret handshake is apparently to ignore autocomplete and use google.  Looks like it is avmplus.describeTypeJSON().  I've not used it, but there was a recent thread about it.

On 11/5/13 9:54 AM, "Erik de Bruin" <er...@ixsoftware.nl> wrote:

>My FlashBuilder's autocomplete is not aware of such a method. Any 
>secret handshakes I should be aware of to activate it?
>
>EdB
>
>
>
>On Tue, Nov 5, 2013 at 6:32 PM, Alex Harui <ah...@adobe.com> wrote:
>> Apparently, there is a under-documented describeTypeJSON which I 
>>think the  application frameworks are using to get any and all 
>>metadata on a class  and its methods because it is much faster than 
>>regular describeType.
>> Maybe we should do that.
>>
>> -Alex
>>
>> On 11/5/13 5:42 AM, "Erik de Bruin" <er...@ixsoftware.nl> wrote:
>>
>>>Hi,
>>>
>>>flash.utils.describeType has an XML return type. JavaScript doesn't 
>>>have anything like that and I'm sure we don't want to simulate it for 
>>>the purpose of this exercise.
>>>
>>>I suggest we create a utility class
>>>"org.apache.flex.utils.DescribeType" and put some static methods on 
>>>it that allow us to get tailored introspection... Maybe start with 
>>>'DescribeType.getMetaData(value:*)'?
>>>
>>>What metadata are you thinking of, specifically?
>>>
>>>EdB
>>>
>>>
>>>
>>>--
>>>Ix Multimedia Software
>>>
>>>Jan Luykenstraat 27
>>>3521 VB Utrecht
>>>
>>>T. 06-51952295
>>>I. www.ixsoftware.nl
>>
>
>
>
>--
>Ix Multimedia Software
>
>Jan Luykenstraat 27
>3521 VB Utrecht
>
>T. 06-51952295
>I. www.ixsoftware.nl


Re: [FLEXJS] describeType

Posted by Erik de Bruin <er...@ixsoftware.nl>.
In my experience an 'undocumented' API means: liable to change without
notice in the next update.

At a higher level... I think we've got other things to do before we
even think about supporting AS frameworks that have low level hooks
into the original SDK.

EdB



On Tue, Nov 5, 2013 at 8:43 PM, Alex Harui <ah...@adobe.com> wrote:
> Not sure I understand.  Lots of Flex wraps playerglobal.swc.  Is it just
> the fact that it is undocumented?
>
> At a higher level, goal is to try to see what it would take to support the
> popular app frameworks like Parsley and Swiz in JS.  Maybe the first step
> is to just try it and see what its dependencies are.
>
> -Alex
>
> On 11/5/13 11:22 AM, "Erik de Bruin" <er...@ixsoftware.nl> wrote:
>
>>Wow.
>>
>>Getting this to work involves creating a wrapper class around an
>>undocumented method in playerglobal.swc, which is not under our
>>control.
>>
>>That doesn't sound like a sustainable way forward :-(
>>
>>EdB
>>
>>
>>
>>On Tue, Nov 5, 2013 at 7:02 PM, Alex Harui <ah...@adobe.com> wrote:
>>> Told you it was under-documented ;-). The secret handshake is apparently
>>> to ignore autocomplete and use google.  Looks like it is
>>> avmplus.describeTypeJSON().  I've not used it, but there was a recent
>>> thread about it.
>>>
>>> On 11/5/13 9:54 AM, "Erik de Bruin" <er...@ixsoftware.nl> wrote:
>>>
>>>>My FlashBuilder's autocomplete is not aware of such a method. Any
>>>>secret handshakes I should be aware of to activate it?
>>>>
>>>>EdB
>>>>
>>>>
>>>>
>>>>On Tue, Nov 5, 2013 at 6:32 PM, Alex Harui <ah...@adobe.com> wrote:
>>>>> Apparently, there is a under-documented describeTypeJSON which I think
>>>>>the
>>>>> application frameworks are using to get any and all metadata on a
>>>>>class
>>>>> and its methods because it is much faster than regular describeType.
>>>>> Maybe we should do that.
>>>>>
>>>>> -Alex
>>>>>
>>>>> On 11/5/13 5:42 AM, "Erik de Bruin" <er...@ixsoftware.nl> wrote:
>>>>>
>>>>>>Hi,
>>>>>>
>>>>>>flash.utils.describeType has an XML return type. JavaScript doesn't
>>>>>>have anything like that and I'm sure we don't want to simulate it for
>>>>>>the purpose of this exercise.
>>>>>>
>>>>>>I suggest we create a utility class
>>>>>>"org.apache.flex.utils.DescribeType" and put some static methods on it
>>>>>>that allow us to get tailored introspection... Maybe start with
>>>>>>'DescribeType.getMetaData(value:*)'?
>>>>>>
>>>>>>What metadata are you thinking of, specifically?
>>>>>>
>>>>>>EdB
>>>>>>
>>>>>>
>>>>>>
>>>>>>--
>>>>>>Ix Multimedia Software
>>>>>>
>>>>>>Jan Luykenstraat 27
>>>>>>3521 VB Utrecht
>>>>>>
>>>>>>T. 06-51952295
>>>>>>I. www.ixsoftware.nl
>>>>>
>>>>
>>>>
>>>>
>>>>--
>>>>Ix Multimedia Software
>>>>
>>>>Jan Luykenstraat 27
>>>>3521 VB Utrecht
>>>>
>>>>T. 06-51952295
>>>>I. www.ixsoftware.nl
>>>
>>
>>
>>
>>--
>>Ix Multimedia Software
>>
>>Jan Luykenstraat 27
>>3521 VB Utrecht
>>
>>T. 06-51952295
>>I. www.ixsoftware.nl
>



-- 
Ix Multimedia Software

Jan Luykenstraat 27
3521 VB Utrecht

T. 06-51952295
I. www.ixsoftware.nl

RE: [FLEXJS] describeType

Posted by Maurice Amsellem <ma...@systar.com>.
That's also the way it's implemented in Parsley, but the wrapper class can be very simple:

[from parsley]
package avmplus {

public class DescribeTypeJSONAccessor {
			
	public static function get functionRef () : Function {
		try {
			return describeTypeJSON;
		}
		catch (e:Error) {
		}
		return null;
	}

But its really worth using  compared to describeType:
- faster
- much less memory
- can extract only the needed information, thanks to flags arguments

-----Message d'origine-----
De : Erik de Bruin [mailto:erik@ixsoftware.nl] 
Envoyé : mardi 5 novembre 2013 20:22
À : dev@flex.apache.org
Objet : Re: [FLEXJS] describeType

Wow.

Getting this to work involves creating a wrapper class around an undocumented method in playerglobal.swc, which is not under our control.

That doesn't sound like a sustainable way forward :-(

EdB



On Tue, Nov 5, 2013 at 7:02 PM, Alex Harui <ah...@adobe.com> wrote:
> Told you it was under-documented ;-). The secret handshake is 
> apparently to ignore autocomplete and use google.  Looks like it is 
> avmplus.describeTypeJSON().  I've not used it, but there was a recent 
> thread about it.
>
> On 11/5/13 9:54 AM, "Erik de Bruin" <er...@ixsoftware.nl> wrote:
>
>>My FlashBuilder's autocomplete is not aware of such a method. Any 
>>secret handshakes I should be aware of to activate it?
>>
>>EdB
>>
>>
>>
>>On Tue, Nov 5, 2013 at 6:32 PM, Alex Harui <ah...@adobe.com> wrote:
>>> Apparently, there is a under-documented describeTypeJSON which I 
>>>think the  application frameworks are using to get any and all 
>>>metadata on a class  and its methods because it is much faster than 
>>>regular describeType.
>>> Maybe we should do that.
>>>
>>> -Alex
>>>
>>> On 11/5/13 5:42 AM, "Erik de Bruin" <er...@ixsoftware.nl> wrote:
>>>
>>>>Hi,
>>>>
>>>>flash.utils.describeType has an XML return type. JavaScript doesn't 
>>>>have anything like that and I'm sure we don't want to simulate it 
>>>>for the purpose of this exercise.
>>>>
>>>>I suggest we create a utility class
>>>>"org.apache.flex.utils.DescribeType" and put some static methods on 
>>>>it that allow us to get tailored introspection... Maybe start with 
>>>>'DescribeType.getMetaData(value:*)'?
>>>>
>>>>What metadata are you thinking of, specifically?
>>>>
>>>>EdB
>>>>
>>>>
>>>>
>>>>--
>>>>Ix Multimedia Software
>>>>
>>>>Jan Luykenstraat 27
>>>>3521 VB Utrecht
>>>>
>>>>T. 06-51952295
>>>>I. www.ixsoftware.nl
>>>
>>
>>
>>
>>--
>>Ix Multimedia Software
>>
>>Jan Luykenstraat 27
>>3521 VB Utrecht
>>
>>T. 06-51952295
>>I. www.ixsoftware.nl
>



--
Ix Multimedia Software

Jan Luykenstraat 27
3521 VB Utrecht

T. 06-51952295
I. www.ixsoftware.nl

Re: [FLEXJS] describeType

Posted by Alex Harui <ah...@adobe.com>.
Not sure I understand.  Lots of Flex wraps playerglobal.swc.  Is it just
the fact that it is undocumented?

At a higher level, goal is to try to see what it would take to support the
popular app frameworks like Parsley and Swiz in JS.  Maybe the first step
is to just try it and see what its dependencies are.

-Alex

On 11/5/13 11:22 AM, "Erik de Bruin" <er...@ixsoftware.nl> wrote:

>Wow.
>
>Getting this to work involves creating a wrapper class around an
>undocumented method in playerglobal.swc, which is not under our
>control.
>
>That doesn't sound like a sustainable way forward :-(
>
>EdB
>
>
>
>On Tue, Nov 5, 2013 at 7:02 PM, Alex Harui <ah...@adobe.com> wrote:
>> Told you it was under-documented ;-). The secret handshake is apparently
>> to ignore autocomplete and use google.  Looks like it is
>> avmplus.describeTypeJSON().  I've not used it, but there was a recent
>> thread about it.
>>
>> On 11/5/13 9:54 AM, "Erik de Bruin" <er...@ixsoftware.nl> wrote:
>>
>>>My FlashBuilder's autocomplete is not aware of such a method. Any
>>>secret handshakes I should be aware of to activate it?
>>>
>>>EdB
>>>
>>>
>>>
>>>On Tue, Nov 5, 2013 at 6:32 PM, Alex Harui <ah...@adobe.com> wrote:
>>>> Apparently, there is a under-documented describeTypeJSON which I think
>>>>the
>>>> application frameworks are using to get any and all metadata on a
>>>>class
>>>> and its methods because it is much faster than regular describeType.
>>>> Maybe we should do that.
>>>>
>>>> -Alex
>>>>
>>>> On 11/5/13 5:42 AM, "Erik de Bruin" <er...@ixsoftware.nl> wrote:
>>>>
>>>>>Hi,
>>>>>
>>>>>flash.utils.describeType has an XML return type. JavaScript doesn't
>>>>>have anything like that and I'm sure we don't want to simulate it for
>>>>>the purpose of this exercise.
>>>>>
>>>>>I suggest we create a utility class
>>>>>"org.apache.flex.utils.DescribeType" and put some static methods on it
>>>>>that allow us to get tailored introspection... Maybe start with
>>>>>'DescribeType.getMetaData(value:*)'?
>>>>>
>>>>>What metadata are you thinking of, specifically?
>>>>>
>>>>>EdB
>>>>>
>>>>>
>>>>>
>>>>>--
>>>>>Ix Multimedia Software
>>>>>
>>>>>Jan Luykenstraat 27
>>>>>3521 VB Utrecht
>>>>>
>>>>>T. 06-51952295
>>>>>I. www.ixsoftware.nl
>>>>
>>>
>>>
>>>
>>>--
>>>Ix Multimedia Software
>>>
>>>Jan Luykenstraat 27
>>>3521 VB Utrecht
>>>
>>>T. 06-51952295
>>>I. www.ixsoftware.nl
>>
>
>
>
>-- 
>Ix Multimedia Software
>
>Jan Luykenstraat 27
>3521 VB Utrecht
>
>T. 06-51952295
>I. www.ixsoftware.nl


Re: [FLEXJS] describeType

Posted by Erik de Bruin <er...@ixsoftware.nl>.
Wow.

Getting this to work involves creating a wrapper class around an
undocumented method in playerglobal.swc, which is not under our
control.

That doesn't sound like a sustainable way forward :-(

EdB



On Tue, Nov 5, 2013 at 7:02 PM, Alex Harui <ah...@adobe.com> wrote:
> Told you it was under-documented ;-). The secret handshake is apparently
> to ignore autocomplete and use google.  Looks like it is
> avmplus.describeTypeJSON().  I've not used it, but there was a recent
> thread about it.
>
> On 11/5/13 9:54 AM, "Erik de Bruin" <er...@ixsoftware.nl> wrote:
>
>>My FlashBuilder's autocomplete is not aware of such a method. Any
>>secret handshakes I should be aware of to activate it?
>>
>>EdB
>>
>>
>>
>>On Tue, Nov 5, 2013 at 6:32 PM, Alex Harui <ah...@adobe.com> wrote:
>>> Apparently, there is a under-documented describeTypeJSON which I think
>>>the
>>> application frameworks are using to get any and all metadata on a class
>>> and its methods because it is much faster than regular describeType.
>>> Maybe we should do that.
>>>
>>> -Alex
>>>
>>> On 11/5/13 5:42 AM, "Erik de Bruin" <er...@ixsoftware.nl> wrote:
>>>
>>>>Hi,
>>>>
>>>>flash.utils.describeType has an XML return type. JavaScript doesn't
>>>>have anything like that and I'm sure we don't want to simulate it for
>>>>the purpose of this exercise.
>>>>
>>>>I suggest we create a utility class
>>>>"org.apache.flex.utils.DescribeType" and put some static methods on it
>>>>that allow us to get tailored introspection... Maybe start with
>>>>'DescribeType.getMetaData(value:*)'?
>>>>
>>>>What metadata are you thinking of, specifically?
>>>>
>>>>EdB
>>>>
>>>>
>>>>
>>>>--
>>>>Ix Multimedia Software
>>>>
>>>>Jan Luykenstraat 27
>>>>3521 VB Utrecht
>>>>
>>>>T. 06-51952295
>>>>I. www.ixsoftware.nl
>>>
>>
>>
>>
>>--
>>Ix Multimedia Software
>>
>>Jan Luykenstraat 27
>>3521 VB Utrecht
>>
>>T. 06-51952295
>>I. www.ixsoftware.nl
>



-- 
Ix Multimedia Software

Jan Luykenstraat 27
3521 VB Utrecht

T. 06-51952295
I. www.ixsoftware.nl

Re: [FLEXJS] describeType

Posted by Alex Harui <ah...@adobe.com>.
Told you it was under-documented ;-). The secret handshake is apparently
to ignore autocomplete and use google.  Looks like it is
avmplus.describeTypeJSON().  I've not used it, but there was a recent
thread about it.

On 11/5/13 9:54 AM, "Erik de Bruin" <er...@ixsoftware.nl> wrote:

>My FlashBuilder's autocomplete is not aware of such a method. Any
>secret handshakes I should be aware of to activate it?
>
>EdB
>
>
>
>On Tue, Nov 5, 2013 at 6:32 PM, Alex Harui <ah...@adobe.com> wrote:
>> Apparently, there is a under-documented describeTypeJSON which I think
>>the
>> application frameworks are using to get any and all metadata on a class
>> and its methods because it is much faster than regular describeType.
>> Maybe we should do that.
>>
>> -Alex
>>
>> On 11/5/13 5:42 AM, "Erik de Bruin" <er...@ixsoftware.nl> wrote:
>>
>>>Hi,
>>>
>>>flash.utils.describeType has an XML return type. JavaScript doesn't
>>>have anything like that and I'm sure we don't want to simulate it for
>>>the purpose of this exercise.
>>>
>>>I suggest we create a utility class
>>>"org.apache.flex.utils.DescribeType" and put some static methods on it
>>>that allow us to get tailored introspection... Maybe start with
>>>'DescribeType.getMetaData(value:*)'?
>>>
>>>What metadata are you thinking of, specifically?
>>>
>>>EdB
>>>
>>>
>>>
>>>--
>>>Ix Multimedia Software
>>>
>>>Jan Luykenstraat 27
>>>3521 VB Utrecht
>>>
>>>T. 06-51952295
>>>I. www.ixsoftware.nl
>>
>
>
>
>-- 
>Ix Multimedia Software
>
>Jan Luykenstraat 27
>3521 VB Utrecht
>
>T. 06-51952295
>I. www.ixsoftware.nl


Re: [FLEXJS] describeType

Posted by Erik de Bruin <er...@ixsoftware.nl>.
My FlashBuilder's autocomplete is not aware of such a method. Any
secret handshakes I should be aware of to activate it?

EdB



On Tue, Nov 5, 2013 at 6:32 PM, Alex Harui <ah...@adobe.com> wrote:
> Apparently, there is a under-documented describeTypeJSON which I think the
> application frameworks are using to get any and all metadata on a class
> and its methods because it is much faster than regular describeType.
> Maybe we should do that.
>
> -Alex
>
> On 11/5/13 5:42 AM, "Erik de Bruin" <er...@ixsoftware.nl> wrote:
>
>>Hi,
>>
>>flash.utils.describeType has an XML return type. JavaScript doesn't
>>have anything like that and I'm sure we don't want to simulate it for
>>the purpose of this exercise.
>>
>>I suggest we create a utility class
>>"org.apache.flex.utils.DescribeType" and put some static methods on it
>>that allow us to get tailored introspection... Maybe start with
>>'DescribeType.getMetaData(value:*)'?
>>
>>What metadata are you thinking of, specifically?
>>
>>EdB
>>
>>
>>
>>--
>>Ix Multimedia Software
>>
>>Jan Luykenstraat 27
>>3521 VB Utrecht
>>
>>T. 06-51952295
>>I. www.ixsoftware.nl
>



-- 
Ix Multimedia Software

Jan Luykenstraat 27
3521 VB Utrecht

T. 06-51952295
I. www.ixsoftware.nl

Re: [FLEXJS] describeType

Posted by Alex Harui <ah...@adobe.com>.
Apparently, there is a under-documented describeTypeJSON which I think the
application frameworks are using to get any and all metadata on a class
and its methods because it is much faster than regular describeType.
Maybe we should do that.

-Alex

On 11/5/13 5:42 AM, "Erik de Bruin" <er...@ixsoftware.nl> wrote:

>Hi,
>
>flash.utils.describeType has an XML return type. JavaScript doesn't
>have anything like that and I'm sure we don't want to simulate it for
>the purpose of this exercise.
>
>I suggest we create a utility class
>"org.apache.flex.utils.DescribeType" and put some static methods on it
>that allow us to get tailored introspection... Maybe start with
>'DescribeType.getMetaData(value:*)'?
>
>What metadata are you thinking of, specifically?
>
>EdB
>
>
>
>-- 
>Ix Multimedia Software
>
>Jan Luykenstraat 27
>3521 VB Utrecht
>
>T. 06-51952295
>I. www.ixsoftware.nl