Returns the deserialized element data.<p>

@param data the data to deserialize

@return the container element
@throws SerializationException if deserialization fails
507502
public CmsContainer getSerializedContainer(String data) throws SerializationException {

        return (CmsContainer)CmsRpcPrefetcher.getSerializedObjectFromString(getContainerpageService(), data);
    }
260592
public static String getMimeType(final byte[] data) {
		String mimeType = null;
		try {
			mimeType = MimeUtil.getMagicMimeType(data);
		} catch (final Exception e) {
		} finally {
			if (mimeType == null) {
				mimeType = UNKNOWN_MIME_TYPE;
			}
		}
		return mimeType;
	}
292476
protected JSONObject elementToJson(CmsContainerElementBean element, Set<String> excludeSettings) {

        JSONObject data = null;
        try {
            data = new JSONObject();
            data.put(FavListProp.ELEMENT.name().toLowerCase(), element.getId().toString());
            if (element.getFormatterId() != null) {
                data.put(FavListProp.FORMATTER.name().toLowerCase(), element.getFormatterId().toString());
            }
            JSONObject properties = new JSONObject();
            for (Map.Entry<String, String> entry : element.getIndividualSettings().entrySet()) {
                String settingKey = entry.getKey();
                if (!excludeSettings.contains(settingKey)) {
                    properties.put(entry.getKey(), entry.getValue());
                }
            }
            data.put(FavListProp.PROPERTIES.name().toLowerCase(), properties);
        } catch (JSONException e) {
            // should never happen
            if (!LOG.isDebugEnabled()) {
                LOG.warn(e.getLocalizedMessage());
            }
            LOG.debug(e.getLocalizedMessage(), e);
            return null;
        }
        return data;
    }
869038
protected final SerializedData serialize(final SerializedDataType type, final Object data) {
        return EscSpiUtils.serialize(serRegistry, type, data);
    }
34532
public static String serialize(Element element) {
        Writer sw = new StringBuilderWriter();
        serialize(new DOMSource(element), sw);
        return sw.toString();
    }
874694
private function deserializeData($data)
    {
        $result = $this->get('jms_serializer')->deserialize(
            $data,
            $this->getTargetGroupRepository()->getClassName(),
            'json',
            DeserializationContext::create()
                ->setSerializeNull(true)
        );

        return $result;
    }
111956
@Nullable protected String encode(@Nullable byte[] data) {
    return data == null ? null : Base64.getUrlEncoder().encodeToString(data);
  }
1054990
@SuppressWarnings("Unchecked class type")
    @Override
    public <T> T deserialize(@Nullable ByteBuffer data) {
        if (data == null) {
            return null;
        }

        Object deserializedObject = columnDataType.deserialize(data, ProtocolVersion.NEWEST_SUPPORTED);

        return (T) deserializedObject;
    }
414754
public List<Card> parseData(@Nullable T data) {
        List<Card> cardList = mDataParser.parseGroup(data, this);
        MVHelper mvHelper = (MVHelper) mServices.get(MVHelper.class);
        if (mvHelper != null) {
            mvHelper.renderManager().onDownloadTemplate();
        }
        return cardList;
    }
609890
protected void setInheritContainerData(Map<String, CmsContainerElementData> elementsData) {

        m_elementData = elementsData.get(getGroupContainerWidget().getId());
        if (m_elementData != null) {
            m_inputDescription.setFormValueAsString(m_elementData.getDescription());
            m_inputTitle.setFormValueAsString(m_elementData.getTitle());
            removeAllChildren();
            CmsContainerpageUtil util = getController().getContainerpageUtil();
            for (CmsInheritanceInfo info : m_elementData.getInheritanceInfos()) {
                if (info.isVisible()) {
                    CmsContainerElementData element = getController().getCachedElement(info.getClientId());
                    try {
                        CmsContainerPageElementPanel elementWidget = util.createElement(
                            element,
                            getGroupContainerWidget(),
                            false);
                        elementWidget.setInheritanceInfo(info);
                        setOptionBar(elementWidget);
                        getGroupContainerWidget().add(elementWidget);
                    } catch (Exception e) {
                        CmsDebugLog.getInstance().printLine(e.getMessage());
                    }
                }
            }
            boolean hasInvisible = false;
            for (CmsInheritanceInfo info : m_elementData.getInheritanceInfos()) {
                if (!info.isVisible()) {
                    CmsContainerElementData element = getController().getCachedElement(info.getClientId());
                    try {
                        CmsContainerPageElementPanel elementWidget = util.createElement(
                            element,
                            getGroupContainerWidget(),
                            false);
                        elementWidget.setInheritanceInfo(info);
                        elementWidget.addStyleName(HIDDEN_ELEMENT_CLASS);
                        setOptionBar(elementWidget);
                        getGroupContainerWidget().add(elementWidget);
                        Element elementOverlay = DOM.createDiv();
                        elementOverlay.setClassName(HIDDEN_ELEMENT_OVERLAY_CLASS);
                        elementWidget.getElement().appendChild(elementOverlay);
                        hasInvisible = true;
                    } catch (Exception e) {
                        CmsDebugLog.getInstance().printLine(e.getMessage());
                    }
                }
            }
            if (hasInvisible) {
                m_showElementsButton.enable();
            }
        }

        getGroupContainerWidget().refreshHighlighting();
        setSaveEnabled(true, null);
    }
421128
public <T> JSONAPIDocument<T> readDocument(byte[] data, Class<T> clazz) {
		return readDocument(new ByteArrayInputStream(data), clazz);
	}
1218378
public static Data toHeapData(Data data) {
        if (data == null || data instanceof HeapData) {
            return data;
        }
        return new HeapData(data.toByteArray());
    }
1248931
protected CmsContainerElementBean elementFromJson(JSONObject data) throws JSONException {

        CmsUUID element = new CmsUUID(data.getString(FavListProp.ELEMENT.name().toLowerCase()));
        CmsUUID formatter = null;
        if (data.has(FavListProp.FORMATTER.name().toLowerCase())) {
            formatter = new CmsUUID(data.getString(FavListProp.FORMATTER.name().toLowerCase()));
        }
        Map<String, String> properties = new HashMap<String, String>();

        JSONObject props = data.getJSONObject(FavListProp.PROPERTIES.name().toLowerCase());
        Iterator<String> keys = props.keys();
        while (keys.hasNext()) {
            String key = keys.next();
            properties.put(key, props.getString(key));
        }

        return new CmsContainerElementBean(element, formatter, properties, false);
    }
731850
public static byte[] decode(String data) {
	// TODO: when we move to Java 8 change to
	// https://docs.oracle.com/javase/8/docs/api/java/util/Base64.Decoder.html
	return org.apache.commons.codec.binary.Base64.decodeBase64(data);
    }
502614
private ExprString structElement(Data data) throws TemplateException {
	comments(data);
	ExprString name = data.factory.toExprString(assignOp(data));
	if (name instanceof LitString) ((LitString) name).fromBracket(true);
	comments(data);
	return name;
    }
452189
public T deserialize(Source source) {
    try {
      Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
      JAXBElement<T> jaxbElement = unmarshaller.unmarshal(source, clazz);
      return jaxbElement.getValue();
    } catch (JAXBException e) {
      throw new SerializationException(
          String.format("Could not deserialize %s object from source %s.", clazz, source), e);
    }
  }
1332024
private String jsonifyData(Map<String, ? extends Object> data) {
        JSONObject jsonData = new JSONObject(data);

        return jsonData.toString();
    }