Skip to main content
brian_thomas2
Adobe Employee
Adobe Employee
July 28, 2009
Answered

MetadataUtils

  • July 28, 2009
  • 1 reply
  • 1661 views

I am using Flex Gumbo & the FlexUnit 4 beta 1.0 release and have a question about using the flex.lang.reflect.utils.MetadataTools methods. The methods will not work if you directly pass in the result of the describeType() call. It seems like they are expecting a different XML format, as they will work as I expect if I pass xmlTypeDescription.factory instead. Is this expected? Sending only the factory child is an acceptable workaround, but doesn't seem very intuitive.

The two methods I am currently using:

MetadataTools.nodeHasMetaData()

MetadataTools.getMethodsList()

Thanks!

Brian

This topic has been closed for replies.
Correct answer mlabriola

Brian,

It is because that factory node does or does not exist depending upon if you are describing an instance or a class. The tools force you to send in that node as they were more of an internal tool, and I didn't really expect people to be using those as much directly.

Not sure if we will change or alter that interface going forward,

Mike

1 reply

mlabriolaCorrect answer
Participating Frequently
July 28, 2009

Brian,

It is because that factory node does or does not exist depending upon if you are describing an instance or a class. The tools force you to send in that node as they were more of an internal tool, and I didn't really expect people to be using those as much directly.

Not sure if we will change or alter that interface going forward,

Mike

brian_thomas2
Adobe Employee
Adobe Employee
July 28, 2009

Perhaps I was snooping around deeper than I should have been - but it has saved me time in reading metadata and building my own tree view for tests. Is the intention for flex.lang.reflect be used internally as a whole, or should I be approaching the problem using Klass, Method, etc?

Much appreciated!

Brian

Participating Frequently
July 28, 2009

Snoop at will Just means you might see some of the less polished stuff behind the curtain.

Not knowing your exact situation, my intent was for people to use Klass where possible and then, of course, the subsequent objects such as constructor, method, field, etc. underneath there.

If you are finding useful stuff in metadata tools though, that is great. Just might have to deal with little things like the factory node. Quick side note, the klass and other classes also server as a place to work around some known bugs in DescribeTypeCache and issues with getting constructor information.

Mike