Examples of GaeaSerializable


Examples of com.bj58.spat.gaea.serializer.component.annotation.GaeaSerializable

        }
        Set<Class> classes = cs.scan(basePakage.split(";"));
        for (Class c : classes) {
            System.out.println("scaning " + c.getPackage().getName() + "." + c.getName());
            try {
                GaeaSerializable ann = (GaeaSerializable) c.getAnnotation(GaeaSerializable.class);
                if (ann != null) {
                    String name = ann.name();
                    if (name.equals(StrHelper.EmptyString)) {
                        name = c.getSimpleName();
                    }
                    int typeId = StrHelper.GetHashcode(name);
                    TypeIdMap.put(c, new ClassItem(typeId, c));
View Full Code Here

Examples of com.bj58.spat.gaea.serializer.component.annotation.GaeaSerializable

        }
        ClassItem ci = TypeIdMap.get(type);
        if (ci != null) {
            typeId = ci.getTypeId();
        } else {
            GaeaSerializable ann = (GaeaSerializable) type.getAnnotation(GaeaSerializable.class);
            if (ann == null) {
                throw new DisallowedSerializeException(type);
            }
            String name = ann.name();
            if (name.equals(StrHelper.EmptyString)) {
                name = type.getSimpleName();
            }
            typeId = StrHelper.GetHashcode(name);
            setTypeMap(type, typeId);
View Full Code Here

Examples of com.bj58.spat.gaea.serializer.component.annotation.GaeaSerializable

    private TypeInfo GetTypeInfo(Class<?> type) throws ClassNotFoundException, DisallowedSerializeException {
        if (TypeInfoMap.containsKey(type)) {
            return TypeInfoMap.get(type);
        }
        GaeaSerializable cAnn = type.getAnnotation(GaeaSerializable.class);
        if (cAnn == null) {
            throw new DisallowedSerializeException();
        }
        int typeId = TypeHelper.GetTypeId(type);
        TypeInfo typeInfo = new TypeInfo(typeId);
        ArrayList<Field> fields = new ArrayList<Field>();
        Class temType = type;
        while (true) {
            Field[] fs = temType.getDeclaredFields();
            for (Field f : fs) {
                fields.add(f);
            }
            Class superClass = temType.getSuperclass();
            if (superClass == null) {
                break;
            }
            temType = superClass;
        }

        Map<Integer, Field> mapFildes = new HashMap<Integer, Field>();
        List<Integer> indexIds = new ArrayList<Integer>();
        if (cAnn.defaultAll()) {
            for (Field f : fields) {
                GaeaNotMember ann = f.getAnnotation(GaeaNotMember.class);
                if (ann != null) {
                    continue;
                }
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.