Package com.qspin.qtaste.ui.debug

Examples of com.qspin.qtaste.ui.debug.DebugVariable


            ArrayList<?> arrayList = (ArrayList<?>) javaObject;
            Iterator<?> arrayListIt = arrayList.iterator();
            int index = 0;
            while (arrayListIt.hasNext()) {
                Object javaObjectInArray = arrayListIt.next();
                DebugVariable fieldVar = new DebugVariable("[" + index + "]",
                        javaObjectInArray.getClass().toString(), javaObjectInArray.toString());
                fieldVar = dumpJavaObject(javaObjectInArray, fieldVar);
                debugVar.addField(fieldVar);
                index++;
            }
        }
        Field[] fields = javaObject.getClass().getFields();
        for (int fIndex = 0; fIndex < fields.length; fIndex++) {
            Field field = fields[fIndex];
            String fieldName = field.getName();
            try {
                Object fieldObject = field.get(javaObject);

                String fieldValue = fieldObject.toString();
                DebugVariable fieldVar = new DebugVariable(fieldName,
                        field.getClass().toString(), fieldValue.toString());
                fieldVar = dumpJavaObject(fieldValue, fieldVar);
                debugVar.addField(fieldVar);
            } catch (IllegalArgumentException e) {
                debugVar.addField(new DebugVariable(fieldName,
                        field.getClass().toString(), "Illegal argument"));
            } catch (IllegalAccessException e) {
                debugVar.addField(new DebugVariable(fieldName,
                        field.getClass().toString(), "Illegal Access Exception"));
            } catch (NullPointerException e) {
                debugVar.addField(new DebugVariable(fieldName,
                        field.getClass().toString(), "Null Pointer Exception"));
            }
        }
        Method[] methods = javaObject.getClass().getMethods();
        for (int methodIndex = 0; methodIndex < methods.length; methodIndex++) {
            Method method = methods[methodIndex];
            if ((method.getName().startsWith("get")) &&
                    (!(method.getName().equals("getClass"))) &&
                    (!(method.getName().equals("getAccessorKeys")))) {
                try {
                    Object returnValue = method.invoke(javaObject, new Object[]{});
                    DebugVariable fieldVar = new DebugVariable(method.getName(),
                            javaObject.getClass().toString(), returnValue.toString());
                    fieldVar = dumpJavaObject(returnValue, fieldVar);
                    debugVar.addField(fieldVar);
                } catch (Exception e) {
                }
View Full Code Here


        if (value instanceof PyList) {
            PyList listValue = (PyList) value;
            Object[] dataArray = (Object[]) listValue.getArray();
            for (int i = 0; i < listValue.__len__(); i++) {
                Object o = dataArray[i];
                debugVar.addField(new DebugVariable("[" + i + "]",
                        o.getClass().toString(), o.toString()));
            }
            return debugVar;

        }
        if (value instanceof PyArray) {
            PyArray arrayValue = (PyArray) value;
            Object[] dataArray = (Object[]) arrayValue.getArray();
            for (int i = 0; i < arrayValue.__len__(); i++) {
                Object o = dataArray[i];
                debugVar.addField(new DebugVariable("[" + i + "]",
                        o.getClass().toString(), o.toString()));
                debugVar = dumpJavaObject(o, debugVar);
            }
            return debugVar;
        } else if (value instanceof PyJavaInstance) {
View Full Code Here

                        //                  (!(variableValue instanceof PyFunction)) &&
                        //                (!(variableValue instanceof java.lang.Class)) &&
                        //              (!(variableValue instanceof PyModule))
                        ) {
                    //Object variableValue = locals.get(new PyString(localKey));
                    DebugVariable debugVar = new DebugVariable(variableName, variableValue.getClass().toString(), variableValue.toString());
                    debugVar = dumpPythonObject(variableValue, debugVar);
                    debugVariables.add(debugVar);
                }

                /*
                if ((oValue instanceof Integer) ||
                (oValue instanceof String) ||
                (oValue instanceof Double)) {
                DebugVariable debugVar = new DebugVariable(key, oValue.getClass().toString(),
                oValue.toString());
                debugVariables.add(debugVar);
                }*/

            }
            if (mLocals instanceof PyStringMap) {
                PyStringMap locals = (PyStringMap) mLocals;
                PyList keys = locals.keys();
                Iterator<?> localIt = keys.iterator();
                while (localIt.hasNext()) {
                    Object oMap = localIt.next();
                    if (oMap instanceof String) {
                        String localKey = (String) oMap;
                        Object oValue = locals.get(new PyString(localKey));
                        DebugVariable debugVar = new DebugVariable(localKey.toString(),
                                oValue.getClass().toString(), oValue.toString());
                        debugVar = dumpPythonObject(oValue, debugVar);
                        debugVariables.add(debugVar);
                    }
                }
View Full Code Here

TOP

Related Classes of com.qspin.qtaste.ui.debug.DebugVariable

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.