public class StringToListConverter extends Object implements org.springframework.core.convert.converter.ConditionalGenericConverter
构造器和说明 |
---|
StringToListConverter() |
限定符和类型 | 方法和说明 |
---|---|
Object |
convert(Object source,
org.springframework.core.convert.TypeDescriptor sourceType,
org.springframework.core.convert.TypeDescriptor targetType) |
Set<org.springframework.core.convert.converter.GenericConverter.ConvertiblePair> |
getConvertibleTypes() |
String |
getEncoding() |
org.springframework.core.convert.converter.ConverterRegistry |
getRegistry() |
void |
init()
初始化
|
static void |
main(String[] args) |
boolean |
matches(org.springframework.core.convert.TypeDescriptor sourceType,
org.springframework.core.convert.TypeDescriptor targetType) |
static void |
parse(String source,
List<String> list,
Map<String,String> map)
使用scriptEngine来执行编译过的json转字符串脚本
|
void |
setEncoding(String encoding) |
void |
setRegistry(org.springframework.core.convert.converter.ConverterRegistry registry) |
public org.springframework.core.convert.converter.ConverterRegistry getRegistry()
public void setRegistry(org.springframework.core.convert.converter.ConverterRegistry registry)
registry
- 注册中心public void init()
public Set<org.springframework.core.convert.converter.GenericConverter.ConvertiblePair> getConvertibleTypes()
getConvertibleTypes
在接口中 org.springframework.core.convert.converter.GenericConverter
public String getEncoding()
public void setEncoding(String encoding)
encoding
- 编码public static void parse(String source, List<String> list, Map<String,String> map)
source
- 待解析的串list
- 如果为数组则将每个item作为string加入到list中map
- 如果为对象则将每个item以key、value形式加入到map中public static void main(String[] args)
public Object convert(Object source, org.springframework.core.convert.TypeDescriptor sourceType, org.springframework.core.convert.TypeDescriptor targetType)
convert
在接口中 org.springframework.core.convert.converter.GenericConverter
public boolean matches(org.springframework.core.convert.TypeDescriptor sourceType, org.springframework.core.convert.TypeDescriptor targetType)
matches
在接口中 org.springframework.core.convert.converter.ConditionalGenericConverter
Copyright © 2014 EPIC Team. All rights reserved.