This implementation assumes that the converter can convert from each of
its source encodings to each of its target encodings. If this is not the
case, the converter has to override this method.

@param sourceFormat
@return
171915
@Override
    public AudioFormat.Encoding[] getTargetEncodings(AudioFormat sourceFormat) {
        if (isAllowedSourceFormat(sourceFormat)) {
            return getTargetEncodings();
        } else {
            return EMPTY_ENCODING_ARRAY;
        }
    }
1113702
public <T> T convert(Object source, Class<T> toClass) {
        return toClass.cast(source.toString());
    }
844028
function translateFormat(formatString, mapping) {
  let len = formatString.length,
    i = 0,
    beginIndex = -1,
    lastChar = null,
    currentChar = "",
    resultString = "";

  for (; i < len; i++) {
    currentChar = formatString.charAt(i);

    if (lastChar === null || lastChar !== currentChar) {
      // change detected
      resultString = _appendMappedString(formatString, mapping, beginIndex, i, resultString);

      beginIndex = i;
    }

    lastChar = currentChar;
  }

  return _appendMappedString(formatString, mapping, beginIndex, i, resultString);
}
1225454
@Override
    public void addSourceTargetSet(UnicodeSet inputFilter, UnicodeSet sourceSet, UnicodeSet targetSet) {
        SourceTargetUtility cache;
        synchronized (SOURCE_CACHE) {
            //String id = getID();
            cache = SOURCE_CACHE.get(norm2);
            if (cache == null) {
                cache = new SourceTargetUtility(new NormalizingTransform(norm2), norm2);
                SOURCE_CACHE.put(norm2, cache);
            }
        }
        cache.addSourceTargetSet(this, inputFilter, sourceSet, targetSet);
    }
376182
@Override
	public String convert(ObjectType sourceObject)
	{
		if(sourceObject == null)
			return null;
		
		String methodName = null;
		Object value =null;
		StringBuilder csv = new StringBuilder();
		Object[] args = {};
		Method m;

		
		for (Entry<String,Method> entry : this.methods.entrySet())
		{
			m = entry.getValue();
			methodName = m.getName();
			
			if(methodName.equals("getClass"))
				continue;
			
			try
			{
				value = m.invoke(sourceObject, args);
				
				if(csv.length() != 0)
					csv.append(SEPARATOR);
				
				csv.append(QUOTE).append(format(value)).append(QUOTE);
				
			}
			catch (IllegalAccessException|IllegalArgumentException|InvocationTargetException e)
			{
				throw new RuntimeException("Unable to get property for method:"+methodName+" error:"+e.getMessage(),e);
			}
		}
		
		csv.append(NEWLINE);
		
		return csv.toString();
		
	}
102991
public static void transform(Source source, Result result, String charset, int indent) {
		final TransformerFactory factory = TransformerFactory.newInstance();
		try {
			final Transformer xformer = factory.newTransformer();
			if (indent > 0) {
				xformer.setOutputProperty(OutputKeys.INDENT, "yes");
				xformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", String.valueOf(indent));
			}
			if (StrUtil.isNotBlank(charset)) {
				xformer.setOutputProperty(OutputKeys.ENCODING, charset);
			}
			xformer.transform(source, result);
		} catch (Exception e) {
			throw new UtilException(e, "Trans xml document to string error!");
		}
	}
608152
protected GenericDataSourceBase<OUT, ?> translateToDataFlow() {
		String name = this.name != null ? this.name : this.inputFormat.toString();
		if (name.length() > 100) {
			name = name.substring(0, 100);
		}
		
		@SuppressWarnings({ "unchecked", "rawtypes" })
		GenericDataSourceBase<OUT, ?> source = new GenericDataSourceBase(this.inputFormat,
				new OperatorInformation<OUT>(getType()), name);
		source.setDegreeOfParallelism(dop);
		
		return source;
	}
