static int l_Message_setType(lua_State *L) { auto message = lua_tomessage(L, 1); stringType type = luaL_checkstring(L, 2); message->setTypeString(type); return 0; }
JObjectStreamField::JObjectStreamField(JString name,JClass* type,jbool unshared):JObject(getClazz()){ this->name=new JString(name); this->type=type; this->unshared=unshared; this->signature=new JString(type->getSignature()); this->field=NULL; setTypeString(); }
JObjectStreamField::JObjectStreamField():JObject(getClazz()){ this->name=NULL; this->signature=NULL; this->type=NULL; this->unshared=false; this->field=NULL; setTypeString(); }
JObjectStreamField::JObjectStreamField(JField* field,jbool unshared,jbool showType):JObject(getClazz()){ this->field=field; this->unshared=unshared; this->name=field->getName(); JClass* ftype=field->getType(); type=(showType||ftype->isPrimitive()?ftype:JObject::getClazz()); signature=new JString(ftype->getSignature()); setTypeString(); }
JObjectStreamField::JObjectStreamField(JString name,JString signature,jbool unshared):JObject(getClazz()){ this->name=new JString(name); this->signature=new JString(signature); this->unshared=unshared; this->field=NULL; switch(signature.charAt(0)){ case 'Z': type = JPrimitiveBoolean::getClazz(); break; case 'B': type = JPrimitiveByte::getClazz(); break; case 'C': type = JPrimitiveChar::getClazz(); break; case 'S': type = JPrimitiveShort::getClazz(); break; case 'I': type = JPrimitiveInt::getClazz(); break; case 'J': type = JPrimitiveLong::getClazz(); break; case 'F': type = JPrimitiveFloat::getClazz(); break; case 'D': type = JPrimitiveDouble::getClazz(); break; case 'L': case '[': type = JObject::getClazz(); break; default: throw new JIllegalArgumentException("illegal signature"); } setTypeString(); }