@Override
    public void writeObject(ByteBuffer buffer, Object object) throws IOException {
    
        // Add the null/non-null marker
        buffer.put( (byte)(object != null ? 0x1 : 0x0) );
        if (object == null) {
            // Nothing left to do
            return;
        }
        
        SavedField[] fields = savedFields.get(object.getClass());
        if (fields == null)
            throw new IOException("The " + object.getClass() + " is not registered"
                                + " in the serializer!");

        for (SavedField savedField : fields) {
            Object val = null;
            try {
                val = savedField.field.get(object);
            } catch (IllegalAccessException e) {
                throw new SerializerException("Unable to access field:" + savedField.field + " on:" + object, e);
            }
            Serializer serializer = savedField.serializer;
            if( log.isLoggable(Level.FINER) ) {
                log.log(Level.FINER, "Writing field:{0} using serializer:{1}", new Object[]{savedField.field, serializer});
            }

            try {
                if (serializer != null) {
                    serializer.writeObject(buffer, val);
                } else {
                    Serializer.writeClassAndObject(buffer, val);
                }
            } catch (BufferOverflowException boe) {
                throw boe;
            } catch (Exception e) {
                throw new SerializerException( "Error writing object for field:" + savedField.field, e );
            }
        }
    }
The field serializer is the default serializer used for custom class.

@author Lars Wesselius, Nathan Sweet
jme3-networking/src/main/java/com/jme3/network/serializing/serializers/FieldSerializer.java