@Nonnull @Override public Object configure(CNode config, ConfigurationContext context) throws ConfiguratorException { return Stapler.lookupConverter(target).convert(target, SecretSourceResolver.resolve(context, config.asScalar().toString())); }
if (Stapler.lookupConverter(clazz) != null) { return new PrimitiveConfigurator(clazz);
/** * Helper method for {@link #parse(StaplerRequest, Annotation, Class, String)} to convert to the right type * from String. */ protected final Object convert(Class targetType, String value) { Converter converter = Stapler.lookupConverter(targetType); if (converter==null) throw new IllegalArgumentException("Unable to convert to "+targetType); return converter.convert(targetType,value); }
/** * Helper method for {@link #parse(StaplerRequest, Annotation, Class, String)} to convert to the right type * from String. */ protected final Object convert(Class targetType, String value) { Converter converter = Stapler.lookupConverter(targetType); if (converter==null) throw new IllegalArgumentException("Unable to convert to "+targetType); return converter.convert(targetType,value); }
/** * Helper method for {@link #parse(StaplerRequest, Annotation, Class, String)} to convert to the right type * from String. */ protected final Object convert(Class targetType, String value) { Converter converter = Stapler.lookupConverter(targetType); if (converter==null) throw new IllegalArgumentException("Unable to convert to "+targetType); return converter.convert(targetType,value); }
Converter converter = Stapler.lookupConverter(propDescriptor.getPropertyType()); if (converter != null) value = converter.convert(propDescriptor.getPropertyType(), value);
@Nonnull @Override public Object configure(CNode config, ConfigurationContext context) throws ConfiguratorException { return Stapler.lookupConverter(target).convert(target, SecretSourceResolver.resolve(context, config.asScalar().toString())); }
Converter converter = Stapler.lookupConverter(propDescriptor.getPropertyType()); if (converter != null) value = converter.convert(propDescriptor.getPropertyType(), value);
Converter converter = Stapler.lookupConverter(propDescriptor.getPropertyType()); if (converter != null) value = converter.convert(propDescriptor.getPropertyType(), value);
public <T> T bindParameters(Class<T> type, String prefix, int index) { String[] names = loadConstructorParamNames(type); // the actual arguments to invoke the constructor with. Object[] args = new Object[names.length]; // constructor Constructor<T> c = findConstructor(type, names.length); Class[] types = c.getParameterTypes(); // convert parameters for( int i=0; i<names.length; i++ ) { String[] values = getParameterValues(prefix + names[i]); String param; if(values!=null) param = values[index]; else param = null; Converter converter = Stapler.lookupConverter(types[i]); if (converter==null) throw new IllegalArgumentException("Unable to convert to "+types[i]); args[i] = converter.convert(types[i],param); } return invokeConstructor(c, args); }
public <T> T bindParameters(Class<T> type, String prefix, int index) { String[] names = new ClassDescriptor(type).loadConstructorParamNames(); // the actual arguments to invoke the constructor with. Object[] args = new Object[names.length]; // constructor Constructor<T> c = findConstructor(type, names.length); Class[] types = c.getParameterTypes(); // convert parameters for( int i=0; i<names.length; i++ ) { String[] values = getParameterValues(prefix + names[i]); String param; if(values!=null) param = values[index]; else param = null; Converter converter = Stapler.lookupConverter(types[i]); if (converter==null) throw new IllegalArgumentException("Unable to convert to "+types[i]); args[i] = converter.convert(types[i],param); } return invokeConstructor(c, args); }
public <T> T bindParameters(Class<T> type, String prefix, int index) { String[] names = new ClassDescriptor(type).loadConstructorParamNames(); // the actual arguments to invoke the constructor with. Object[] args = new Object[names.length]; // constructor Constructor<T> c = findConstructor(type, names.length); Class[] types = c.getParameterTypes(); // convert parameters for( int i=0; i<names.length; i++ ) { String[] values = getParameterValues(prefix + names[i]); String param; if(values!=null) param = values[index]; else param = null; Converter converter = Stapler.lookupConverter(types[i]); if (converter==null) throw new IllegalArgumentException("Unable to convert to "+types[i]); args[i] = converter.convert(types[i],param); } return invokeConstructor(c, args); }
if (Stapler.lookupConverter(clazz) != null) { return new PrimitiveConfigurator(clazz);
Converter converter = Stapler.lookupConverter(type); if (converter==null) throw new IllegalArgumentException("Unable to convert to "+type); Converter converter = Stapler.lookupConverter(l.itemType); if (converter==null) throw new IllegalArgumentException("Unable to convert to "+type);
Converter converter = Stapler.lookupConverter(type); if (converter==null) throw new IllegalArgumentException("Unable to convert to "+type); Converter converter = Stapler.lookupConverter(l.itemType); if (converter==null) throw new IllegalArgumentException("Unable to convert to "+l.itemType);
Converter converter = Stapler.lookupConverter(type); if (converter==null) throw new IllegalArgumentException("Unable to convert to "+type); Converter converter = Stapler.lookupConverter(l.itemType); if (converter==null) throw new IllegalArgumentException("Unable to convert to "+l.itemType);