Serialize this user definition into a UNode tree.

@return  Root {@link UNode} of the serialized tree.
775675
public UNode toDoc() {
        UNode userNode = UNode.createMapNode(m_userID, "user");
        if (!Utils.isEmpty(m_password)) {
            userNode.addValueNode("password", m_password, true);
        }
        if (!Utils.isEmpty(m_hash)) {
            userNode.addValueNode("hash", m_hash, true);
        }
        String permissions = "ALL";
        if (m_permissions.size() > 0) {
            permissions = Utils.concatenate(m_permissions, ",");
        }
        userNode.addValueNode("permissions", permissions);
        return userNode;
    }
713356
private ObjectMapper createObjectMapperWithRootUnWrap() {
        ObjectMapper mapper = new ObjectMapper();
        mapper.configure(DeserializationFeature.UNWRAP_ROOT_VALUE, true);
        mapper.addHandler(new CustomDeserializationProblemHandler());
       
        
        mapper.registerModule(new JodaModule());
        return mapper;
    }
1276467
public StringBuffer serializeBundles() {
		StringBuffer sb = new StringBuffer("{");

		// Iterates over the
		for (Iterator<String> it = keyMap.keySet().iterator(); it.hasNext();) {
			String currentKey = it.next();
			handleKey(sb, keyMap, currentKey, currentKey, !it.hasNext());
		}

		return sb.append("}");
	}
25647
async def root(self):
        
        if self.writing:
            await self.iobj.awrite(binascii.unhexlify(b'011673657269616c697a6174696f6e3a3a617263686976650000'))

        else:
            hdr = bytearray(2)
            await self.iobj.areadinto(hdr)
            if hdr != bytearray(b'\x01\x16'):
                raise ValueError('Unsupported header')

            hdr = bytearray(22)
            await self.iobj.areadinto(hdr)
            if hdr != bytearray(b'serialization::archive'):
                raise ValueError('Unrecognized magic header')

            tra = await load_uvarint(self.iobj)
            ver = await load_uvarint(self.iobj)
            if tra != 0:
                raise ValueError('Tracking not supported')
1079623
private void readRoot() throws IOException {
        if (root != null) {
            return;
        }
        final ByteArrayOutputStream content = new ByteArrayOutputStream();
        final byte[] buffer = new byte[READ_BUFFER_SIZE];
        try {
            while (trans_.read(buffer, 0, READ_BUFFER_SIZE) > 0) {
                content.write(buffer);
            }
        } catch (TTransportException e) {
            if (TTransportException.END_OF_FILE != e.getType()) {
                throw new IOException(e);
            }
        }
        root = OBJECT_MAPPER.readTree(content.toByteArray());
    }
1101610
private Unmarshaller getUnMarshaller(final MarshallerFactory marshallerFactory, final ClassResolver classResolver)
            throws IOException {
        final MarshallingConfiguration marshallingConfiguration = new MarshallingConfiguration();
        marshallingConfiguration.setVersion(2);
        marshallingConfiguration.setClassResolver(classResolver);
        return marshallerFactory.createUnmarshaller(marshallingConfiguration);
    }
1091912
public ByteBuffer serialize () {

        final int size = uncroppedSize();
        if (size == 0) return ByteBuffer.allocate(0);// empty data segment

        // calculate sense length
        int senseLength;
        if (senseData == null)
            senseLength = 0;
        else
            senseLength = senseData.size();

        // allocate buffer of appropriate size
        final ByteBuffer buffer = ByteBuffer.allocate(size);

        // write sense length field
        ReadWrite.writeTwoByteInt(buffer,// buffer
                senseLength,// value
                0);// index

        // write sense data
        if (senseData != null) senseData.serialize(buffer, SENSE_LENGTH_FIELD_LENGTH);

        // write and SCSI response data
        if (responseData != null) responseData.serialize(buffer, SENSE_LENGTH_FIELD_LENGTH + senseLength);

        if (allocationLength > 0 && buffer.capacity() > allocationLength) {
            /*
             * If the allocation length variable is valid and the response data segment is larger than the data-in
             * buffer allocated by the initiator, limit the number of bytes returned.
             */
            buffer.position(0);
            buffer.limit(allocationLength);
            final ByteBuffer croppedBuffer = ByteBuffer.allocate(allocationLength);
            croppedBuffer.put(buffer);
            return croppedBuffer;
        }

        if (LOGGER.isDebugEnabled()) LOGGER.debug("SCSI Response Data Segment:\n" + Debug.byteBufferToString(buffer));

        return buffer;
    }
