DefaultImageConverter.java
1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.scene7.is.util.Converter
* com.scene7.is.util.converters.IdentityConverter
* com.scene7.is.util.text.ParsingException
* org.apache.commons.beanutils.ConversionException
* org.jetbrains.annotations.NotNull
*/
package com.scene7.is.ps.provider.parsers;
import com.scene7.is.ps.provider.Util;
import com.scene7.is.util.Converter;
import com.scene7.is.util.converters.IdentityConverter;
import com.scene7.is.util.text.ParsingException;
import org.apache.commons.beanutils.ConversionException;
import org.jetbrains.annotations.NotNull;
public class DefaultImageConverter
extends Converter<String, String> {
private static final Converter<String, String> INSTANCE = new DefaultImageConverter();
private static final Converter<String, String> IDENTITY_CONVERTER = IdentityConverter.identityConverter(String.class);
@NotNull
public static Converter<String, String> defaultImageConverter() {
return INSTANCE;
}
@NotNull
public String convert(@NotNull String value) throws ConversionException {
try {
if (Util.isInvalidPath(value)) {
throw new ParsingException(1, value, null);
}
return (String)IDENTITY_CONVERTER.convert((Object)value);
}
catch (ParsingException e) {
throw new ConversionException((Throwable)e);
}
}
@NotNull
public String revert(@NotNull String value) throws ConversionException {
return (String)IDENTITY_CONVERTER.revert((Object)value);
}
private DefaultImageConverter() {
super(String.class, String.class);
}
}