private DataDecoder getDecoder(ExecutionContext executionContext) throws DataDecodeException { @SuppressWarnings("unchecked") List decoders = executionContext.getDeliveryConfig().getObjects("decoder:" + typeAlias); if (decoders == null || decoders.isEmpty()) { decoder = DataDecoder.Factory.create(typeAlias); } else if (!(decoders.get(0) instanceof DataDecoder)) { throw new DataDecodeException("Configured decoder '" + typeAlias + ":" + decoders.get(0).getClass().getName() + "' is not an instance of " + DataDecoder.class.getName()); } else { decoder = (DataDecoder) decoders.get(0); } return decoder; }
public void setDataType(String dataType) { this.dataType = dataType; if(dataType != null) { decoder = DataDecoder.Factory.create(dataType); DecodeType decodeType = decoder.getClass().getAnnotation(DecodeType.class); if(decodeType != null) { typeClass = decodeType.value()[0]; } } }
public void setDataType(String dataType) { this.dataType = dataType; if(dataType != null) { decoder = DataDecoder.Factory.create(dataType); DecodeType decodeType = decoder.getClass().getAnnotation(DecodeType.class); if(decodeType != null) { typeClass = decodeType.value()[0]; } } }
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 setDataType(String dataType) { this.dataType = dataType; if(dataType != null) { decoder = DataDecoder.Factory.create(dataType); DecodeType decodeType = decoder.getClass().getAnnotation(DecodeType.class); if(decodeType != null) { typeClass = decodeType.value()[0]; } } }
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 DataDecoder resolveDecoderReflectively() throws DataDecodeException { Class<?> bindType = resolveBindTypeReflectively(); if(bindType != null) { DataDecoder resolvedDecoder = DataDecoder.Factory.create(bindType); if(resolvedDecoder != null) { return resolvedDecoder; } } return new StringDecoder(); }
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); } } }
/** * Create a Value binding configuration. * * @param beanId The bean id under which the value will be stored. * @param data The data selector for the data value to be bound. * @param type Data type. */ public Value(String beanId, String data, Class<?> type) { this(beanId, data); AssertArgument.isNotNull(type, "type"); this.decoder = DataDecoder.Factory.create(type); }
/** * Set the binding value data type. * @param type The data type. * * @return <code>this</code> Value configuration instance. */ public Value setType(Class<?> type) { this.decoder = DataDecoder.Factory.create(type); return this; }
private DataDecoder resolveDecoderReflectively() throws DataDecodeException { Class<?> bindType = resolveBindTypeReflectively(); if(bindType != null) { DataDecoder resolvedDecoder = DataDecoder.Factory.create(bindType); if(resolvedDecoder != null) { return resolvedDecoder; } } return new StringDecoder(); }
/** * Set the binding value data type. * @param type The data type. * * @return <code>this</code> Value configuration instance. */ public Value setType(Class<?> type) { this.decoder = DataDecoder.Factory.create(type); return this; }
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); } } }
/** * Create a Value binding configuration. * * @param beanId The bean id under which the value will be stored. * @param data The data selector for the data value to be bound. * @param type Data type. */ public Value(String beanId, String data, Class<?> type) { this(beanId, data); AssertArgument.isNotNull(type, "type"); this.decoder = DataDecoder.Factory.create(type); }
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; }
/** * Set the binding value data type. * @param type The data type. * * @return <code>this</code> Value configuration instance. */ public Value setType(Class<?> type) { this.decoder = DataDecoder.Factory.create(type); return this; }
/** * Create a Value binding configuration. * * @param beanId The bean id under which the value will be stored. * @param data The data selector for the data value to be bound. * @param type Data type. */ public Value(String beanId, String data, Class<?> type) { this(beanId, data); AssertArgument.isNotNull(type, "type"); this.decoder = DataDecoder.Factory.create(type); }
private DataDecoder resolveDecoderReflectively() throws DataDecodeException { Class<?> bindType = resolveBindTypeReflectively(); if(bindType != null) { DataDecoder resolvedDecoder = DataDecoder.Factory.create(bindType); if(resolvedDecoder != null) { return resolvedDecoder; } } return new StringDecoder(); }