private Component deserializeOnto( Component component, EntityData.Component componentData, ComponentMetadata componentMetadata) { try { for (EntityData.NameValue field : componentData.getFieldList()) { FieldMetadata fieldInfo = componentMetadata.getField(field.getName()); if (fieldInfo == null) continue; Object value = fieldInfo.deserialize(field.getValue()); if (value == null) continue; fieldInfo.setValue(component, value); } return component; } catch (InvocationTargetException e) { logger.log( Level.SEVERE, "Exception during serializing component type: " + component.getClass(), e); } catch (IllegalAccessException e) { logger.log( Level.SEVERE, "Exception during serializing component type: " + component.getClass(), e); } return null; }