function httpHttp() { $object = ""; if ($this->isListMode === false) { $result = $this->httpResult(); if ($this->element->gson === false) { $object = $this->httpObject(); } } else { $result = $this->httpResultList(); if ($this->element->gson === false) { $object = $this->httpObjectList(); } } $HttpKey = $this->getHttpKey(); $note = parent::getNoteFormat(); $http = $HttpKey[DataHttpElement::HTTP_KEY_HTTP]; $http = parent::getFileContents($http); $http = str_replace(Element::FORMAT_CLASS, $this->name, $http); $data = ""; $params = ""; if (is_array($this->value)) { foreach ($this->value as $key => $value) { $element = $this->getElement(); $element->initElement($key, $value, $this->getNoteElement($key)); $data = $data . $element->http(); if ($element->type != DataHttpElement::HTTP_KEY_FILE) { $params .= " + \"&{$key}=\" + m" . ucfirst($element->name); } } } $data .= $result . $object; $http = str_replace(Element::FORMAT_DATA, $data, $http); $url = $this->element->url; $http = str_replace(DataHttpElement::HTTP_URL, $url, $http); $http = str_replace(DataHttpElement::HTTP_PARAMS, $params, $http); $post = $this->element->post; if ($post === false) { $http = str_replace(DataHttpElement::HTTP_POST, "false", $http); } else { $http = str_replace(DataHttpElement::HTTP_POST, "true", $http); } $cookie = $this->element->cookie; if ($cookie === false) { $http = str_replace(DataHttpElement::HTTP_COOKIE, "false", $http); } else { $http = str_replace(DataHttpElement::HTTP_COOKIE, "true", $http); } $getcookie = $this->element->getcookie; if ($getcookie === false) { $http = str_replace(DataHttpElement::HTTP_GETCOOKIE, "false", $http); } else { $http = str_replace(DataHttpElement::HTTP_GETCOOKIE, "true", $http); } $tab = $this->element->tab; if (empty($tab)) { $http = str_replace(DataHttpElement::HTTP_TAB, "null", $http); } else { $http = str_replace(DataHttpElement::HTTP_TAB, "\"{$tab}\"", $http); } $http = str_replace(Element::FORMAT_NOTE, $note, $http); $http = str_replace(Element::FORMAT_VERSION, $this->version, $http); $header = str_replace(Element::FORMAT_DATA_KEY, $this->base_name, JAVA_NATIVE_HTTP_HEAD); $result = $header . $http; $fileurl = $this->getFileUrl($result, $this->name . ".java"); return $result; }
function formatStatic($key) { if (!is_array($this->dictionary)) { /**没有静态区间标注*/ return ""; } $StaticKey = $this->getStaticKey(); if (!array_key_exists($key, $StaticKey)) { return ""; } $static = $StaticKey[$key]; $static = parent::getFileContents($static); $result = ""; foreach ($this->dictionary as $value => $note) { $name = $value; if ($this->note_type == self::NOTE_TYPE_AUTO && $key != Element::TYPE_KEY_STRING && !empty($note)) { $az = language_new_az($note); if (!empty($az) && preg_match("/^[a-zA-Z\\s]+\$/", $az)) { $name = $az; } } $name = self::FORMAT_STATIC . strtoupper("_" . $this->name . "_{$name}"); $data = str_replace(Element::FORMAT_NOTE, $note, $static); $data = str_replace(Element::FORMAT_CLASS, $name, $data); $data = str_replace(Element::FORMAT_DATA_KEY, strval($value), $data); $result .= $data; } return $result; }