472523
JcrNodeDefinition getRootNodeDefinition() throws NoSuchNodeTypeException, RepositoryException {
        NodeTypes nodeTypes = nodeTypes();
        for (NodeDefinition definition : nodeTypes.getNodeType(ModeShapeLexicon.ROOT).getChildNodeDefinitions()) {
            if (definition.getName().equals(JcrNodeType.RESIDUAL_ITEM_NAME)) return (JcrNodeDefinition)definition;
        }

        assert false; // should not get here
        return null;
    }
372795
public Exception getRootCause() {
		if (exception instanceof ServiceLocatorException) {
			return ((ServiceLocatorException) exception).getRootCause();
		}
		return exception == null ? this : exception;
	}
134919
Map<String, Object> serialize() {

		final Map<String, Object> map = new TreeMap<>();

		map.put(JsonSchema.KEY_DEFINITIONS, typeDefinitions.serialize());
		map.put(JsonSchema.KEY_METHODS, globalMethods.serialize());
		map.put(JsonSchema.KEY_ID, getId());

		return map;
	}
177166
private Node getUserNode(Session session, UserImpl user) throws RepositoryException
   {
      if (user.getInternalId() != null)
      {
         return session.getNodeByUUID(user.getInternalId());
      }
      else
      {
         return utils.getUserNode(session, user.getUserName());
      }
   }
714597
public void parse(UNode userNode) {
        m_userID = userNode.getName();
        m_password = null;
        m_permissions.clear();
        
        for (String childName : userNode.getMemberNames()) {
            UNode childNode = userNode.getMember(childName);
            switch (childNode.getName()) {
            case "password":
                Utils.require(childNode.isValue(), "'password' must be a simple value: " + childNode);
                m_password = childNode.getValue();
                break;
                
            case "hash":
                Utils.require(childNode.isValue(), "Invalid 'hash' value");
                m_hash = childNode.getValue();
                break;
                
            case "permissions":
                Utils.require(childNode.isValue(), "'permissions' must be a list of values: " + childNode);
                String[] permissions = childNode.getValue().split(",");
                for (String permission : permissions) {
                    String permToken = permission.toUpperCase().trim();
                    try {
                        m_permissions.add(Permission.valueOf(permToken));
                    } catch (IllegalArgumentException e) {
                        Utils.require(false, "Unrecognized permission: %s; allowed values are: %s",
                                      permToken, Arrays.asList(Permission.values()).toString());
                    }
                }
                break;
                
            default:
                Utils.require(false, "Unknown 'user' property: " + childNode);
            }
        }
    }
781038
protected CmsObject getRootCmsObject() {

        if (m_rootCms == null) {

            m_rootCms = getOfflineCmsObject(A_CmsUI.getCmsObject());
            m_rootCms.getRequestContext().setSiteRoot("");

        }
        return m_rootCms;
    }
995755
public UNode toDoc() {
        // Root node is map with 1 child per result field and optionally "docs".
        UNode result = UNode.createMapNode("batch-result");
        for (String fieldName : m_resultFields.keySet()) {
            result.addValueNode(fieldName, m_resultFields.get(fieldName));
        }
        if (m_objResultList.size() > 0) {
            UNode docsNode = result.addArrayNode("docs");
            for (ObjectResult objResult : m_objResultList) {
                docsNode.addChildNode(objResult.toDoc());
            }
        }
        return result;
    }
1037048
@Nonnull
  public final ITEMTYPE createRoot ()
  {
    final ITEMTYPE aItem = internalCreateRoot ();
    return addToItemStore (aItem.getGlobalUniqueDataID (), aItem);
  }
986368
Map<String, Object> serialize() {

		final Map<String, Object> map = new TreeMap<>();

		for (final StructrTypeDefinition type : typeDefinitions) {

			map.put(type.getName(), type.serialize());
		}

		return map;
	}
647542
private ExtendedNode getUsersStorageNode() throws RepositoryException
   {
      Session session = service.getStorageSession();
      try
      {
         return (ExtendedNode)utils.getUsersStorageNode(service.getStorageSession());
      }
      finally
      {
         session.logout();
      }
   }