when metadata and object definitions are both used for a class, the
object definition takes precedence. That way a developer can override
the behavior defined in the [Autowired] metadata by defining a
property in the object definition.
so this code:
var unclaimedProperties:Array =
getUnclaimedSimpleObjectProperties(object, objectDefinition);
for each (var field:Field in unclaimedProperties) {
if (field.hasMetaData(AUTOWIRED_ANNOTATION)) {
}
}
Will first check if any properties have been defined in the object
definition, filters these out of the list and then returns the list of
all the remaining fields. Then in the next loop each field is
examinied for the existence of the [Autowired] metadata
((field.hasMetaData(AUTOWIRED_ANNOTATION)) and will be processed
accordingly.
Hope that makes sense :)
cheers,
Roland
> --
> You received this message because you are subscribed to the Google
> Groups "springactionscript-dev" group.
> To post to this group, send email to springactio...@googlegroups.com.
> To unsubscribe from this group, send email to
> springactionscrip...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/springactionscript-dev?hl=en.
>
>
and feel free to question every line of code you stumble upon, I'm
happy to bring you up to speed and an extra code review never hurt
anyone, should you unearth any bugs this way, it'll be an added bonus
for us :) Less bugs, yea! hehe
Roland
for (i = 0; i < numVariables; i++) {
variable = type.variables[i];
if (!variable.isStatic && ((objectDefinition != null) &&
(objectDefinition.properties[variable.name] === undefined))) {
result.push(variable);
}
}
var accessor:Accessor;
for (i = 0; i < type.accessors.length; i++) {
accessor = type.accessors[i];
if ((accessor.access == AccessorAccess.WRITE_ONLY || accessor.access
== AccessorAccess.READ_WRITE) && !accessor.isStatic &&
((objectDefinition != null) &&
(objectDefinition.properties[accessor.name] === undefined))) {
result.push(accessor);
}
}
I assume the purpose of the object definition conditions in those two
if statements is to filter out properties that exist in the object
definition, but only if the object definition exists. However, since
the object definition is null in this case, the code inside the if
block is never processed.
cheers,
Roland
I committed this fix also on the trunk since it was only fixed on the
branch.
Please make sure to run the tests on the trunk and only commit your
changes if all tests have passed.
regards,
Christophe