Examples of ITypeInfo


Examples of com.forgeessentials.data.api.ITypeInfo

        return map;
    }

    private void createTaggedClassFromResult(HashMap<String, Object> result, ITypeInfo info, TypeData data) throws SQLException
    {
        ITypeInfo infoCursor;
        TypeData dataCursor = null;
        ClassContainer tmpClass;
        Object tempVal;

        for (Entry<String, Object> entry : result.entrySet())
        {
            dataCursor = data;
            infoCursor = info;

            if (entry.getKey().equalsIgnoreCase(UNIQUE))
            {
                data.setUniqueKey(entry.getValue().toString());
                continue;
            }

            String[] fieldHeiarchy = entry.getKey().split(SEPERATOR);
            if (fieldHeiarchy != null)
            {
                // Iterate over the list of items in the hierarchy to rebuild the
                // TaggedClass.
                for (int i = 0; i < fieldHeiarchy.length; ++i)
                {
                    String name = fieldHeiarchy[i];

                    // Grab the next item
                    tmpClass = infoCursor.getTypeOfField(name);

                    // if its not the last one.
                    if (fieldHeiarchy.length > i + 1)
                    {
                        // An object lives here. Add a new taggedClass of this type.
                        tempVal = dataCursor.getFieldValue(name);

                        if (tempVal == null)
                        {
                            tempVal = DataStorageManager.getDataForType(tmpClass);
                        }

                        dataCursor.putField(name, tempVal);

                        // change the cursor to the new object.
                        dataCursor = (TypeData) tempVal;
                        infoCursor = infoCursor.getInfoForField(name);
                    }
                    else
                    {
                        // account for multivals.
                        if (name.contains(MULTI_MARKER))
                        {
                            name = name.replace("_" + MULTI_MARKER, "");
                            // get tmpClass again with new name.
                            tmpClass = infoCursor.getTypeOfField(name);
                        }

                        // Primitive type.
                        tempVal = valueToField(tmpClass, entry.getValue());
                        dataCursor.putField(name, tempVal);
View Full Code Here

Examples of com.forgeessentials.data.api.ITypeInfo

        // normal class delete thing.
        String statement = "DELETE FROM " + FEDATA_PREFIX + type.getFileSafeName() + " WHERE " + SURROUNDER + UNIQUE + SURROUNDER + "='" + unique + "'";
        list.add(statement);

        ITypeInfo info = DataStorageManager.getInfoForType(type);
        TypeData data = DataStorageManager.getDataForType(type);

        ResultSet set = getDbConnection().createStatement().executeQuery(createSelectStatement(type, unique));
        if (set.next())
        {
View Full Code Here

Examples of com.forgeessentials.data.api.ITypeInfo

    private void collectMultiVals(ITypeInfo info, TypeData data, HashMultimap<ClassContainer, String> map)
    {
        HashMultimap.create();

        ITypeInfo tempInfo;
        String id;
        for (Entry<String, Object> e : data.getAllFields())
        {
            info.getTypeOfField(e.getKey());
            tempInfo = info.getInfoForField(e.getKey());

            if (tempInfo == null)
            {
                continue;
            }
            else if (!tempInfo.canSaveInline())
            {
                id = e.getValue().toString();
                map.put(tempInfo.getType(), id);
            }
            else if (e.getValue() instanceof TypeData)
            {
                collectMultiVals(info, (TypeData) e.getValue(), map);
            }
View Full Code Here

Examples of com.forgeessentials.data.api.ITypeInfo

    private ArrayList<String> generateMultiValInsertBatch(TypeData data)
    {
        ArrayList<String> statements = new ArrayList<String>();

        TypeMultiValInfo info = (TypeMultiValInfo) DataStorageManager.getInfoForType(data.getContainer());
        ITypeInfo entryInfo = info.getEntryInfo();

        for (Object dat : data.getAllValues())
        {
            if (dat instanceof TypeData)
            {
View Full Code Here

Examples of com.forgeessentials.data.api.ITypeInfo

        if (classTableChecked.contains(type.getName()))
        {
            return false;
        }

        ITypeInfo tagger = DataStorageManager.getInfoForType(type);
        ArrayList<Pair<String, String>> tableFields = new ArrayList<Pair<String, String>>();
        String keyClause = "";

        boolean isMulti = tagger instanceof TypeMultiValInfo;

        // if its multi, add the UID thing.
        if (isMulti)
        {
            classTableChecked.add(type.getName());

            tableFields.add(new Pair<String, String>(MULTI_MARKER, "VARCHAR(100)"));

            TypeEntryInfo info = ((TypeMultiValInfo) tagger).getEntryInfo();

            for (String name : info.getFieldList())
            {
                tableFields.addAll(fieldToColumns(info, name, name));
            }
        }
        else
        {
            for (String name : tagger.getFieldList())
            {
                tableFields.addAll(fieldToColumns(tagger, name, name));
            }
        }
View Full Code Here

Examples of com.forgeessentials.data.api.ITypeInfo

            }
        }
        else
        {
            // Complex type we can't handle.
            ITypeInfo tagger = info.getInfoForField(field);

            if (tagger instanceof TypeMultiValInfo || !tagger.canSaveInline())
            {
                // special stuff for Multivals. this will be a key going to a different table.
                createTable(con);
                fields.add(new Pair<String, String>(columnName + "_" + MULTI_MARKER, "VARCHAR(255)"));
            }

            // some other complex type.
            String[] fieldList = tagger.getFieldList();

            // Iterate over the stored fields. Recurse if nessescary.
            for (String name : fieldList)
            {
                fields.addAll(fieldToColumns(tagger, columnName + SEPERATOR + name, name));
View Full Code Here

Examples of com.forgeessentials.data.api.ITypeInfo

        }
        else if (value.getClass().equals(TypeData.class))
        {
            // Tricky business involving recursion.
            TypeData tc = (TypeData) value;
            ITypeInfo info = DataStorageManager.getInfoForType(type);

            if (info instanceof TypeMultiValInfo || !info.canSaveInline())
            {
                // special stuff for Multivals. this will be a key going to a different table.
                data.add(new Pair(fieldName + "_" + MULTI_MARKER, tc.getUniqueKey()));

                // this will be removed what all the MultiVal ones are collected.
                data.add(new Pair(fieldName + "_" + MULTI_MARKER, tc));

                for (String name : info.getFieldList())
                {
                    data.addAll(fieldToValues(fieldName + SEPERATOR + name, info.getTypeOfField(name), tc.getFieldValue(name)));
                }
            }
            else
            {
                for (Entry<String, Object> f : tc.getAllFields())
                {
                    data.addAll(fieldToValues(fieldName + SEPERATOR + f.getKey(), info.getTypeOfField(f.getKey()), f.getValue()));
                }
            }
        }
        else
        // What the fuck? This will be unpredictable.
View Full Code Here

Examples of com.forgeessentials.data.api.ITypeInfo

            value = values;
        }
        else
        {
            // for small things like this...
            ITypeInfo info = DataStorageManager.getInfoForType(targetType);

            // multival styff
            if (!info.canSaveInline())
            {
                TypeMultiValInfo multiInfo = (TypeMultiValInfo) info;
                String ID = dbValue.toString();
                ID = TypeMultiValInfo.getUIDFromUnique(ID);

                // get the data for the MultiVals
                Statement s = getDbConnection().createStatement();
                ResultSet result = s.executeQuery("SELECT * FROM " + FEDATA_PREFIX + targetType.getFileSafeName() + " WHERE " + MULTI_MARKER + "='" + ID + "'");

                TypeData data = DataStorageManager.getDataForType(targetType);

                TypeEntryInfo entryInfo = multiInfo.getEntryInfo();
                String connector = multiInfo.getEntryName();

                // create the MultiVal object
                TypeData temp;
                int i = 0;
                while (result.next())
                {
                    temp = DataStorageManager.getDataForType(info.getType());
                    createTaggedClassFromResult(resultRowToMap(result), entryInfo, data);
                    data.putField(connector + i++, temp);
                }

                // return the compelted MultiVal object
View Full Code Here

Examples of com.sun.jna.platform.win32.COM.ITypeInfo

        int cImplTypes = typeAttr.cImplTypes.intValue();
        String interfaces = "";

        for (int i = 0; i < cImplTypes; i++) {
            HREFTYPE refTypeOfImplType = typeInfoUtil.getRefTypeOfImplType(i);
            ITypeInfo refTypeInfo = typeInfoUtil
                    .getRefTypeInfo(refTypeOfImplType);
            TypeInfoUtil refTypeInfoUtil = new TypeInfoUtil(refTypeInfo);
            this.createFunctions(refTypeInfoUtil, bindingMode);
            TypeInfoDoc documentation = refTypeInfoUtil
                    .getDocumentation(new MEMBERID(-1));
View Full Code Here

Examples of com.sun.jna.platform.win32.COM.ITypeInfo

            return null;
        }
    }

    protected String getUserdefinedType(HREFTYPE hreftype) {
        ITypeInfo refTypeInfo = this.typeInfoUtil.getRefTypeInfo(hreftype);
        TypeInfoUtil typeInfoUtil = new TypeInfoUtil(refTypeInfo);
        TypeInfoDoc documentation = typeInfoUtil
                .getDocumentation(OaIdl.MEMBERID_NIL);
        return documentation.getName();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.