public Object decodeValue(String value) throws ParameterDecodeException { Properties properties = new Properties(); try { properties.load(new ByteArrayInputStream(value.getBytes("UTF-8"))); } catch (UnsupportedEncodingException e) { throw new ParameterDecodeException("Unexpected error. 'UTF-8' is not a supported character encoding.", e); } catch (IOException e) { throw new ParameterDecodeException("Unexpected error. Unable to read ByteArrayInputStream based stream.", e); } return properties; }
public Object decodeValue(String value) throws ParameterDecodeException { Properties properties = new Properties(); try { properties.load(new ByteArrayInputStream(value.getBytes("UTF-8"))); } catch (UnsupportedEncodingException e) { throw new ParameterDecodeException("Unexpected error. 'UTF-8' is not a supported character encoding.", e); } catch (IOException e) { throw new ParameterDecodeException("Unexpected error. Unable to read ByteArrayInputStream based stream.", e); } return properties; }
public Object decodeValue(String value) throws ParameterDecodeException { Properties properties = new Properties(); try { properties.load(new ByteArrayInputStream(value.getBytes("UTF-8"))); } catch (UnsupportedEncodingException e) { throw new ParameterDecodeException("Unexpected error. 'UTF-8' is not a supported character encoding.", e); } catch (IOException e) { throw new ParameterDecodeException("Unexpected error. Unable to read ByteArrayInputStream based stream.", e); } return properties; }
public Object decodeValue(String value) throws ParameterDecodeException { Properties properties = new Properties(); try { properties.load(new ByteArrayInputStream(value.getBytes("UTF-8"))); } catch (UnsupportedEncodingException e) { throw new ParameterDecodeException("Unexpected error. 'UTF-8' is not a supported character encoding.", e); } catch (IOException e) { throw new ParameterDecodeException("Unexpected error. Unable to read ByteArrayInputStream based stream.", e); } return properties; }
objValue = paramDecoder.decodeValue(value); } catch(ClassCastException cast) { throw new ParameterDecodeException("Configured ParameterDecoder '" + PARAM_TYPE_PREFIX + type + "' for device must be of type " + ParameterDecoder.class); throw new ParameterDecodeException("ParameterDecoder '" + PARAM_TYPE_PREFIX + type + "' not defined for requesting device.");
objValue = paramDecoder.decodeValue(value); } catch(ClassCastException cast) { throw new ParameterDecodeException("Configured ParameterDecoder '" + PARAM_TYPE_PREFIX + type + "' for device must be of type " + ParameterDecoder.class); throw new ParameterDecodeException("ParameterDecoder '" + PARAM_TYPE_PREFIX + type + "' not defined for requesting device.");
objValue = paramDecoder.decodeValue(value); } catch(ClassCastException cast) { throw new ParameterDecodeException("Configured ParameterDecoder '" + PARAM_TYPE_PREFIX + type + "' for device must be of type " + ParameterDecoder.class); throw new ParameterDecodeException("ParameterDecoder '" + PARAM_TYPE_PREFIX + type + "' not defined for requesting device.");
objValue = paramDecoder.decodeValue(value); } catch(ClassCastException cast) { throw new ParameterDecodeException("Configured ParameterDecoder '" + PARAM_TYPE_PREFIX + type + "' for device must be of type " + ParameterDecoder.class); throw new ParameterDecodeException("ParameterDecoder '" + PARAM_TYPE_PREFIX + type + "' not defined for requesting device.");
/** * Public constructor. * @param resourceConfig Configuration. */ public void setConfiguration(SmooksResourceConfiguration resourceConfig) { delims = resourceConfig.getStringParameter("delims", ","); returnDelims = resourceConfig.getBoolParameter("returnDelims", false); trimTokens = resourceConfig.getBoolParameter("trimTokens", true); String paramType = resourceConfig.getStringParameter(Parameter.PARAM_TYPE_PREFIX, "string-list"); if(paramType.equals("string-list")) { returnType = Vector.class; } else if(paramType.equals("string-hashset")) { returnType = LinkedHashSet.class; } else { throw new ParameterDecodeException("Unsupported decoded return type [" + paramType + "]"); } }
/** * Public constructor. * @param resourceConfig Configuration. */ public void setConfiguration(SmooksResourceConfiguration resourceConfig) { delims = resourceConfig.getStringParameter("delims", ","); returnDelims = resourceConfig.getBoolParameter("returnDelims", false); trimTokens = resourceConfig.getBoolParameter("trimTokens", true); String paramType = resourceConfig.getStringParameter(Parameter.PARAM_TYPE_PREFIX, "string-list"); if(paramType.equals("string-list")) { returnType = Vector.class; } else if(paramType.equals("string-hashset")) { returnType = LinkedHashSet.class; } else { throw new ParameterDecodeException("Unsupported decoded return type [" + paramType + "]"); } }
/** * Public constructor. * @param resourceConfig Configuration. */ public void setConfiguration(SmooksResourceConfiguration resourceConfig) { delims = resourceConfig.getStringParameter("delims", ","); returnDelims = resourceConfig.getBoolParameter("returnDelims", false); trimTokens = resourceConfig.getBoolParameter("trimTokens", true); String paramType = resourceConfig.getStringParameter(Parameter.PARAM_TYPE_PREFIX, "string-list"); if(paramType.equals("string-list")) { returnType = Vector.class; } else if(paramType.equals("string-hashset")) { returnType = LinkedHashSet.class; } else { throw new ParameterDecodeException("Unsupported decoded return type [" + paramType + "]"); } }
/** * Public constructor. * @param resourceConfig Configuration. */ public void setConfiguration(SmooksResourceConfiguration resourceConfig) { delims = resourceConfig.getStringParameter("delims", ","); returnDelims = resourceConfig.getBoolParameter("returnDelims", false); trimTokens = resourceConfig.getBoolParameter("trimTokens", true); String paramType = resourceConfig.getStringParameter(Parameter.PARAM_TYPE_PREFIX, "string-list"); if(paramType.equals("string-list")) { returnType = Vector.class; } else if(paramType.equals("string-hashset")) { returnType = LinkedHashSet.class; } else { throw new ParameterDecodeException("Unsupported decoded return type [" + paramType + "]"); } }