Support clos class parse and encode

Support clos class parse and encode.