440004
public static IEntitySerializer getSerializer(final String serializeFormat) throws SerializationException {
		IEntitySerializer serializer = null;
		if (isValidSerializeFormat(serializeFormat)) {
			if (serializeFormat.equalsIgnoreCase(XML_SERIALIZE_FORMAT)) {
				serializer = new XMLSerializer();
			} else if (serializeFormat.equalsIgnoreCase(JSON_SERIALIZE_FORMAT)) {
				serializer = new JSONSerializer();
			}
		}
		return serializer;
	}
1270909
public static String getJvmConverter(String encoding) {
    	init();
        //String converter = (String) _converterMap.get(encoding.toLowerCase());
    	String converter = null;
    	com.ibm.wsspi.http.EncodingUtils encodingUtils = com.ibm.ws.webcontainer.osgi.WebContainer.getEncodingUtils();
        if (encodingUtils!=null) {
            converter = encodingUtils.getJvmConverter(encoding);
        }

        if (converter != null) {
            return converter;
        }
        else {
            return encoding;
        }
    }
194745
@SuppressWarnings("resource")
	protected static final String format(final double toFormat) {
		return new Formatter(Locale.US).format(FLOATFORMAT, toFormat)
				.toString();
	}
1359663
@GwtIncompatible("ByteSource,CharSource")
  public final ByteSource decodingSource(final CharSource encodedSource) {
    checkNotNull(encodedSource);
    return new ByteSource() {
      @Override
      public InputStream openStream() throws IOException {
        return decodingStream(encodedSource.openStream());
      }
    };
  }
1010025
public static <T> T convert(Object source, Class<T> destType) {
        return JSON.convertValue(source, destType);
    }
1137246
public static String getExportFormat(RepositoryInfo repoinfo)
            throws Exception {
        String sourceExportFormat = null;
        StringTokenizer stoken =
                new StringTokenizer(repoinfo.getRepositoryVersion(), ".");
        int majorVersion = new Integer(stoken.nextToken()).intValue();
        if (majorVersion < 2) {
            sourceExportFormat = METS_EXT1_0_LEGACY;
        } else {
            sourceExportFormat = repoinfo.getDefaultExportFormat();
        }

        return sourceExportFormat;
    }
1275323
private static String toSource(
      Node root,
      Format outputFormat,
      CompilerOptions options,
      SourceMap sourceMap,
      boolean tagAsTypeSummary,
      boolean tagAsStrict,
      boolean lineBreak,
      CodeGeneratorFactory codeGeneratorFactory) {
    checkState(options.sourceMapDetailLevel != null);

    boolean createSourceMap = (sourceMap != null);
    MappedCodePrinter mcp =
        outputFormat == Format.COMPACT
        ? new CompactCodePrinter(
            lineBreak,
            options.preferLineBreakAtEndOfFile,
            options.lineLengthThreshold,
            createSourceMap,
            options.sourceMapDetailLevel)
        : new PrettyCodePrinter(
            options.lineLengthThreshold,
            createSourceMap,
            options.sourceMapDetailLevel);
    CodeGenerator cg = codeGeneratorFactory.getCodeGenerator(outputFormat, mcp);

    if (tagAsTypeSummary) {
      cg.tagAsTypeSummary();
    }
    if (tagAsStrict) {
      cg.tagAsStrict();
    }

    cg.add(root);
    mcp.endFile();

    String code = mcp.getCode();

    if (createSourceMap) {
      mcp.generateSourceMap(code, sourceMap);
    }

    return code;
  }
232056
public CharSequence format(Formatter formatter) {
    CharSequence input = format();
    return formatter.format(String.valueOf(input));
  }
762482
public static Encoding getJVMEncoding(String jvmEncoding) {
    if ("UTF-8".equals(jvmEncoding)) {
      return new UTF8Encoding();
    }
    if (Charset.isSupported(jvmEncoding)) {
      return new Encoding(jvmEncoding);
    } else {
      return DEFAULT_ENCODING;
    }
  }
105556
public ResourceFormatGenerator getGeneratorForFormat(final String format) throws UnsupportedFormatException {
        try {
            return providerOfType(format);
        } catch (ExecutionServiceException e) {
            throw new UnsupportedFormatException("No provider available to parse format: " + format, e);
        }
    }