public Object decode(String data) throws DataDecodeException { try { return Charset.forName(data); } catch(UnsupportedCharsetException e) { throw new DataDecodeException("Unsupported character set '" + data + "'."); } } }
public Object decode(String data) throws DataDecodeException { try { return Charset.forName(data); } catch(UnsupportedCharsetException e) { throw new DataDecodeException("Unsupported character set '" + data + "'."); } } }
public Object decode(String data) throws DataDecodeException { try { return Charset.forName(data); } catch(UnsupportedCharsetException e) { throw new DataDecodeException("Unsupported character set '" + data + "'."); } } }
private static DataDecoder newInstance(Class decoderType) throws DataDecodeException { try { return (DataDecoder) decoderType.newInstance(); } catch (ClassCastException e) { throw new DataDecodeException("Class '" + decoderType.getName() + "' is not a valid DataDecoder. It doesn't implement " + DataDecoder.class.getName()); } catch (IllegalAccessException e) { throw new DataDecodeException("Failed to load DataDecoder Class '" + decoderType.getName() + "'.", e); } catch (InstantiationException e) { throw new DataDecodeException("Failed to load DataDecoder Class '" + decoderType.getName() + "'.", e); } } }
public Object decode(String data) throws DataDecodeException { try { return new File(data); } catch (Exception e) { throw new DataDecodeException("Unable to decode '" + data + "' as a "+ File.class.getName() + " instance.", e); } } }
private static DataDecoder newInstance(Class decoderType) throws DataDecodeException { try { return (DataDecoder) decoderType.newInstance(); } catch (ClassCastException e) { throw new DataDecodeException("Class '" + decoderType.getName() + "' is not a valid DataDecoder. It doesn't implement " + DataDecoder.class.getName()); } catch (IllegalAccessException e) { throw new DataDecodeException("Failed to load DataDecoder Class '" + decoderType.getName() + "'.", e); } catch (InstantiationException e) { throw new DataDecodeException("Failed to load DataDecoder Class '" + decoderType.getName() + "'.", e); } } }
private static DataDecoder newInstance(Class decoderType) throws DataDecodeException { try { return (DataDecoder) decoderType.newInstance(); } catch (ClassCastException e) { throw new DataDecodeException("Class '" + decoderType.getName() + "' is not a valid DataDecoder. It doesn't implement " + DataDecoder.class.getName()); } catch (IllegalAccessException e) { throw new DataDecodeException("Failed to load DataDecoder Class '" + decoderType.getName() + "'.", e); } catch (InstantiationException e) { throw new DataDecodeException("Failed to load DataDecoder Class '" + decoderType.getName() + "'.", e); } } }
public Object decode(String data) throws DataDecodeException { Matcher binaryMatcher = BINARY_PATTERN.matcher(data); if (binaryMatcher.matches()) { return data; } else { throw new DataDecodeException("Failed to decode binary sequence '" + data + "'."); } } }
public Object decode(String data) throws DataDecodeException { try { return Byte.parseByte(data.trim()); } catch(NumberFormatException e) { throw new DataDecodeException("Failed to decode Byte value '" + data + "'.", e); } } }
public Object decode(String data) throws DataDecodeException { try { return new URI(data.trim()); } catch (URISyntaxException e) { throw new DataDecodeException("Failed to decode URI value '" + data + "'.", e); } } }
public Object decode(String data) throws DataDecodeException { try { // Must be sync'd - DateFormat is not synchronized. synchronized(decoder) { return decoder.parse(data.trim()); } } catch (ParseException e) { throw new DataDecodeException("Error decoding Date data value '" + data + "' with decode format '" + format + "'.", e); } }
public Object decode(String data) throws DataDecodeException { Matcher binaryMatcher = BINARY_PATTERN.matcher(data); if (binaryMatcher.matches()) { return data; } else { throw new DataDecodeException("Failed to decode binary sequence '" + data + "'."); } } }
public Object decode(String data) throws DataDecodeException { try { return new File(data); } catch (Exception e) { throw new DataDecodeException("Unable to decode '" + data + "' as a "+ File.class.getName() + " instance.", e); } } }
public Object decode(String data) throws DataDecodeException { try { return new URL(data.trim()); } catch (MalformedURLException e) { throw new DataDecodeException("Failed to decode URL value '" + data + "'.", e); } } }
public Object decode(String data) throws DataDecodeException { try { // Must be sync'd - DateFormat is not synchronized. synchronized(decoder) { return decoder.parse(data.trim()); } } catch (ParseException e) { throw new DataDecodeException("Error decoding Date data value '" + data + "' with decode format '" + format + "'.", e); } }
public Object decode(String data) throws DataDecodeException { try { return new URL(data.trim()); } catch (MalformedURLException e) { throw new DataDecodeException("Failed to decode URL value '" + data + "'.", e); } } }
public Object decode(String data) throws DataDecodeException { try { return new File(data); } catch (Exception e) { throw new DataDecodeException("Unable to decode '" + data + "' as a "+ File.class.getName() + " instance.", e); } } }
public Object decode(String data) throws DataDecodeException { try { return new URI(data.trim()); } catch (URISyntaxException e) { throw new DataDecodeException("Failed to decode URI value '" + data + "'.", e); } } }
public Object decode(String data) throws DataDecodeException { try { // Must be sync'd - DateFormat is not synchronized. synchronized(decoder) { return decoder.parse(data.trim()); } } catch (ParseException e) { throw new DataDecodeException("Error decoding Date data value '" + data + "' with decode format '" + format + "'.", e); } }
public Object decode(String data) throws DataDecodeException { try { return Byte.parseByte(data.trim()); } catch(NumberFormatException e) { throw new DataDecodeException("Failed to decode Byte value '" + data + "'.", e); } } }