Thanks for your answer Patrik. And sorry as I'was not clear with my
questions.
I write a template like this:
==================================================
«AROUND *::domainObject FOR DomainObject»
«targetDef.proceed()»
«IF metaType == ValueObject»
«FILE "lcds/"+getDomainPackage().replaceAll("\\.",
"/")+"/"+name+".as"»
package «getDomainPackage()»
{
«FOREACH attributes AS a»«importMapper(a)»«ENDFOREACH»
...
public class «name» «getExtendList()» {
«FOREACH attributes AS a»
private «name»:«sculptorToASTypeMapper(a)»;
...
«ENDFOREACH»
...
}
}
}
«ENDFILE»
«ENDIF»
«ENDAROUND»
=================================================
1. Now, in the sculptorToASTypeMapper() function of ext I want to identify
whether attribute.type is an enum or not. How to do that?
2. And in importMapper(a) function of ext I want to add the import statement
for the attribute.type if that is not already added. Is there any way to do
that?
On Fri, Apr 3, 2009 at 12:27 AM, Patrik Nordwall
<[email protected]>wrote:
>
>
>
> arpan wrote:
> >
> > I’m trying to generate some Action Scripts VO files from Sculptor (for
> > each
> > ValueObject).
> >
> > I wrote an xpt template and one extension code for this.
> >
> > But I faced two issues regarding this:
> >
> > 1. If there is Enum as attribute type of a value-object I need to
> > convert
> > it to String in AS. But I’m not being able to identify the type as
> > Enum.
> > (apart from normal types, attribute type can be of another value
> > object
> > or enum, which I am not being able to differentiate. isEnum function
> is
> > not
> > available for attribute)
> >
>
> I don't understand the question/problem. Please describe an example or
> something. Are we talking about ValueObject, Enum, Attribute in the
> Sculptor
> meta model?
>
>
> arpan wrote:
> >
> > 2. For each non primitive type I need to write an import statement in
> > AS.
> > But if there are two attributes of same type, the same import
> statement
> > appears twice in AS.
> >
>
> When we generate java code we always use fully classified class names and
> then the java beautifier fix the imports. I don't know how to solve this
> with action script.
>
> Sorry, that was not much help. /Patrik
>
>
> --
> View this message in context:
> http://www.nabble.com/Attribute-Type-for-Value-Object-tp22833395s17564p22854773.html
> Sent from the Fornax-Platform mailing list archive at Nabble.com.
>
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Fornax-developer mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/fornax-developer
>
--
Regards,
Arpan
------------------------------------------------------------------------------
_______________________________________________
Fornax-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fornax-developer