Package com.sun.star.reflection

Examples of com.sun.star.reflection.XTypeDescription


        this.context = context;
        this.object = object;
        this.type = type;
        this.absentOptional = absentOptional;
        idlClass = getReflection(type.getTypeName());
        XTypeDescription ifc;
        try {
            ifc = (XTypeDescription) UnoRuntime.queryInterface(
                XTypeDescription.class,
                (((XHierarchicalNameAccess) UnoRuntime.queryInterface(
                      XHierarchicalNameAccess.class,
View Full Code Here


                        }
                    }
                    if (getUnknown && setUnknown) {
                        attrAttribs |= PropertyAttribute.OPTIONAL;
                    }
                    XTypeDescription t = attr.getType();
                    for (;;) {
                        t = resolveTypedefs(t);
                        short n;
                        if (t.getName().startsWith(
                                "com.sun.star.beans.Ambiguous<"))
                        {
                            n = PropertyAttribute.MAYBEAMBIGUOUS;
                        } else if (t.getName().startsWith(
                                       "com.sun.star.beans.Defaulted<"))
                        {
                            n = PropertyAttribute.MAYBEDEFAULT;
                        } else if (t.getName().startsWith(
                                       "com.sun.star.beans.Optional<"))
                        {
                            n = PropertyAttribute.MAYBEVOID;
                        } else {
                            break;
                        }
                        attrAttribs |= n;
                        t = ((XStructTypeDescription) UnoRuntime.queryInterface(
                                 XStructTypeDescription.class, t)).
                            getTypeArguments()[0];
                    }
                    String name = members[i].getMemberName();
                    boolean present = true;
                    if (absentOptional != null) {
                        for (int j = 0; j < absentOptional.length; ++j) {
                            if (name.equals(absentOptional[j])) {
                                present = false;
                                break;
                            }
                        }
                    }
                    if (map.put(
                            name,
                            new PropertyData(
                                new Property(
                                    name, handleNames.size(),
                                    new Type(t.getName(), t.getTypeClass()),
                                    attrAttribs),
                                present))
                        != null)
                    {
                        throw new RuntimeException(
View Full Code Here

                        oObj.createTypeDescriptionEnumeration(sString, tClass,
                        TypeDescriptionSearchDepth.INFINITE);
            try {
                log.println("Got an enumeration.");
                while (true) {
                    XTypeDescription desc = oEnum.nextTypeDescription();
                    i++;
                    log.println("\tdesc name: " + desc.getName());
                }
            }
            catch(com.sun.star.container.NoSuchElementException e) {
                log.println(
                        "Correct exception caught for exiting enumeration.");
View Full Code Here

        this.context = context;
        this.object = object;
        this.type = type;
        this.absentOptional = absentOptional;
        idlClass = getReflection(type.getTypeName());
        XTypeDescription ifc;
        try {
            ifc = UnoRuntime.queryInterface(
                XTypeDescription.class,
                (UnoRuntime.queryInterface(
                    XHierarchicalNameAccess.class,
View Full Code Here

                        }
                    }
                    if (getUnknown && setUnknown) {
                        attrAttribs |= PropertyAttribute.OPTIONAL;
                    }
                    XTypeDescription t = attr.getType();
                    for (;;) {
                        t = resolveTypedefs(t);
                        short n;
                        if (t.getName().startsWith(
                                "com.sun.star.beans.Ambiguous<"))
                        {
                            n = PropertyAttribute.MAYBEAMBIGUOUS;
                        } else if (t.getName().startsWith(
                                       "com.sun.star.beans.Defaulted<"))
                        {
                            n = PropertyAttribute.MAYBEDEFAULT;
                        } else if (t.getName().startsWith(
                                       "com.sun.star.beans.Optional<"))
                        {
                            n = PropertyAttribute.MAYBEVOID;
                        } else {
                            break;
                        }
                        attrAttribs |= n;
                        t = (UnoRuntime.queryInterface(
                                 XStructTypeDescription.class, t)).
                            getTypeArguments()[0];
                    }
                    String name = members[i].getMemberName();
                    boolean present = true;
                    if (absentOptional != null) {
                        for (int j = 0; j < absentOptional.length; ++j) {
                            if (name.equals(absentOptional[j])) {
                                present = false;
                                break;
                            }
                        }
                    }
                    if (map.put(
                            name,
                            new PropertyData(
                                new Property(
                                    name, handleNames.size(),
                                    new Type(t.getName(), t.getTypeClass()),
                                    attrAttribs),
                                present))
                        != null)
                    {
                        throw new RuntimeException(
View Full Code Here

    try {
        TypeClass[] eTypeClasses = new com.sun.star.uno.TypeClass[1];
        eTypeClasses[0] = com.sun.star.uno.TypeClass.SERVICE;
        XTypeDescriptionEnumeration xTDEnumeration = getXTypeDescriptionEnumerationAccess().createTypeDescriptionEnumeration(Introspector.getModuleName(_sServiceName), eTypeClasses, TypeDescriptionSearchDepth.INFINITE);      
        while (xTDEnumeration.hasMoreElements()) {
            XTypeDescription xTD = xTDEnumeration.nextTypeDescription();
            if (xTD.getName().equals(_sServiceName)){
                XServiceTypeDescription xServiceTypeDescription = (XServiceTypeDescription) UnoRuntime.queryInterface(XServiceTypeDescription.class, xTD);
                XServiceTypeDescription[] xMandatoryServiceTypeDescriptions =  xServiceTypeDescription.getMandatoryServices();
                int nlength = xMandatoryServiceTypeDescriptions.length;
                sMandatoryServiceNames  = new String[nlength];
                for (int i = 0; i < nlength; i++){
View Full Code Here

    try {
        TypeClass[] eTypeClasses = new com.sun.star.uno.TypeClass[1];
        eTypeClasses[0] = com.sun.star.uno.TypeClass.CONSTANTS;
        XTypeDescriptionEnumeration xTDEnumeration = m_xTDEnumerationAccess.createTypeDescriptionEnumeration(getModuleName(_sTypeClass), eTypeClasses, TypeDescriptionSearchDepth.INFINITE);      
        while (xTDEnumeration.hasMoreElements()) {
            XTypeDescription xTD = xTDEnumeration.nextTypeDescription();
            if (xTD.getName().equals(_sTypeClass)){
                XConstantsTypeDescription xConstantsTypeDescription = (XConstantsTypeDescription) UnoRuntime.queryInterface(XConstantsTypeDescription.class, xTD);
                xConstantTypeDescriptions = xConstantsTypeDescription.getConstants();
            }
            String sName = xTD.getName();
        }           
        return xConstantTypeDescriptions;
    } catch ( java.lang.Exception e) {
        System.out.println(System.out);
    }
View Full Code Here

            TypeClass[] eTypeClasses = new com.sun.star.uno.TypeClass[2];
            eTypeClasses[0] = com.sun.star.uno.TypeClass.SERVICE;
            eTypeClasses[1] = _eTypeClass;
            XTypeDescriptionEnumeration xTDEnumeration = getXTypeDescriptionEnumerationAccess().createTypeDescriptionEnumeration(Introspector.getModuleName(_sServiceName), eTypeClasses, TypeDescriptionSearchDepth.INFINITE);      
            while (xTDEnumeration.hasMoreElements()) {
                XTypeDescription xTD = xTDEnumeration.nextTypeDescription();
                if (xTD.getName().equals(_sServiceName)){
                    XServiceTypeDescription xServiceTypeDescription = (XServiceTypeDescription) UnoRuntime.queryInterface(XServiceTypeDescription.class, xTD);
                    return xServiceTypeDescription;
                }
            }
        }
View Full Code Here

    return new XPropertyTypeDescription[]{};
    }
   
   
    public XTypeDescription getReferencedType(String _sTypeName){
    XTypeDescription xTypeDescription = null;
    try{
        XHierarchicalNameAccess xHierarchicalNameAccess = (XHierarchicalNameAccess) UnoRuntime.queryInterface(XHierarchicalNameAccess.class, m_xTDEnumerationAccess);
        if (xHierarchicalNameAccess != null){
            XIndirectTypeDescription xIndirectTypeDescription = (XIndirectTypeDescription) UnoRuntime.queryInterface(XIndirectTypeDescription.class, xHierarchicalNameAccess.getByHierarchicalName(_sTypeName));
            xTypeDescription = xIndirectTypeDescription.getReferencedType();
View Full Code Here

            String sClassName = _sClassName;
            String sHeaderStatement = "";
            if (_oUnoObject != null){
                if (!m_oIntrospector.isObjectPrimitive(_oUnoObject)){           
                    if (m_oIntrospector.isObjectSequence(_oUnoObject)){
                        XTypeDescription xTypeDescription = m_oIntrospector.getReferencedType(sClassName);
                        if (!m_oIntrospector.isPrimitive(xTypeDescription.getTypeClass())){
                            sClassName = getTypeString(xTypeDescription.getName(), xTypeDescription.getTypeClass(), true);  
                        }
                        // primitive Types are not supposed to turn up in the import section...
                        else{
                            sClassName = "";
                        }
View Full Code Here

TOP

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

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.