예제 #1
0
		/* === (DE)SERIALIZATION === */
		
		/// <summary> Read the object from stream.</summary>
		//UPGRADE_TODO: Class 'java.io.DataInputStream' was converted to 'System.IO.BinaryReader' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javaioDataInputStream'"
		public virtual void  readExternal(System.IO.BinaryReader dis, PrototypeFactory pf)
		{
			fallbackDefaultLocale = ExtUtil.readBool(dis);
			fallbackDefaultForm = ExtUtil.readBool(dis);
			
			localeResources =(OrderedMap < String, List< LocaleDataSource >>) ExtUtil.read(dis, new ExtWrapMap(String.
		}
예제 #2
0
 public void readExternal(BinaryReader in_renamed, PrototypeFactory pf)
 {
     isLocalizable_ = ExtUtil.readBool(in_renamed);
     setLabelInnerText(ExtUtil.nullIfEmpty(ExtUtil.readString(in_renamed)));
     TextID = ExtUtil.nullIfEmpty(ExtUtil.readString(in_renamed));
     value  = ExtUtil.nullIfEmpty(ExtUtil.readString(in_renamed));
     //index will be set by questiondef
 }
예제 #3
0
 public void readExternal(BinaryReader in_renamed, PrototypeFactory pf)
 {
     nodesetRef   = (TreeReference)ExtUtil.read(in_renamed, typeof(TreeReference), pf);
     nodesetExpr  = (IConditionExpr)ExtUtil.read(in_renamed, new ExtWrapTagged(), pf);
     contextRef   = (TreeReference)ExtUtil.read(in_renamed, typeof(TreeReference), pf);
     labelRef     = (TreeReference)ExtUtil.read(in_renamed, typeof(TreeReference), pf);
     labelExpr    = (IConditionExpr)ExtUtil.read(in_renamed, new ExtWrapTagged(), pf);
     valueRef     = (TreeReference)ExtUtil.read(in_renamed, new ExtWrapNullable(typeof(TreeReference)), pf);
     valueExpr    = (IConditionExpr)ExtUtil.read(in_renamed, new ExtWrapNullable(new ExtWrapTagged()), pf);
     copyRef      = (TreeReference)ExtUtil.read(in_renamed, new ExtWrapNullable(typeof(TreeReference)), pf);
     labelIsItext = ExtUtil.readBool(in_renamed);
     copyMode     = ExtUtil.readBool(in_renamed);
 }
예제 #4
0
        /* === (DE)SERIALIZATION === */

        /**
         * Read the object from stream.
         */
        public void readExternal(System.IO.BinaryReader dis, PrototypeFactory pf)
        {
            fallbackDefaultLocale = ExtUtil.readBool(dis);
            fallbackDefaultForm   = ExtUtil.readBool(dis);
            localeResources       = (OrderedHashtable)ExtUtil.read(dis, new ExtWrapMap(typeof(String), new ExtWrapListPoly(), 1), pf);;
            locales = (ArrayList)ExtUtil.read(dis, new ExtWrapList(typeof(String)));
            setDefaultLocale((String)ExtUtil.read(dis, new ExtWrapNullable(typeof(String)), pf));
            String currentLocale = (String)ExtUtil.read(dis, new ExtWrapNullable(typeof(String)), pf);

            if (currentLocale != null)
            {
                Locale = currentLocale;
            }
        }
예제 #5
0
        /** Reads a group definition object from the supplied stream. */
        public void readExternal(BinaryReader dis, PrototypeFactory pf)
        {
            ID = ExtUtil.readInt(dis);
            setAppearanceAttr((String)ExtUtil.read(dis, new ExtWrapNullable(typeof(String)), pf));
            Bind           = (IDataReference)ExtUtil.read(dis, new ExtWrapTagged(), pf);
            TextID         = (String)ExtUtil.read(dis, new ExtWrapNullable(typeof(String)), pf);
            LabelInnerText = ((String)ExtUtil.read(dis, new ExtWrapNullable(typeof(String)), pf));
            Repeat         = (ExtUtil.readBool(dis));
            Children       = (List <IFormElement>)ExtUtil.read(dis, new ExtWrapListPoly(), pf);

            noAddRemove = ExtUtil.readBool(dis);
            count       = (IDataReference)ExtUtil.read(dis, new ExtWrapNullable(new ExtWrapTagged()), pf);

            chooseCaption    = ExtUtil.nullIfEmpty(ExtUtil.readString(dis));
            addCaption       = ExtUtil.nullIfEmpty(ExtUtil.readString(dis));
            delCaption       = ExtUtil.nullIfEmpty(ExtUtil.readString(dis));
            doneCaption      = ExtUtil.nullIfEmpty(ExtUtil.readString(dis));
            addEmptyCaption  = ExtUtil.nullIfEmpty(ExtUtil.readString(dis));
            doneEmptyCaption = ExtUtil.nullIfEmpty(ExtUtil.readString(dis));
            entryHeader      = ExtUtil.nullIfEmpty(ExtUtil.readString(dis));
            delHeader        = ExtUtil.nullIfEmpty(ExtUtil.readString(dis));
            mainHeader       = ExtUtil.nullIfEmpty(ExtUtil.readString(dis));
        }
예제 #6
0
        /* ==== SERIALIZATION ==== */

        /*
         * TODO:
         *
         * this new serialization scheme is kind of lame. ideally, we shouldn't have
         * to sub-class TreeElement at all; we should have an API that can
         * seamlessly represent complex data model objects (like weight history or
         * immunizations) as if they were explicity XML subtrees underneath the
         * parent TreeElement
         *
         * failing that, we should wrap this scheme in an ExternalizableWrapper
         */

        /*
         * (non-Javadoc)
         *
         * @see
         * org.javarosa.core.services.storage.utilities.Externalizable#readExternal
         * (java.io.DataInputStream)
         */
        public void readExternal(BinaryReader in_renamed, PrototypeFactory pf)
        {
            name         = ExtUtil.nullIfEmpty(ExtUtil.readString(in_renamed));
            multiplicity = ExtUtil.readInt(in_renamed);
            repeatable   = ExtUtil.readBool(in_renamed);
            value        = (IAnswerData)ExtUtil.read(in_renamed, new ExtWrapNullable(new ExtWrapTagged()), pf);

            // children = ExtUtil.nullIfEmpty((Vector)ExtUtil.read(in, new
            // ExtWrapList(TreeElement.class), pf));

            // Jan 22, 2009 - [email protected]
            // old line: children = ExtUtil.nullIfEmpty((Vector)ExtUtil.read(in, new
            // ExtWrapList(TreeElement.class), pf));
            // New Child deserialization
            // 1. read null status as boolean
            // 2. read number of children
            // 3. for i < number of children
            // 3.1 if read boolean true , then create TreeElement and deserialize
            // directly.
            // 3.2 if read boolean false then create tagged element and deserialize
            // child
            if (!ExtUtil.readBool(in_renamed))
            {
                // 1.
                children = null;
            }
            else
            {
                children = new ArrayList();
                // 2.
                int numChildren = (int)ExtUtil.readNumeric(in_renamed);
                // 3.
                for (int i = 0; i < numChildren; ++i)
                {
                    Boolean     normal = ExtUtil.readBool(in_renamed);
                    TreeElement child;

                    if (normal)
                    {
                        // 3.1
                        child = new TreeElement();
                        child.readExternal(in_renamed, pf);
                    }
                    else
                    {
                        // 3.2
                        child = (TreeElement)ExtUtil.read(in_renamed, new ExtWrapTagged(), pf);
                    }
                    child.setParent(this);
                    children.Add(child);
                }
            }

            // end Jan 22, 2009

            dataType          = ExtUtil.readInt(in_renamed);
            relevant          = ExtUtil.readBool(in_renamed);
            required          = ExtUtil.readBool(in_renamed);
            enabled           = ExtUtil.readBool(in_renamed);
            relevantInherited = ExtUtil.readBool(in_renamed);
            enabledInherited  = ExtUtil.readBool(in_renamed);
            constraint        = (Constraint)ExtUtil.read(in_renamed, new ExtWrapNullable(
                                                             typeof(Constraint)), pf);
            preloadHandler = ExtUtil.nullIfEmpty(ExtUtil.readString(in_renamed));
            preloadParams  = ExtUtil.nullIfEmpty(ExtUtil.readString(in_renamed));

            ArrayList attStrings = ExtUtil.nullIfEmpty((ArrayList)ExtUtil.read(in_renamed,
                                                                               new ExtWrapList(typeof(String)), pf));

            setAttributesFromSingleStringVector(attStrings);
        }
예제 #7
0
 public void readExternal(BinaryReader in_, PrototypeFactory pf)
 {
     expr   = (XPathExpression)ExtUtil.read(in_, new ExtWrapTagged(), pf);
     hasNow = (Boolean)ExtUtil.readBool(in_);
 }
예제 #8
0
 public void readExternal(BinaryReader in_, PrototypeFactory pf)
 {
     equal = ExtUtil.readBool(in_);
     base.readExternal(in_, pf);
 }