Package java.io

Examples of java.io.ObjectStreamField


                        } else {
                            _fields = new FieldDescriptor[serial_persistent_fields.length];

                            for (int i = 0; i < serial_persistent_fields.length; i++) {
                                ObjectStreamField f = serial_persistent_fields[i];

                                FieldDescriptor fd = null;

                                try {
                                    java.lang.reflect.Field rf = type
                                            .getField(f.getName());
                                    rf.setAccessible(true);

                                    if (rf.getType() == f.getType()) {
                                        fd = FieldDescriptor.get(rf);
                                    }
                                } catch (SecurityException ex) {
                                } catch (NoSuchFieldException ex) {
                                }
View Full Code Here


        if (checked.containsKey(objVals[i]))
        {
          continue;
        }

        ObjectStreamField fieldDesc = fields[numPrimFields + i];
        Field field;
        try
        {
          field = (Field)GET_FIELD_METHOD.invoke(fieldDesc, (Object[])null);
        }
View Full Code Here

     * types, and any other non-null type matches assignable types only.
     * Throws IllegalArgumentException if no matching field found.
     */
    private int getFieldOffset(String name, Class type)
    {
        ObjectStreamField field = getField(name, type);
        if (field == null)
        {
            throw new IllegalArgumentException("no such field");
        }
        return field.getOffset();
    }
View Full Code Here

        Object[] args = new Object[1];

        for (int i = 0; i < fields.length; i++)
        {
            java.io.ObjectStreamField f = fields[i];
            _fields[i] = new ObjectStreamField(fields[i].getName(), fields[i].getType());
            ObjectStreamField _f = _fields[i];

            switch (f.getTypeCode())
            {
                case 'Z':
                case 'B':
View Full Code Here

        if (checked.containsKey(objVals[i]))
        {
          continue;
        }

        ObjectStreamField fieldDesc = fields[numPrimFields + i];
        Field field;
        try
        {
          field = (Field)GET_FIELD_METHOD.invoke(fieldDesc, (Object[])null);
        }
View Full Code Here

        if (checked.containsKey(objVals[i]))
        {
          continue;
        }

        ObjectStreamField fieldDesc = fields[numPrimFields + i];
        Field field;
        try
        {
          field = (Field)GET_FIELD_METHOD.invoke(fieldDesc, (Object[])null);
        }
View Full Code Here

        if (checked.containsKey(objVals[i]))
        {
          continue;
        }

        ObjectStreamField fieldDesc = fields[numPrimFields + i];
        Field field;
        try
        {
          field = (Field)GET_FIELD_METHOD.invoke(fieldDesc, (Object[])null);
        }
View Full Code Here

        // Regression for HARMONY-2674
        ObjectStreamClass objectStreamClass = ObjectStreamClass
                .lookup(File.class);
        ObjectStreamField[] objectStreamFields = objectStreamClass.getFields();
        assertEquals(1, objectStreamFields.length);
        ObjectStreamField objectStreamField = objectStreamFields[0];
        assertEquals("path", objectStreamField.getName());
        assertEquals(String.class, objectStreamField.getType());
    }
View Full Code Here

        //Regression for HARMONY-2674
        ObjectStreamClass objectStreamClass = ObjectStreamClass
                .lookup(File.class);
        ObjectStreamField[] objectStreamFields = objectStreamClass.getFields();
        assertEquals(1, objectStreamFields.length);
        ObjectStreamField objectStreamField = objectStreamFields[0];
        assertEquals("path", objectStreamField.getName());
        assertEquals(String.class, objectStreamField.getType());
    }
View Full Code Here

                field.setAccessible(true);
                map.put(field.getName(), field);
            }
            SerializableField[] fields = new SerializableField[objectStreamFields.length];
            for (int i = 0; i < objectStreamFields.length; i++) {
                ObjectStreamField field = objectStreamFields[i];
                final String name = field.getName();
                final Field realField = map.get(name);
                if (realField != null && realField.getType() == field.getType()) {
                    // allow direct updating of the field data since the types match
                    fields[i] = new SerializableField(field.getType(), name, field.isUnshared(), realField);
                } else {
                    // no direct update possible
                    fields[i] = new SerializableField(field.getType(), name, field.isUnshared(), null);
                }
            }
            Arrays.sort(fields, NAME_COMPARATOR);
            return fields;
        }
        final ArrayList<SerializableField> fields = new ArrayList<SerializableField>(declaredFields.length);
        for (Field field : declaredFields) {
            if ((field.getModifiers() & (Modifier.TRANSIENT | Modifier.STATIC)) == 0) {
                field.setAccessible(true);
                fields.add(new SerializableField(field.getType(), field.getName(), false, field));
            }
        }
        Collections.sort(fields, NAME_COMPARATOR);
        return fields.toArray(new SerializableField[fields.size()]);
    }
View Full Code Here

TOP

Related Classes of java.io.ObjectStreamField

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.