Hi Yishay,

No I don't think so. I think you can use some filtering options in a
replacer function in conjunction with stringify. AMF has something similar
for filtering or altering dynamic properties.

The longer term solution for this is to have a better implementation for
namespaces, and to make private members non-enumerable for example, imo.
But I think using a replacer function with some checks against reflection
data would probably be best for now. Maybe there is already something for
that - I know Alex has done some work on JSON serialization already.




On Fri, Mar 29, 2019 at 7:51 AM Yishay Weiss <yishayj...@hotmail.com> wrote:

> Hi Greg,
>
>
>
> I’m referring to Olaf’s issue [1] with JSON.stringify() using the
> qualified property names. Could a class alias change the qualification
> prefix?
>
>
>
> [1]
> http://apache-royale-development.20373.n8.nabble.com/Plain-public-variables-complain-they-don-t-have-getters-setters-Was-CreationComplete-event-question-tp9337p9353.html
>
>
>
> ________________________________
> From: Greg Dove <greg.d...@gmail.com>
> Sent: Thursday, March 28, 2019 8:28:18 PM
> To: dev@royale.apache.org
> Subject: Re: Plain public variables complain they don't have getters /
> setters (Was "CreationComplete event question")
>
> 'I’m wondering if registerClassAlias or the RemoteClass meta-tag would
> solve this. Anyone know?'
>
> The issue with public car renaming?
>
> I can't see how it could.
> But reflection classes now support it (you can get and set public var
> values in release mode via reflection) and AMF works with public vars too.
>
> On Fri, 29 Mar 2019, 07:20 Yishay Weiss, <yishayj...@hotmail.com> wrote:
>
> > I’m wondering if registerClassAlias or the RemoteClass meta-tag would
> > solve this. Anyone know?
> >
> >
> >
> > ________________________________
> > From: Harbs <harbs.li...@gmail.com>
> > Sent: Thursday, March 28, 2019 3:03:46 PM
> > To: dev@royale.apache.org
> > Subject: Re: Plain public variables complain they don't have getters /
> > setters (Was "CreationComplete event question")
> >
> > FWIW, I use a method to convert classes to JSON which allows me to define
> > exactly which properties get written and using what names.
> >
> > i.e. myFoo.toData()
> >
> > > On Mar 28, 2019, at 1:26 PM, Olaf Krueger <m...@olafkrueger.net>
> wrote:
> > >
> > > I would just like to mention that resolving this "public vars" issue by
> > > replacing the public by private vars with getters/setters has a side
> > effect:
> > > JSON.stringify() stringifies all getters with the entire package name
> > which
> > > makes the JSON representation unusable [1].
> > >
> > > [1]
> > > package com.mydomain.myapp.model.vo
> > > {
> > >    public class MyVO
> > >    {
> > >        private var _foo:String = "bar";
> > >
> > >        public function get foo():String
> > >        {
> > >             return this._foo;
> > >        }
> > >    }
> > > }
> > >
> > > Becomes:
> > > {
> > >    "com.mydomain.myapp.model.vo.foo":"bar";
> > > }
> > >
> > >
> > >
> > >
> > >
> > > --
> > > Sent from: http://apache-royale-development.20373.n8.nabble.com/
> >
> >
>

Reply via email to