Build i18n resource PROPERTIES.
@return JSON
@throws IOException
3068
public String getI18nPropertiesString() throws IOException {
    // Load all properties
    Properties i18nProps = new Properties();

    // add entries
    for (Entry<String, String> entry : properties.entrySet()) {
      String key = entry.getKey();
      String escapedKey = validName(key);
      i18nProps.put(escapedKey, entry.getValue());
    }

    try (ByteArrayOutputStream outStream = new ByteArrayOutputStream()) {
      i18nProps.store(outStream, null);
      // Property files are always ISO 8859 encoded
      return outStream.toString(CharEncoding.ISO_8859_1);
    }
  }
423530
protected Dictionary getDictionary() throws IOException {
    Dictionary dict = this.dictionary;
    if (dict == null) {
      synchronized (this) {
        dict = this.dictionary;
        if (dict == null) {
          URL url = JLanguageTool.getDataBroker().getFromResourceDirAsUrl(resourceFileName);
          this.dictionary = dict = Dictionary.read(url);
        }
      }
    }
    return dict;
  }
381532
private function packageJSON() {
        return new JsonObject(
            trim(substr($this->stream, 0, ++$this->cursor)),
            ++$this->object_num
        );
    }
986105
public function generateJson()
    {
        $sourceMap = array();
        $mappings  = $this->generateMappings();

        // File version (always the first entry in the object) and must be a positive integer.
        $sourceMap['version'] = self::VERSION;

        // An optional name of the generated code that this source map is associated with.
        $file = $this->options['sourceMapFilename'];

        if ($file) {
            $sourceMap['file'] = $file;
        }

        // An optional source root, useful for relocating source files on a server or removing repeated values in the
        // 'sources' entry. This value is prepended to the individual entries in the 'source' field.
        $root = $this->options['sourceRoot'];

        if ($root) {
            $sourceMap['sourceRoot'] = $root;
        }

        // A list of original sources used by the 'mappings' entry.
        $sourceMap['sources'] = array();

        foreach ($this->sources as $source_uri => $source_filename) {
            $sourceMap['sources'][] = $this->normalizeFilename($source_filename);
        }

        // A list of symbol names used by the 'mappings' entry.
        $sourceMap['names'] = array();

        // A string with the encoded mapping data.
        $sourceMap['mappings'] = $mappings;

        if ($this->options['outputSourceFiles']) {
            // An optional list of source content, useful when the 'source' can't be hosted.
            // The contents are listed in the same order as the sources above.
            // 'null' may be used if some original sources should be retrieved by name.
            $sourceMap['sourcesContent'] = $this->getSourcesContent();
        }

        // less.js compat fixes
        if (count($sourceMap['sources']) && empty($sourceMap['sourceRoot'])) {
            unset($sourceMap['sourceRoot']);
        }

        return json_encode($sourceMap);
    }
1251079
protected String getI18n(final String aMessageKey, final Object... aObjArray) {
        final String[] strings = new String[aObjArray.length];

        for (int index = 0; index < aObjArray.length; index++) {
            if (aObjArray[index] instanceof File) {
                strings[index] = ((File) aObjArray[index]).getAbsolutePath();
            } else {
                strings[index] = aObjArray[index].toString();
            }
        }

        return StringUtils.normalizeWS(myBundle.get(aMessageKey, strings));
    }
689666
public function getResources()
    {
        $data = $this->executeJson(sprintf('project/%s/resources/', $this->ensureParameter('slug')));

        $resources = array();
        foreach ($data as $entry) {
            $resource = new TranslationResource($this->getTransport());
            $resource->setProject($this);
            $resource->setFromResult($entry);
            $resources[$resource->getSlug()] = $resource;
        }

        return $resources;
    }
212430
public JSONObject toJSON() {
        try {
            return new JSONObject(properties).putOpt("name", getName());
        } catch (JSONException e) {
            e.printStackTrace();
            Log.e(TAG, e, "toJSON()");
            throw new RuntimeAssertion("NodeEntry.toJSON() failed for '%s'", this);
        }
    }
