/** * Takes the supplied attributes and returns an equivalent set that are ready to be serialized. * Will only return those attributes that are marked as serializable. * * @param attributeHolders the attributes to prepare for serialization * @return an equivalent set of attributes that can be serialized */ public Map<String, Serializable> makeAttributeHoldersSerializable( final Map<String, ? extends AttributeHolder> attributeHolders) { if (!isEnabled()) { return new HashMap<String, Serializable>(); } final Map<String, Serializable> renderedAttributes = new HashMap<String, Serializable>( attributeHolders.size()); for (final Entry<String, ? extends AttributeHolder> entry : attributeHolders.entrySet()) { final AttributeHolder holder = entry.getValue(); if (holder.isSerializable()) { renderedAttributes.put(entry.getKey(), decomposer.decompose(holder)); } } return renderedAttributes; }