| 1 | |
package org.webslinger.ext.image; |
| 2 | |
|
| 3 | |
import java.io.IOException; |
| 4 | |
|
| 5 | 0 | public abstract class AbstractImageDescriptor implements ImageDescriptor { |
| 6 | |
public Object get(String prefix, String name) throws IOException { |
| 7 | 0 | StringBuilder sb = new StringBuilder(); |
| 8 | 0 | char c = name.charAt(0); |
| 9 | 0 | if (prefix == null) { |
| 10 | 0 | sb.append(Character.toLowerCase(c)); |
| 11 | |
} else { |
| 12 | 0 | sb.append(prefix).append(Character.toUpperCase(c)); |
| 13 | |
} |
| 14 | 0 | sb.append(name.substring(1)); |
| 15 | 0 | return get(sb.toString()); |
| 16 | |
} |
| 17 | |
|
| 18 | |
protected abstract Object get(String name) throws IOException; |
| 19 | |
} |