Ejemplo n.º 1
0
        /// <summary>
        /// sequence type
        /// </summary>
        /// <param name="t">
        ///            is any type </param>
        /// <param name="occ">
        ///            is an integer in the sequence. </param>
        public SeqType(AnyType t, int occ)
        {
            anytype  = t;
            this.occ = occ;

            if (t != null)
            {
                typeClass = t.GetType();
            }
            else
            {
                typeClass = null;
            }
        }
Ejemplo n.º 2
0
        /// <param name="st">
        ///            is a sequence type. </param>
        /// <param name="sc">
        ///            is a static context. </param>
        public SeqType(SequenceType st, StaticContext sc, ResultSequence rs)
        {
            occ = mapSequenceTypeOccurrence(st.occurrence());
            // figure out the item is
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.eclipse.wst.xml.xpath2.processor.internal.ast.ItemType item = st.item_type();
            ItemType item  = st.item_type();
            KindTest ktest = null;

            switch (item.type())
            {
            case ItemType.ITEM:
                typeClass = typeof(AnyType);
                return;

            // XXX IMPLEMENT THIS
            case ItemType.QNAME:
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType aat = make_atomic(sc, item.qname());
                AnyAtomicType aat = make_atomic(sc, item.qname());

                Debug.Assert(aat != null);
                anytype = aat;
                if (item.qname().Equals(ANY_ATOMIC_TYPE))
                {
                    typeClass = typeof(AnyAtomicType);
                }
                else
                {
                    typeClass = anytype.GetType();
                }
                return;

            case ItemType.KINDTEST:
                ktest = item.kind_test();
                break;
            }

            if (ktest == null)
            {
                return;
            }

            typeClass = ktest.XDMClassType;
            anytype   = ktest.createTestType(rs, sc);
            nodeName  = ktest.name();
            wild      = ktest.Wild;
        }
Ejemplo n.º 3
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public final org.eclipse.wst.xml.xpath2.processor.internal.types.AnyAtomicType promote(org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType value) throws org.eclipse.wst.xml.xpath2.processor.DynamicError
        public AnyAtomicType promote(AnyType value)
        {
            // This is a short cut, really
            if (value.GetType() == TargetType)
            {
                return((AnyAtomicType)value);
            }

            AnyAtomicType atomized = atomize(value);

            if (atomized == null)
            {             // empty sequence
                return(null);
            }
            return(doPromote(atomized));
        }