Examples of ITypeInfo


Examples of com.forgeessentials.data.api.ITypeInfo

            return null;
        }

        TypeData data = DataStorageManager.getDataForType(type);
        data.setUniqueKey(uniqueKey);
        ITypeInfo info = DataStorageManager.getInfoForType(type);
        readClassFromTag(nbt, data, info);

        return data;
    }
View Full Code Here

Examples of com.forgeessentials.data.api.ITypeInfo

        {
            onClassRegistered(DataStorageManager.getInfoForType(type));
            classRegister.put(getName(), type.getName());
        }

        ITypeInfo t = DataStorageManager.getInfoForType(type);
        if (t != null)
        {
            flag = true;
            saveData(type, t.getTypeDataFromObject(o));
        }

        return flag;
    }
View Full Code Here

Examples of com.forgeessentials.data.api.ITypeInfo

    @Override
    public Object loadObject(ClassContainer type, String loadingKey)
    {
        Object newObject = null;
        TypeData data = loadData(type, loadingKey);
        ITypeInfo info = DataStorageManager.getInfoForType(type);

        if (data != null && data.getAllFields().size() > 0)
        {
            newObject = createFromFields(data, info);
        }
View Full Code Here

Examples of com.forgeessentials.data.api.ITypeInfo

    @Override
    public Object[] loadAllObjects(ClassContainer type)
    {
        ArrayList<Object> list = new ArrayList<Object>();
        TypeData[] objectData = loadAll(type);
        ITypeInfo info = DataStorageManager.getInfoForType(type);

        // Each element of the field array represents an object, stored as an
        // array of fields.
        Object tmp;
        if (objectData != null && objectData.length > 0)
View Full Code Here

Examples of com.forgeessentials.data.api.ITypeInfo

    }

    @Override
    public void registerSaveableClass(ClassContainer type)
    {
        ITypeInfo info = null;

        if (type.isArray() && !type.getType().getComponentType().isPrimitive() && !String.class.isAssignableFrom(type.getType().getComponentType()))
        {
            info = new TypeInfoArray(new ClassContainer(type.getType()));
        }
        else if (Map.class.isAssignableFrom(type.getType()))
        {
            info = new TypeInfoMap(type);
        }
        else if (Set.class.isAssignableFrom(type.getType()))
        {
            info = new TypeInfoSet(type);
        }
        else if (List.class.isAssignableFrom(type.getType()))
        {
            info = new TypeInfoList(type);
        }
        else if (type.getType().isAnnotationPresent(SaveableObject.class))
        {
            info = new TypeInfoStandard(type.getType());
        }
        else if (Serializable.class.isAssignableFrom(type.getType()))
        {
            info = new TypeInfoSerialize(type);
        }

        if (info == null)
        {
            return;
        }

        info.build();
        taggerList.put(type.toString(), info);
    }
View Full Code Here

Examples of com.forgeessentials.data.api.ITypeInfo

                            break;
                        }
                    }
                }

                ITypeInfo created = null;

                if (con == null)
                {
                    throw new IllegalArgumentException(infoType.getCanonicalName() + " must have useable constructors! See the ITypeInfo documentation!");
                }

                switch (arg)
                {
                case 0:
                    created = con.newInstance();
                    break;
                case 1:
                    created = con.newInstance(type.getType());
                    break;
                case 2:
                    created = con.newInstance(type);
                    break;
                }

                created.build();
                taggerList.put(type.toString(), created);
            }
            catch (SecurityException e)
            {
                OutputHandler.felog.severe(infoType.getCanonicalName() + " must have useable constructors! See the ITypeInfo documentation!");
View Full Code Here

Examples of com.forgeessentials.data.api.ITypeInfo

    }

    @Override
    public ITypeInfo getInfoForType(ClassContainer type)
    {
        ITypeInfo tagged = taggerList.get(type.toString());

        if (tagged != null)
        {
            return tagged;
        }
View Full Code Here

Examples of com.forgeessentials.data.api.ITypeInfo

    }

    @Override
    public TypeData getDataForObject(ClassContainer container, Object obj)
    {
        ITypeInfo info = getInfoForType(container);
        TypeData data = info.getTypeDataFromObject(obj);

        ITypeInfo tempInfo;
        for (Entry<String, Object> e : data.getAllFields())
        {
            if (e.getValue() != null && !(e.getValue() instanceof TypeData) && StorageManager.isTypeComplex(e.getValue().getClass()))
            {
                tempInfo = info.getInfoForField(e.getKey());
                data.putField(e.getKey(), DataStorageManager.getDataForObject(tempInfo.getTypeOfField(e.getKey()), e.getValue()));
            }
        }

        return data;
    }
View Full Code Here

Examples of com.forgeessentials.data.api.ITypeInfo

    @Override
    protected TypeData loadData(ClassContainer type, String uniqueKey)
    {
        TypeData reconstructed = DataStorageManager.getDataForType(type);
        ITypeInfo info = DataStorageManager.getInfoForType(type);

        try
        {
            Statement s = getDbConnection().createStatement();
            ResultSet result = s.executeQuery(createSelectStatement(type, uniqueKey));
View Full Code Here

Examples of com.forgeessentials.data.api.ITypeInfo

    @Override
    protected TypeData[] loadAll(ClassContainer type)
    {
        ArrayList<TypeData> values = new ArrayList<TypeData>();
        ITypeInfo info = DataStorageManager.getInfoForType(type);

        try
        {
            Statement s = getDbConnection().createStatement();
            ResultSet result = s.executeQuery(createSelectAllStatement(type));
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.