public void setBaseDecoder(DataDecoder baseDecoder) { this.baseDecoder = baseDecoder; if(baseDecoder instanceof Configurable) { ((Configurable)baseDecoder).setConfiguration(config); } }
Properties configuration = ((Configurable) dataDecoder).getConfiguration();
public void setBaseDecoder(DataDecoder baseDecoder) { this.baseDecoder = baseDecoder; if(baseDecoder instanceof Configurable) { ((Configurable)baseDecoder).setConfiguration(config); } }
public void setBaseDecoder(DataDecoder baseDecoder) { this.baseDecoder = baseDecoder; if(baseDecoder instanceof Configurable) { ((Configurable)baseDecoder).setConfiguration(config); } }
public void setBaseDecoder(DataDecoder baseDecoder) { this.baseDecoder = baseDecoder; if(baseDecoder instanceof Configurable) { ((Configurable)baseDecoder).setConfiguration(config); } }
public void setDataTypeParameters(List<Map.Entry<String,String>> parameters) { this.parameters = parameters; if(decoder instanceof Configurable) { if(decoder == null) { throw new IllegalStateException("Illegal call to set parameters before 'dataType' has been configured on the " + getClass().getName()); } decodeParams = new Properties(); if(parameters != null) { for (Map.Entry<String,String> entry : parameters) { decodeParams.setProperty(entry.getKey(), entry.getValue()); } } ((Configurable)decoder).setConfiguration(decodeParams); } }
public void setDataTypeParameters(List<Map.Entry<String,String>> parameters) { this.parameters = parameters; if(decoder instanceof Configurable) { if(decoder == null) { throw new IllegalStateException("Illegal call to set parameters before 'dataType' has been configured on the " + getClass().getName()); } decodeParams = new Properties(); if(parameters != null) { for (Map.Entry<String,String> entry : parameters) { decodeParams.setProperty(entry.getKey(), entry.getValue()); } } ((Configurable)decoder).setConfiguration(decodeParams); } }
public void setDataTypeParameters(List<Map.Entry<String,String>> parameters) { this.parameters = parameters; if(decoder instanceof Configurable) { if(decoder == null) { throw new IllegalStateException("Illegal call to set parameters before 'dataType' has been configured on the " + getClass().getName()); } decodeParams = new Properties(); if(parameters != null) { for (Map.Entry<String,String> entry : parameters) { decodeParams.setProperty(entry.getKey(), entry.getValue()); } } ((Configurable)decoder).setConfiguration(decodeParams); } }
public void setDataTypeParameters(List<Map.Entry<String,String>> parameters) { this.parameters = parameters; if(decoder instanceof Configurable) { if(decoder == null) { throw new IllegalStateException("Illegal call to set parameters before 'dataType' has been configured on the " + getClass().getName()); } decodeParams = new Properties(); if(parameters != null) { for (Map.Entry<String,String> entry : parameters) { decodeParams.setProperty(entry.getKey(), entry.getValue()); } } ((Configurable)decoder).setConfiguration(decodeParams); } }
public void setConfiguration(Properties config) throws SmooksConfigurationException { String className = config.getProperty(CLASS_PROPERTY_NAME); if(className == null) { throw new SmooksConfigurationException("Mandatory property '" + CLASS_PROPERTY_NAME + "' not specified."); } delegateDecoder = DataDecoder.Factory.create(className); //Set configuration in delegateDecoder. if (delegateDecoder instanceof Configurable) { ((Configurable)delegateDecoder).setConfiguration(config); } this.configuration = config; }
public void setConfiguration(Properties config) throws SmooksConfigurationException { String className = config.getProperty(CLASS_PROPERTY_NAME); if(className == null) { throw new SmooksConfigurationException("Mandatory property '" + CLASS_PROPERTY_NAME + "' not specified."); } delegateDecoder = DataDecoder.Factory.create(className); //Set configuration in delegateDecoder. if (delegateDecoder instanceof Configurable) { ((Configurable)delegateDecoder).setConfiguration(config); } this.configuration = config; }
public void setConfiguration(Properties config) throws SmooksConfigurationException { String className = config.getProperty(CLASS_PROPERTY_NAME); if(className == null) { throw new SmooksConfigurationException("Mandatory property '" + CLASS_PROPERTY_NAME + "' not specified."); } delegateDecoder = DataDecoder.Factory.create(className); //Set configuration in delegateDecoder. if (delegateDecoder instanceof Configurable) { ((Configurable)delegateDecoder).setConfiguration(config); } this.configuration = config; }
private static <U> void setConfiguration(U instance, SmooksResourceConfiguration config) { if(instance instanceof Configurable) { ((Configurable)instance).setConfiguration(config.toProperties()); } else { try { Method setConfigurationMethod = instance.getClass().getMethod("setConfiguration", SmooksResourceConfiguration.class); setConfigurationMethod.invoke(instance, config); } catch (NoSuchMethodException e) { // That's fine } catch (IllegalAccessException e) { throw new SmooksConfigurationException("Error invoking 'setConfiguration' method on class '" + instance.getClass().getName() + "'. This class must be public. Alternatively, use the @Config annotation on a class field.", e); } catch (InvocationTargetException e) { if(e.getTargetException() instanceof SmooksConfigurationException) { throw (SmooksConfigurationException)e.getTargetException(); } else { Throwable cause = e.getTargetException(); throw new SmooksConfigurationException("Error invoking 'setConfiguration' method on class '" + instance.getClass().getName() + "'.", (cause != null?cause:e)); } } } }
public void setConfiguration(Properties config) throws SmooksException { this.config = config; expression = new MVELExpressionEvaluator(config.getProperty(VALUE_PRE_PROCESSING)); expression.setToType(String.class); String baseDecoderName = config.getProperty(BASE_DECODER); if(baseDecoderName != null) { baseDecoder = DataDecoder.Factory.create(baseDecoderName); if(baseDecoder instanceof Configurable) { ((Configurable)baseDecoder).setConfiguration(config); } } }
public void setConfiguration(Properties config) throws SmooksException { this.config = config; expression = new MVELExpressionEvaluator(config.getProperty(VALUE_PRE_PROCESSING)); expression.setToType(String.class); String baseDecoderName = config.getProperty(BASE_DECODER); if(baseDecoderName != null) { baseDecoder = DataDecoder.Factory.create(baseDecoderName); if(baseDecoder instanceof Configurable) { ((Configurable)baseDecoder).setConfiguration(config); } } }
public void setConfiguration(Properties config) throws SmooksException { this.config = config; expression = new MVELExpressionEvaluator(config.getProperty(VALUE_PRE_PROCESSING)); expression.setToType(String.class); String baseDecoderName = config.getProperty(BASE_DECODER); if(baseDecoderName != null) { baseDecoder = DataDecoder.Factory.create(baseDecoderName); if(baseDecoder instanceof Configurable) { ((Configurable)baseDecoder).setConfiguration(config); } } }
private static <U> void setConfiguration(U instance, SmooksResourceConfiguration config) { if(instance instanceof Configurable) { ((Configurable)instance).setConfiguration(config.toProperties()); } else { try { Method setConfigurationMethod = instance.getClass().getMethod("setConfiguration", SmooksResourceConfiguration.class); setConfigurationMethod.invoke(instance, config); } catch (NoSuchMethodException e) { // That's fine } catch (IllegalAccessException e) { throw new SmooksConfigurationException("Error invoking 'setConfiguration' method on class '" + instance.getClass().getName() + "'. This class must be public. Alternatively, use the @Config annotation on a class field.", e); } catch (InvocationTargetException e) { if(e.getTargetException() instanceof SmooksConfigurationException) { throw (SmooksConfigurationException)e.getTargetException(); } else { Throwable cause = e.getTargetException(); throw new SmooksConfigurationException("Error invoking 'setConfiguration' method on class '" + instance.getClass().getName() + "'.", (cause != null?cause:e)); } } } }
private static <U> void setConfiguration(U instance, SmooksResourceConfiguration config) { if(instance instanceof Configurable) { ((Configurable)instance).setConfiguration(config.toProperties()); } else { try { Method setConfigurationMethod = instance.getClass().getMethod("setConfiguration", SmooksResourceConfiguration.class); setConfigurationMethod.invoke(instance, config); } catch (NoSuchMethodException e) { // That's fine } catch (IllegalAccessException e) { throw new SmooksConfigurationException("Error invoking 'setConfiguration' method on class '" + instance.getClass().getName() + "'. This class must be public. Alternatively, use the @Config annotation on a class field.", e); } catch (InvocationTargetException e) { if(e.getTargetException() instanceof SmooksConfigurationException) { throw (SmooksConfigurationException)e.getTargetException(); } else { Throwable cause = e.getTargetException(); throw new SmooksConfigurationException("Error invoking 'setConfiguration' method on class '" + instance.getClass().getName() + "'.", (cause != null?cause:e)); } } } }
public void setConfiguration(Properties config) throws SmooksException { this.config = config; expression = new MVELExpressionEvaluator(config.getProperty(VALUE_PRE_PROCESSING)); expression.setToType(String.class); String baseDecoderName = config.getProperty(BASE_DECODER); if(baseDecoderName != null) { baseDecoder = DataDecoder.Factory.create(baseDecoderName); if(baseDecoder instanceof Configurable) { ((Configurable)baseDecoder).setConfiguration(config); } } }
private static <U> void setConfiguration(U instance, SmooksResourceConfiguration config) { if(instance instanceof Configurable) { ((Configurable)instance).setConfiguration(config.toProperties()); } else { try { Method setConfigurationMethod = instance.getClass().getMethod("setConfiguration", SmooksResourceConfiguration.class); setConfigurationMethod.invoke(instance, config); } catch (NoSuchMethodException e) { // That's fine } catch (IllegalAccessException e) { throw new SmooksConfigurationException("Error invoking 'setConfiguration' method on class '" + instance.getClass().getName() + "'. This class must be public. Alternatively, use the @Config annotation on a class field.", e); } catch (InvocationTargetException e) { if(e.getTargetException() instanceof SmooksConfigurationException) { throw (SmooksConfigurationException)e.getTargetException(); } else { Throwable cause = e.getTargetException(); throw new SmooksConfigurationException("Error invoking 'setConfiguration' method on class '" + instance.getClass().getName() + "'.", (cause != null?cause:e)); } } } }