1334818
@Override
	public PropertyDocument build() {
		prepareBuild();
		return factory.getPropertyDocument(
				(PropertyIdValue) this.entityIdValue, this.labels,
				this.descriptions, this.aliases, getStatementGroups(),
				this.datatype, this.revisionId);
	}
1368696
public function elfinderLocalizationsAsJson()
    {
        $i18n = [];

        foreach ($this->localizations() as $id => $translations) {
            foreach ($translations->data() as $language => $message) {
                $i18n[$language][$id] = $message;
            }
        }

        return json_encode($i18n, (JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_UNICODE));
    }
58411
JSONObject toJson() {
        JSONObject ret = new JSONObject();
        ret.put("type",type.name());
        if (targetConfig != null) {
            ret.put("target",targetConfig.toJson());
        }
        return ret;
    }
970803
public JSONObject toJson() throws IOException, JSONException {
    JSONObject json = new JSONObject();

    for (CapabilityInstance option : options.values()) {
      Object value = option.getValue();

      if (value == null) {
        continue;
      }

      if (value instanceof OperaProfile) {
        value = ((OperaProfile) value).toJson();
      } else if (value instanceof OperaArguments && ((OperaArguments) value).size() > 0) {
        value = ((OperaArguments) value).toJson();
      } else if (value instanceof Boolean) {
        value = (Boolean) value ? 1 : 0;
      } else {
        value = String.valueOf(value);
      }

      json.put(option.getIdentifier(), value);
    }

    return json;
  }
1095382
public function Build()
    {
        $obj           = new \stdClass();
        $obj->metadata = $this->metadata;
        $obj->contents = $this->contents;

        return \json_encode($obj);
    }
1331039
private I18nReader getI18nReader(File sourceFile) throws MojoFailureException {
    String extension = FileUtils.getExtension(sourceFile.getName());
    if (StringUtils.equalsIgnoreCase(extension, FILE_EXTENSION_PROPERTIES)) {
      return new PropertiesI18nReader();
    }
    if (StringUtils.equalsIgnoreCase(extension, FILE_EXTENSION_XML)) {
      return new XmlI18nReader();
    }
    if (StringUtils.equalsIgnoreCase(extension, FILE_EXTENSION_JSON)) {
      return new JsonI18nReader();
    }
    throw new MojoFailureException("Unsupported file extension '" + extension + "': " + sourceFile.getAbsolutePath());
  }
1159917
private function properties(): Properties
    {
        static $properties = null;
        if (null === $properties) {
            $properties = new Properties();
            foreach ($this->resourceLoader->availableResourceUris('input/error/message.ini') as $resourceUri) {
                $properties = $properties->merge(Properties::fromFile($resourceUri));
            }
        }

        return $properties;
    }
1096536
public JsonObject toJson() {
        final JsonObjectBuilder builder = Json.createObjectBuilder();
        builder.add(EL_DATA_TYPE, dataType);
        builder.add(EL_DATA_CONTENT_TYPE, dataContentTypeStr);
        if (meta == null) {
            return builder.build();
        }
        builder.add(EL_META_TYPE, metaType);
        builder.add(EL_META_CONTENT_TYPE, metaContentTypeStr);
        if (meta instanceof JsonObject) {
            final JsonObject jo = (JsonObject) meta;
            return builder.add(metaType, jo).build();
        }
        if (meta instanceof ToJsonCapable) {
            final ToJsonCapable tjc = (ToJsonCapable) meta;
            return builder.add(metaType, tjc.toJson()).build();
        }
        if (meta instanceof Base64Data) {
            final Base64Data base64data = (Base64Data) meta;
            return builder.add(metaType, base64data.getEncoded()).build();
        }
        throw new IllegalStateException("Unknown meta object type: " + meta.getClass());
    }
614649
@Override
  public DataWriter<Object> build() throws IOException {
    return new MetadataWriterWrapper<byte[]>(new SimpleDataWriter(this, this.destination.getProperties()),
        byte[].class,
        this.branches,
        this.branch,
        this.destination.getProperties());
  }
698919
public JSONObject toJSON() {
        JSONObject ret = new JSONObject();
        ret.put("url", url);
        if (env != null) {
            ret.put("env", env);
        }
        return ret;
    }