Package io.microsphere.convert
Class StringToInputStreamConverter
- java.lang.Object
-
- io.microsphere.convert.AbstractConverter<java.lang.String,java.io.InputStream>
-
- io.microsphere.convert.StringToInputStreamConverter
-
- All Implemented Interfaces:
Converter<java.lang.String,java.io.InputStream>,StringConverter<java.io.InputStream>,Prioritized,java.lang.Comparable<Prioritized>
public class StringToInputStreamConverter extends AbstractConverter<java.lang.String,java.io.InputStream> implements StringConverter<java.io.InputStream>
The class to convertStringtoInputStream- Since:
- 1.0.0
- Author:
- Mercy
-
-
Field Summary
Fields Modifier and Type Field Description static StringToInputStreamConverterINSTANCESingleton instance ofStringToInputStreamConverter.-
Fields inherited from class io.microsphere.convert.AbstractConverter
logger
-
Fields inherited from interface io.microsphere.lang.Prioritized
COMPARATOR, MAX_PRIORITY, MIN_PRIORITY, NORMAL_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description StringToInputStreamConverter()StringToInputStreamConverter(java.lang.String encoding)StringToInputStreamConverter(java.nio.charset.Charset charset)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.io.InputStreamdoConvert(java.lang.String source)Converts the non-null source-typed value to the target-typed value.java.nio.charset.CharsetgetCharset()Get theCharset-
Methods inherited from class io.microsphere.convert.AbstractConverter
convert, equals, getPriority, hashCode, resolvePriority
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.microsphere.convert.Converter
accept, convert, getSourceType, getTargetType
-
Methods inherited from interface io.microsphere.lang.Prioritized
compareTo, getPriority
-
-
-
-
Field Detail
-
INSTANCE
public static final StringToInputStreamConverter INSTANCE
Singleton instance ofStringToInputStreamConverter.
-
-
Method Detail
-
doConvert
protected java.io.InputStream doConvert(java.lang.String source)
Description copied from class:AbstractConverterConverts the non-null source-typed value to the target-typed value.This method is called by
AbstractConverter.convert(Object)after checking if the source is null. Subclasses must implement this method to provide the actual conversion logic.- Specified by:
doConvertin classAbstractConverter<java.lang.String,java.io.InputStream>- Parameters:
source- the non-null source-typed value- Returns:
- the converted target-typed value, or
nullif conversion is not possible
-
getCharset
@Nonnull public java.nio.charset.Charset getCharset()
Get theCharset- Returns:
- the
Charset
-
-