Package com.sun.star.reflection

Examples of com.sun.star.reflection.XIdlField2


                ("flagging as ambiguous/defaulted non-ambiguous/defaulted"
                 + " property " + name),
                object, illegalArgumentPosition);

        }
        XIdlField2 f = (XIdlField2) UnoRuntime.queryInterface(
            XIdlField2.class, idlClass.getField(name));
        Object[] o = new Object[] {
                new Any(type, UnoRuntime.queryInterface(type, object)) };
        Object v = wrapValue(
            value,
            ((XIdlField2) UnoRuntime.queryInterface(
                XIdlField2.class, idlClass.getField(name))).getType(),
            (p.property.Attributes & PropertyAttribute.MAYBEAMBIGUOUS) != 0,
            isAmbiguous,
            (p.property.Attributes & PropertyAttribute.MAYBEDEFAULT) != 0,
            isDefaulted,
            (p.property.Attributes & PropertyAttribute.MAYBEVOID) != 0);
        try {
            f.set(o, v);
        } catch (com.sun.star.lang.IllegalArgumentException e) {
            if (e.ArgumentPosition == 1) {
                throw new com.sun.star.lang.IllegalArgumentException(
                    e.getMessage(), object, illegalArgumentPosition);
            } else {
View Full Code Here


    {
        PropertyData p = (PropertyData) properties.get(name);
        if (p == null) {
            throw new UnknownPropertyException(name, object);
        }
        XIdlField2 field = (XIdlField2) UnoRuntime.queryInterface(
            XIdlField2.class, idlClass.getField(name));
        Object value;
        try {
            value = field.get(
                new Any(type, UnoRuntime.queryInterface(type, object)));
        } catch (com.sun.star.lang.IllegalArgumentException e) {
            throw new RuntimeException(
                "unexpected com.sun.star.lang.IllegalArgumentException: "
                + e.getMessage());
View Full Code Here

            && type.getName().startsWith("com.sun.star.beans.Ambiguous<"))
        {
            Object[] strct = new Object[1];
            type.createObject(strct);
            try {
                XIdlField2 field = (XIdlField2) UnoRuntime.queryInterface(
                    XIdlField2.class, type.getField("Value"));
                field.set(
                    strct,
                    wrapValue(
                        value, field.getType(), false, false, wrapDefaulted,
                        isDefaulted, wrapOptional));
                ((XIdlField2) UnoRuntime.queryInterface(
                    XIdlField2.class, type.getField("IsAmbiguous"))).set(
                        strct, new Boolean(isAmbiguous));
            } catch (com.sun.star.lang.IllegalArgumentException e) {
                throw new RuntimeException(
                    "unexpected com.sun.star.lang.IllegalArgumentException: "
                    + e.getMessage());
            } catch (com.sun.star.lang.IllegalAccessException e) {
                throw new RuntimeException(
                    "unexpected com.sun.star.lang.IllegalAccessException: "
                    + e.getMessage());
            }
            return strct[0];
        } else if (wrapDefaulted
                   && type.getName().startsWith(
                       "com.sun.star.beans.Defaulted<"))
        {
            Object[] strct = new Object[1];
            type.createObject(strct);
            try {
                XIdlField2 field = (XIdlField2) UnoRuntime.queryInterface(
                    XIdlField2.class, type.getField("Value"));
                field.set(
                    strct,
                    wrapValue(
                        value, field.getType(), wrapAmbiguous, isAmbiguous,
                        false, false, wrapOptional));
                ((XIdlField2) UnoRuntime.queryInterface(
                    XIdlField2.class, type.getField("IsDefaulted"))).set(
                        strct, new Boolean(isDefaulted));
            } catch (com.sun.star.lang.IllegalArgumentException e) {
                throw new RuntimeException(
                    "unexpected com.sun.star.lang.IllegalArgumentException: "
                    + e.getMessage());
            } catch (com.sun.star.lang.IllegalAccessException e) {
                throw new RuntimeException(
                    "unexpected com.sun.star.lang.IllegalAccessException: "
                    + e.getMessage());
            }
            return strct[0];
        } else if (wrapOptional
                   && type.getName().startsWith("com.sun.star.beans.Optional<"))
        {
            Object[] strct = new Object[1];
            type.createObject(strct);
            boolean present = !AnyConverter.isVoid(value);
            try {
                ((XIdlField2) UnoRuntime.queryInterface(
                    XIdlField2.class, type.getField("IsPresent"))).set(
                        strct, new Boolean(present));
                if (present) {
                    XIdlField2 field = (XIdlField2) UnoRuntime.queryInterface(
                        XIdlField2.class, type.getField("Value"));
                    field.set(
                        strct,
                        wrapValue(
                            value, field.getType(), wrapAmbiguous, isAmbiguous,
                            wrapDefaulted, isDefaulted, false));
                }
            } catch (com.sun.star.lang.IllegalArgumentException e) {
                throw new RuntimeException(
                    "unexpected com.sun.star.lang.IllegalArgumentException: "
View Full Code Here

                ("flagging as ambiguous/defaulted non-ambiguous/defaulted"
                 + " property " + name),
                object, illegalArgumentPosition);

        }
        XIdlField2 f = UnoRuntime.queryInterface(
            XIdlField2.class, idlClass.getField(name));
        Object[] o = new Object[] {
                new Any(type, UnoRuntime.queryInterface(type, object)) };
        Object v = wrapValue(
            value,
            UnoRuntime.queryInterface(
                XIdlField2.class, idlClass.getField(name)).getType(),
            (p.property.Attributes & PropertyAttribute.MAYBEAMBIGUOUS) != 0,
            isAmbiguous,
            (p.property.Attributes & PropertyAttribute.MAYBEDEFAULT) != 0,
            isDefaulted,
            (p.property.Attributes & PropertyAttribute.MAYBEVOID) != 0);
        try {
            f.set(o, v);
        } catch (com.sun.star.lang.IllegalArgumentException e) {
            if (e.ArgumentPosition == 1) {
                throw new com.sun.star.lang.IllegalArgumentException(
                    e.getMessage(), object, illegalArgumentPosition);
            } else {
View Full Code Here

    {
        PropertyData p = (PropertyData) properties.get(name);
        if (p == null) {
            throw new UnknownPropertyException(name, object);
        }
        XIdlField2 field = UnoRuntime.queryInterface(
            XIdlField2.class, idlClass.getField(name));
        Object value;
        try {
            value = field.get(
                new Any(type, UnoRuntime.queryInterface(type, object)));
        } catch (com.sun.star.lang.IllegalArgumentException e) {
            throw new RuntimeException(
                "unexpected com.sun.star.lang.IllegalArgumentException: "
                + e.getMessage());
View Full Code Here

            && type.getName().startsWith("com.sun.star.beans.Ambiguous<"))
        {
            Object[] strct = new Object[1];
            type.createObject(strct);
            try {
                XIdlField2 field = UnoRuntime.queryInterface(
                    XIdlField2.class, type.getField("Value"));
                field.set(
                    strct,
                    wrapValue(
                        value, field.getType(), false, false, wrapDefaulted,
                        isDefaulted, wrapOptional));
                UnoRuntime.queryInterface(
                    XIdlField2.class, type.getField("IsAmbiguous")).set(
                        strct, new Boolean(isAmbiguous));
            } catch (com.sun.star.lang.IllegalArgumentException e) {
                throw new RuntimeException(
                    "unexpected com.sun.star.lang.IllegalArgumentException: "
                    + e.getMessage());
            } catch (com.sun.star.lang.IllegalAccessException e) {
                throw new RuntimeException(
                    "unexpected com.sun.star.lang.IllegalAccessException: "
                    + e.getMessage());
            }
            return strct[0];
        } else if (wrapDefaulted
                   && type.getName().startsWith(
                       "com.sun.star.beans.Defaulted<"))
        {
            Object[] strct = new Object[1];
            type.createObject(strct);
            try {
                XIdlField2 field = UnoRuntime.queryInterface(
                    XIdlField2.class, type.getField("Value"));
                field.set(
                    strct,
                    wrapValue(
                        value, field.getType(), wrapAmbiguous, isAmbiguous,
                        false, false, wrapOptional));
                UnoRuntime.queryInterface(
                    XIdlField2.class, type.getField("IsDefaulted")).set(
                        strct, new Boolean(isDefaulted));
            } catch (com.sun.star.lang.IllegalArgumentException e) {
                throw new RuntimeException(
                    "unexpected com.sun.star.lang.IllegalArgumentException: "
                    + e.getMessage());
            } catch (com.sun.star.lang.IllegalAccessException e) {
                throw new RuntimeException(
                    "unexpected com.sun.star.lang.IllegalAccessException: "
                    + e.getMessage());
            }
            return strct[0];
        } else if (wrapOptional
                   && type.getName().startsWith("com.sun.star.beans.Optional<"))
        {
            Object[] strct = new Object[1];
            type.createObject(strct);
            boolean present = !AnyConverter.isVoid(value);
            try {
                UnoRuntime.queryInterface(
                    XIdlField2.class, type.getField("IsPresent")).set(
                        strct, new Boolean(present));
                if (present) {
                    XIdlField2 field = UnoRuntime.queryInterface(
                        XIdlField2.class, type.getField("Value"));
                    field.set(
                        strct,
                        wrapValue(
                            value, field.getType(), wrapAmbiguous, isAmbiguous,
                            wrapDefaulted, isDefaulted, false));
                }
            } catch (com.sun.star.lang.IllegalArgumentException e) {
                throw new RuntimeException(
                    "unexpected com.sun.star.lang.IllegalArgumentException: "
View Full Code Here

                ("flagging as ambiguous/defaulted non-ambiguous/defaulted"
                 + " property " + name),
                object, illegalArgumentPosition);

        }
        XIdlField2 f = UnoRuntime.queryInterface(
            XIdlField2.class, idlClass.getField(name));
        Object[] o = new Object[] {
                new Any(type, UnoRuntime.queryInterface(type, object)) };
        Object v = wrapValue(
            value,
            UnoRuntime.queryInterface(
                XIdlField2.class, idlClass.getField(name)).getType(),
            (p.property.Attributes & PropertyAttribute.MAYBEAMBIGUOUS) != 0,
            isAmbiguous,
            (p.property.Attributes & PropertyAttribute.MAYBEDEFAULT) != 0,
            isDefaulted,
            (p.property.Attributes & PropertyAttribute.MAYBEVOID) != 0);
        try {
            f.set(o, v);
        } catch (com.sun.star.lang.IllegalArgumentException e) {
            if (e.ArgumentPosition == 1) {
                throw new com.sun.star.lang.IllegalArgumentException(
                    e.getMessage(), object, illegalArgumentPosition);
            } else {
View Full Code Here

    {
        PropertyData p = (PropertyData) properties.get(name);
        if (p == null) {
            throw new UnknownPropertyException(name, object);
        }
        XIdlField2 field = UnoRuntime.queryInterface(
            XIdlField2.class, idlClass.getField(name));
        Object value;
        try {
            value = field.get(
                new Any(type, UnoRuntime.queryInterface(type, object)));
        } catch (com.sun.star.lang.IllegalArgumentException e) {
            throw new RuntimeException(
                "unexpected com.sun.star.lang.IllegalArgumentException: "
                + e.getMessage());
View Full Code Here

            && type.getName().startsWith("com.sun.star.beans.Ambiguous<"))
        {
            Object[] strct = new Object[1];
            type.createObject(strct);
            try {
                XIdlField2 field = UnoRuntime.queryInterface(
                    XIdlField2.class, type.getField("Value"));
                field.set(
                    strct,
                    wrapValue(
                        value, field.getType(), false, false, wrapDefaulted,
                        isDefaulted, wrapOptional));
                UnoRuntime.queryInterface(
                    XIdlField2.class, type.getField("IsAmbiguous")).set(
                        strct, new Boolean(isAmbiguous));
            } catch (com.sun.star.lang.IllegalArgumentException e) {
                throw new RuntimeException(
                    "unexpected com.sun.star.lang.IllegalArgumentException: "
                    + e.getMessage());
            } catch (com.sun.star.lang.IllegalAccessException e) {
                throw new RuntimeException(
                    "unexpected com.sun.star.lang.IllegalAccessException: "
                    + e.getMessage());
            }
            return strct[0];
        } else if (wrapDefaulted
                   && type.getName().startsWith(
                       "com.sun.star.beans.Defaulted<"))
        {
            Object[] strct = new Object[1];
            type.createObject(strct);
            try {
                XIdlField2 field = UnoRuntime.queryInterface(
                    XIdlField2.class, type.getField("Value"));
                field.set(
                    strct,
                    wrapValue(
                        value, field.getType(), wrapAmbiguous, isAmbiguous,
                        false, false, wrapOptional));
                UnoRuntime.queryInterface(
                    XIdlField2.class, type.getField("IsDefaulted")).set(
                        strct, new Boolean(isDefaulted));
            } catch (com.sun.star.lang.IllegalArgumentException e) {
                throw new RuntimeException(
                    "unexpected com.sun.star.lang.IllegalArgumentException: "
                    + e.getMessage());
            } catch (com.sun.star.lang.IllegalAccessException e) {
                throw new RuntimeException(
                    "unexpected com.sun.star.lang.IllegalAccessException: "
                    + e.getMessage());
            }
            return strct[0];
        } else if (wrapOptional
                   && type.getName().startsWith("com.sun.star.beans.Optional<"))
        {
            Object[] strct = new Object[1];
            type.createObject(strct);
            boolean present = !AnyConverter.isVoid(value);
            try {
                UnoRuntime.queryInterface(
                    XIdlField2.class, type.getField("IsPresent")).set(
                        strct, new Boolean(present));
                if (present) {
                    XIdlField2 field = UnoRuntime.queryInterface(
                        XIdlField2.class, type.getField("Value"));
                    field.set(
                        strct,
                        wrapValue(
                            value, field.getType(), wrapAmbiguous, isAmbiguous,
                            wrapDefaulted, isDefaulted, false));
                }
            } catch (com.sun.star.lang.IllegalArgumentException e) {
                throw new RuntimeException(
                    "unexpected com.sun.star.lang.IllegalArgumentException: "
View Full Code Here

                ("flagging as ambiguous/defaulted non-ambiguous/defaulted"
                 + " property " + name),
                object, illegalArgumentPosition);

        }
        XIdlField2 f = UnoRuntime.queryInterface(
            XIdlField2.class, idlClass.getField(name));
        Object[] o = new Object[] {
                new Any(type, UnoRuntime.queryInterface(type, object)) };
        Object v = wrapValue(
            value,
            UnoRuntime.queryInterface(
                XIdlField2.class, idlClass.getField(name)).getType(),
            (p.property.Attributes & PropertyAttribute.MAYBEAMBIGUOUS) != 0,
            isAmbiguous,
            (p.property.Attributes & PropertyAttribute.MAYBEDEFAULT) != 0,
            isDefaulted,
            (p.property.Attributes & PropertyAttribute.MAYBEVOID) != 0);
        try {
            f.set(o, v);
        } catch (com.sun.star.lang.IllegalArgumentException e) {
            if (e.ArgumentPosition == 1) {
                throw new com.sun.star.lang.IllegalArgumentException(
                    e.getMessage(), object, illegalArgumentPosition);
            } else {
View Full Code Here

TOP

Related Classes of com.sun.star.reflection.XIdlField2

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.