• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java StringArrayPropertyEditor类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.springframework.beans.propertyeditors.StringArrayPropertyEditor的典型用法代码示例。如果您正苦于以下问题:Java StringArrayPropertyEditor类的具体用法?Java StringArrayPropertyEditor怎么用?Java StringArrayPropertyEditor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



StringArrayPropertyEditor类属于org.springframework.beans.propertyeditors包,在下文中一共展示了StringArrayPropertyEditor类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: bindingStringArrayWithSplitting

import org.springframework.beans.propertyeditors.StringArrayPropertyEditor; //导入依赖的package包/类
@Test
public void bindingStringArrayWithSplitting() {
	request.addParameter("stringArray", "test1,test2");

	PortletRequestDataBinder binder = new PortletRequestDataBinder(bean);
	binder.registerCustomEditor(String[].class, new StringArrayPropertyEditor());
	binder.bind(request);

	assertNotNull(bean.getStringArray());
	assertEquals(2, bean.getStringArray().length);
	assertEquals("test1", bean.getStringArray()[0]);
	assertEquals("test2", bean.getStringArray()[1]);
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:14,代码来源:PortletRequestDataBinderTests.java


示例2: withPropertyEditor

import org.springframework.beans.propertyeditors.StringArrayPropertyEditor; //导入依赖的package包/类
@Test
public void withPropertyEditor() throws Exception {
	String selectName = "testBean.stringArray";
	BindStatus bindStatus = new BindStatus(getRequestContext(), selectName, false) {
		@Override
		public PropertyEditor getEditor() {
			return new StringArrayPropertyEditor();
		}
	};
	getPageContext().setAttribute(SelectTag.LIST_VALUE_PAGE_ATTRIBUTE, bindStatus);

	this.tag.setValue(ARRAY_SOURCE);
	this.tag.setLabel("someArray");

	int result = this.tag.doStartTag();
	assertEquals(BodyTag.EVAL_BODY_BUFFERED, result);
	result = this.tag.doEndTag();
	assertEquals(Tag.EVAL_PAGE, result);

	String output = getOutput();

	assertOptionTagOpened(output);
	assertOptionTagClosed(output);
	assertContainsAttribute(output, "value", ARRAY_SOURCE);
	assertContainsAttribute(output, "selected", "selected");
	assertBlockTagContains(output, "someArray");

}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:29,代码来源:OptionTagTests.java


示例3: setStringArrayPropertyWithCustomStringDelimiter

import org.springframework.beans.propertyeditors.StringArrayPropertyEditor; //导入依赖的package包/类
@Test
public void setStringArrayPropertyWithCustomStringDelimiter() throws Exception {
	PropsTester target = new PropsTester();
	AbstractPropertyAccessor accessor = createAccessor(target);
	accessor.registerCustomEditor(String[].class, "stringArray", new StringArrayPropertyEditor("-"));
	accessor.setPropertyValue("stringArray", "a1-b2");
	assertTrue("stringArray length = 2", target.stringArray.length == 2);
	assertTrue("correct values", target.stringArray[0].equals("a1") && target.stringArray[1].equals("b2"));
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:10,代码来源:AbstractPropertyAccessorTests.java


示例4: getFlushingModelEditor

import org.springframework.beans.propertyeditors.StringArrayPropertyEditor; //导入依赖的package包/类
/**
 * @see org.springmodules.cache.provider.CacheProviderFacade#getFlushingModelEditor()
 */
public PropertyEditor getFlushingModelEditor() {
	Map propertyEditors = new HashMap();
	propertyEditors.put("cacheNames", new StringArrayPropertyEditor());

	ReflectionCacheModelEditor editor = new ReflectionCacheModelEditor();
	editor.setCacheModelClass(GigaSpacesFlushingModel.class);
	editor.setCacheModelPropertyEditors(propertyEditors);
	return editor;
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:13,代码来源:GigaSpacesFacade.java


示例5: getFlushingModelEditor

import org.springframework.beans.propertyeditors.StringArrayPropertyEditor; //导入依赖的package包/类
/**
 * @see org.springmodules.cache.provider.CacheProviderFacade#getFlushingModelEditor()
 */
public PropertyEditor getFlushingModelEditor() {
	Map propertyEditors = new HashMap();
	propertyEditors.put("cacheNames", new StringArrayPropertyEditor());

	ReflectionCacheModelEditor editor = new ReflectionCacheModelEditor();
	editor.setCacheModelClass(EhCacheFlushingModel.class);
	editor.setCacheModelPropertyEditors(propertyEditors);
	return editor;
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:13,代码来源:EhCacheFacade.java


示例6: getFlushingModelEditor

import org.springframework.beans.propertyeditors.StringArrayPropertyEditor; //导入依赖的package包/类
/**
 * @see org.springmodules.cache.provider.CacheProviderFacade#getFlushingModelEditor()
 */
public PropertyEditor getFlushingModelEditor() {
	Map propertyEditors = new HashMap();
	propertyEditors.put("cacheNames", new StringArrayPropertyEditor());

	ReflectionCacheModelEditor editor = new ReflectionCacheModelEditor();
	editor.setCacheModelClass(OsCacheFlushingModel.class);
	editor.setCacheModelPropertyEditors(propertyEditors);
	return editor;
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:13,代码来源:OsCacheFacade.java


示例7: getFlushingModelEditor

import org.springframework.beans.propertyeditors.StringArrayPropertyEditor; //导入依赖的package包/类
/**
 * @see org.springmodules.cache.provider.CacheProviderFacade#getFlushingModelEditor()
 */
public PropertyEditor getFlushingModelEditor() {
	Map propertyEditors = new HashMap();
	propertyEditors.put("cacheNames", new StringArrayPropertyEditor());

	ReflectionCacheModelEditor editor = new ReflectionCacheModelEditor();
	editor.setCacheModelClass(CoherenceFlushingModel.class);
	editor.setCacheModelPropertyEditors(propertyEditors);
	return editor;
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:13,代码来源:CoherenceFacade.java


示例8: getFlushingModelEditor

import org.springframework.beans.propertyeditors.StringArrayPropertyEditor; //导入依赖的package包/类
/**
 * @see org.springmodules.cache.provider.CacheProviderFacade#getFlushingModelEditor()
 */
public PropertyEditor getFlushingModelEditor() {
   final Map propertyEditors = new HashMap(11);
   propertyEditors.put("cacheNames", new StringArrayPropertyEditor());

   final ReflectionCacheModelEditor editor = new ReflectionCacheModelEditor();
   editor.setCacheModelClass(CacheonixFlushingModel.class);
   editor.setCacheModelPropertyEditors(propertyEditors);
   return editor;
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:13,代码来源:CacheonixFacade.java


示例9: getFlushingModelEditor

import org.springframework.beans.propertyeditors.StringArrayPropertyEditor; //导入依赖的package包/类
/**
 * @see org.springmodules.cache.provider.CacheProviderFacade#getFlushingModelEditor()
 */
public PropertyEditor getFlushingModelEditor() {
	Map propertyEditors = new HashMap();
	propertyEditors.put("cacheNames", new StringArrayPropertyEditor());

	ReflectionCacheModelEditor editor = new ReflectionCacheModelEditor();
	editor.setCacheModelClass(JbossCacheFlushingModel.class);
	editor.setCacheModelPropertyEditors(propertyEditors);
	return editor;
}
 
开发者ID:cacheonix,项目名称:cacheonix-core,代码行数:13,代码来源:JbossCacheFacade.java


示例10: testBindingStringArrayWithSplitting

import org.springframework.beans.propertyeditors.StringArrayPropertyEditor; //导入依赖的package包/类
public void testBindingStringArrayWithSplitting() {
	TestBean bean = new TestBean();

	MockPortletRequest request = new MockPortletRequest();
	request.addParameter("stringArray", "test1,test2");

	PortletRequestDataBinder binder = new PortletRequestDataBinder(bean);
	binder.registerCustomEditor(String[].class, new StringArrayPropertyEditor());
	binder.bind(request);

	assertNotNull(bean.getStringArray());
	assertEquals(2, bean.getStringArray().length);
	assertEquals("test1", bean.getStringArray()[0]);
	assertEquals("test2", bean.getStringArray()[1]);
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:16,代码来源:PortletRequestDataBinderTests.java


示例11: testWithPropertyEditor

import org.springframework.beans.propertyeditors.StringArrayPropertyEditor; //导入依赖的package包/类
public void testWithPropertyEditor() throws Exception {
	String selectName = "testBean.stringArray";
	BindStatus bindStatus = new BindStatus(getRequestContext(), selectName, false) {
		@Override
		public PropertyEditor getEditor() {
			return new StringArrayPropertyEditor();
		}
	};
	getPageContext().setAttribute(SelectTag.LIST_VALUE_PAGE_ATTRIBUTE, bindStatus);

	this.tag.setValue(ARRAY_SOURCE);
	this.tag.setLabel("someArray");

	int result = this.tag.doStartTag();
	assertEquals(BodyTag.EVAL_BODY_BUFFERED, result);
	result = this.tag.doEndTag();
	assertEquals(Tag.EVAL_PAGE, result);

	String output = getOutput();

	assertOptionTagOpened(output);
	assertOptionTagClosed(output);
	assertContainsAttribute(output, "value", ARRAY_SOURCE);
	assertContainsAttribute(output, "selected", "selected");
	assertBlockTagContains(output, "someArray");

}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:28,代码来源:OptionTagTests.java


示例12: testStringArrayPropertyWithCustomStringDelimiter

import org.springframework.beans.propertyeditors.StringArrayPropertyEditor; //导入依赖的package包/类
@Test
public void testStringArrayPropertyWithCustomStringDelimiter() throws Exception {
	PropsTester pt = new PropsTester();
	BeanWrapper bw = new BeanWrapperImpl(pt);
	bw.registerCustomEditor(String[].class, "stringArray", new StringArrayPropertyEditor("-"));
	bw.setPropertyValue("stringArray", "a1-b2");
	assertTrue("stringArray length = 2", pt.stringArray.length == 2);
	assertTrue("correct values", pt.stringArray[0].equals("a1") && pt.stringArray[1].equals("b2"));
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:10,代码来源:BeanWrapperTests.java


示例13: initBinder

import org.springframework.beans.propertyeditors.StringArrayPropertyEditor; //导入依赖的package包/类
@Override
public void initBinder(WebDataBinder binder, WebRequest request) {
    super.initBinder(binder, request);

    binder.registerCustomEditor(KualiDecimal.class, new UifCurrencyEditor());
    binder.registerCustomEditor(KualiInteger.class, new UifKualiIntegerCurrencyEditor());

    binder.registerCustomEditor(KualiPercent.class, new UifPercentageEditor());

    binder.registerCustomEditor(java.sql.Date.class, new UifDateEditor());
    binder.registerCustomEditor(java.util.Date.class, new UifDateEditor());
    binder.registerCustomEditor(Timestamp.class, new UifTimestampEditor());

    // TODO do we need this since we are switching to spring tags
    binder.registerCustomEditor(boolean.class, new UifBooleanEditor());
    binder.registerCustomEditor(Boolean.class, new UifBooleanEditor());
    binder.registerCustomEditor(Boolean.TYPE, new UifBooleanEditor());

    // Use the spring custom number editor for Big decimals
    DecimalFormat bigIntFormatter = new DecimalFormat();
    bigIntFormatter.setMaximumFractionDigits(340);
    binder.registerCustomEditor(BigDecimal.class, new CustomNumberEditor(BigDecimal.class, bigIntFormatter, true));
    binder.registerCustomEditor(AbstractKualiDecimal.class, new CustomNumberEditor(AbstractKualiDecimal.class,
            bigIntFormatter, true));

    // Use the spring StringTrimmerEditor editor for Strings
    binder.registerCustomEditor(String.class, new StringTrimmerEditor(false));

    // Use the StringArrayPropertyEditor for string arrays with "," as the
    // separator
    binder.registerCustomEditor(String[].class, new StringArrayPropertyEditor(",", false));

    binder.registerCustomEditor(byte[].class, new ByteArrayMultipartFileEditor());
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:35,代码来源:UifConfigurableWebBindingInitializer.java


示例14: createDefaultEditors

import org.springframework.beans.propertyeditors.StringArrayPropertyEditor; //导入依赖的package包/类
/**
 * Actually register the default editors for this registry instance.
 */
private void createDefaultEditors() {
	this.defaultEditors = new HashMap<Class<?>, PropertyEditor>(64);

	// Simple editors, without parameterization capabilities.
	// The JDK does not contain a default editor for any of these target types.
	this.defaultEditors.put(Charset.class, new CharsetEditor());
	this.defaultEditors.put(Class.class, new ClassEditor());
	this.defaultEditors.put(Class[].class, new ClassArrayEditor());
	this.defaultEditors.put(Currency.class, new CurrencyEditor());
	this.defaultEditors.put(File.class, new FileEditor());
	this.defaultEditors.put(InputStream.class, new InputStreamEditor());
	this.defaultEditors.put(InputSource.class, new InputSourceEditor());
	this.defaultEditors.put(Locale.class, new LocaleEditor());
	this.defaultEditors.put(Pattern.class, new PatternEditor());
	this.defaultEditors.put(Properties.class, new PropertiesEditor());
	this.defaultEditors.put(Resource[].class, new ResourceArrayPropertyEditor());
	this.defaultEditors.put(TimeZone.class, new TimeZoneEditor());
	this.defaultEditors.put(URI.class, new URIEditor());
	this.defaultEditors.put(URL.class, new URLEditor());
	this.defaultEditors.put(UUID.class, new UUIDEditor());
	if (zoneIdClass != null) {
		this.defaultEditors.put(zoneIdClass, new ZoneIdEditor());
	}

	// Default instances of collection editors.
	// Can be overridden by registering custom instances of those as custom editors.
	this.defaultEditors.put(Collection.class, new CustomCollectionEditor(Collection.class));
	this.defaultEditors.put(Set.class, new CustomCollectionEditor(Set.class));
	this.defaultEditors.put(SortedSet.class, new CustomCollectionEditor(SortedSet.class));
	this.defaultEditors.put(List.class, new CustomCollectionEditor(List.class));
	this.defaultEditors.put(SortedMap.class, new CustomMapEditor(SortedMap.class));

	// Default editors for primitive arrays.
	this.defaultEditors.put(byte[].class, new ByteArrayPropertyEditor());
	this.defaultEditors.put(char[].class, new CharArrayPropertyEditor());

	// The JDK does not contain a default editor for char!
	this.defaultEditors.put(char.class, new CharacterEditor(false));
	this.defaultEditors.put(Character.class, new CharacterEditor(true));

	// Spring's CustomBooleanEditor accepts more flag values than the JDK's default editor.
	this.defaultEditors.put(boolean.class, new CustomBooleanEditor(false));
	this.defaultEditors.put(Boolean.class, new CustomBooleanEditor(true));

	// The JDK does not contain default editors for number wrapper types!
	// Override JDK primitive number editors with our own CustomNumberEditor.
	this.defaultEditors.put(byte.class, new CustomNumberEditor(Byte.class, false));
	this.defaultEditors.put(Byte.class, new CustomNumberEditor(Byte.class, true));
	this.defaultEditors.put(short.class, new CustomNumberEditor(Short.class, false));
	this.defaultEditors.put(Short.class, new CustomNumberEditor(Short.class, true));
	this.defaultEditors.put(int.class, new CustomNumberEditor(Integer.class, false));
	this.defaultEditors.put(Integer.class, new CustomNumberEditor(Integer.class, true));
	this.defaultEditors.put(long.class, new CustomNumberEditor(Long.class, false));
	this.defaultEditors.put(Long.class, new CustomNumberEditor(Long.class, true));
	this.defaultEditors.put(float.class, new CustomNumberEditor(Float.class, false));
	this.defaultEditors.put(Float.class, new CustomNumberEditor(Float.class, true));
	this.defaultEditors.put(double.class, new CustomNumberEditor(Double.class, false));
	this.defaultEditors.put(Double.class, new CustomNumberEditor(Double.class, true));
	this.defaultEditors.put(BigDecimal.class, new CustomNumberEditor(BigDecimal.class, true));
	this.defaultEditors.put(BigInteger.class, new CustomNumberEditor(BigInteger.class, true));

	// Only register config value editors if explicitly requested.
	if (this.configValueEditorsActive) {
		StringArrayPropertyEditor sae = new StringArrayPropertyEditor();
		this.defaultEditors.put(String[].class, sae);
		this.defaultEditors.put(short[].class, sae);
		this.defaultEditors.put(int[].class, sae);
		this.defaultEditors.put(long[].class, sae);
	}
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:74,代码来源:PropertyEditorRegistrySupport.java


示例15: createDefaultEditors

import org.springframework.beans.propertyeditors.StringArrayPropertyEditor; //导入依赖的package包/类
/**
 * Actually register the default editors for this registry instance.
 */
private void createDefaultEditors() {
	this.defaultEditors = new HashMap<Class<?>, PropertyEditor>(64);

	// Simple editors, without parameterization capabilities.
	// The JDK does not contain a default editor for any of these target types.
	this.defaultEditors.put(Charset.class, new CharsetEditor());
	this.defaultEditors.put(Class.class, new ClassEditor());
	this.defaultEditors.put(Class[].class, new ClassArrayEditor());
	this.defaultEditors.put(Currency.class, new CurrencyEditor());
	this.defaultEditors.put(File.class, new FileEditor());
	this.defaultEditors.put(InputStream.class, new InputStreamEditor());
	this.defaultEditors.put(InputSource.class, new InputSourceEditor());
	this.defaultEditors.put(Locale.class, new LocaleEditor());
	this.defaultEditors.put(Pattern.class, new PatternEditor());
	this.defaultEditors.put(Properties.class, new PropertiesEditor());
	this.defaultEditors.put(Reader.class, new ReaderEditor());
	this.defaultEditors.put(Resource[].class, new ResourceArrayPropertyEditor());
	this.defaultEditors.put(TimeZone.class, new TimeZoneEditor());
	this.defaultEditors.put(URI.class, new URIEditor());
	this.defaultEditors.put(URL.class, new URLEditor());
	this.defaultEditors.put(UUID.class, new UUIDEditor());
	if (zoneIdClass != null) {
		this.defaultEditors.put(zoneIdClass, new ZoneIdEditor());
	}

	// Default instances of collection editors.
	// Can be overridden by registering custom instances of those as custom editors.
	this.defaultEditors.put(Collection.class, new CustomCollectionEditor(Collection.class));
	this.defaultEditors.put(Set.class, new CustomCollectionEditor(Set.class));
	this.defaultEditors.put(SortedSet.class, new CustomCollectionEditor(SortedSet.class));
	this.defaultEditors.put(List.class, new CustomCollectionEditor(List.class));
	this.defaultEditors.put(SortedMap.class, new CustomMapEditor(SortedMap.class));

	// Default editors for primitive arrays.
	this.defaultEditors.put(byte[].class, new ByteArrayPropertyEditor());
	this.defaultEditors.put(char[].class, new CharArrayPropertyEditor());

	// The JDK does not contain a default editor for char!
	this.defaultEditors.put(char.class, new CharacterEditor(false));
	this.defaultEditors.put(Character.class, new CharacterEditor(true));

	// Spring's CustomBooleanEditor accepts more flag values than the JDK's default editor.
	this.defaultEditors.put(boolean.class, new CustomBooleanEditor(false));
	this.defaultEditors.put(Boolean.class, new CustomBooleanEditor(true));

	// The JDK does not contain default editors for number wrapper types!
	// Override JDK primitive number editors with our own CustomNumberEditor.
	this.defaultEditors.put(byte.class, new CustomNumberEditor(Byte.class, false));
	this.defaultEditors.put(Byte.class, new CustomNumberEditor(Byte.class, true));
	this.defaultEditors.put(short.class, new CustomNumberEditor(Short.class, false));
	this.defaultEditors.put(Short.class, new CustomNumberEditor(Short.class, true));
	this.defaultEditors.put(int.class, new CustomNumberEditor(Integer.class, false));
	this.defaultEditors.put(Integer.class, new CustomNumberEditor(Integer.class, true));
	this.defaultEditors.put(long.class, new CustomNumberEditor(Long.class, false));
	this.defaultEditors.put(Long.class, new CustomNumberEditor(Long.class, true));
	this.defaultEditors.put(float.class, new CustomNumberEditor(Float.class, false));
	this.defaultEditors.put(Float.class, new CustomNumberEditor(Float.class, true));
	this.defaultEditors.put(double.class, new CustomNumberEditor(Double.class, false));
	this.defaultEditors.put(Double.class, new CustomNumberEditor(Double.class, true));
	this.defaultEditors.put(BigDecimal.class, new CustomNumberEditor(BigDecimal.class, true));
	this.defaultEditors.put(BigInteger.class, new CustomNumberEditor(BigInteger.class, true));

	// Only register config value editors if explicitly requested.
	if (this.configValueEditorsActive) {
		StringArrayPropertyEditor sae = new StringArrayPropertyEditor();
		this.defaultEditors.put(String[].class, sae);
		this.defaultEditors.put(short[].class, sae);
		this.defaultEditors.put(int[].class, sae);
		this.defaultEditors.put(long[].class, sae);
	}
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:75,代码来源:PropertyEditorRegistrySupport.java


示例16: createDefaultEditors

import org.springframework.beans.propertyeditors.StringArrayPropertyEditor; //导入依赖的package包/类
/**
 * Actually register the default editors for this registry instance.
 */
private void createDefaultEditors() {
	this.defaultEditors = new HashMap<Class<?>, PropertyEditor>(64);

	// Simple editors, without parameterization capabilities.
	// The JDK does not contain a default editor for any of these target types.
	this.defaultEditors.put(Charset.class, new CharsetEditor());
	this.defaultEditors.put(Class.class, new ClassEditor());
	this.defaultEditors.put(Class[].class, new ClassArrayEditor());
	this.defaultEditors.put(Currency.class, new CurrencyEditor());
	this.defaultEditors.put(File.class, new FileEditor());
	this.defaultEditors.put(InputStream.class, new InputStreamEditor());
	this.defaultEditors.put(InputSource.class, new InputSourceEditor());
	this.defaultEditors.put(Locale.class, new LocaleEditor());
	this.defaultEditors.put(Pattern.class, new PatternEditor());
	this.defaultEditors.put(Properties.class, new PropertiesEditor());
	this.defaultEditors.put(Resource[].class, new ResourceArrayPropertyEditor());
	this.defaultEditors.put(TimeZone.class, new TimeZoneEditor());
	this.defaultEditors.put(URI.class, new URIEditor());
	this.defaultEditors.put(URL.class, new URLEditor());
	this.defaultEditors.put(UUID.class, new UUIDEditor());

	// Default instances of collection editors.
	// Can be overridden by registering custom instances of those as custom editors.
	this.defaultEditors.put(Collection.class, new CustomCollectionEditor(Collection.class));
	this.defaultEditors.put(Set.class, new CustomCollectionEditor(Set.class));
	this.defaultEditors.put(SortedSet.class, new CustomCollectionEditor(SortedSet.class));
	this.defaultEditors.put(List.class, new CustomCollectionEditor(List.class));
	this.defaultEditors.put(SortedMap.class, new CustomMapEditor(SortedMap.class));

	// Default editors for primitive arrays.
	this.defaultEditors.put(byte[].class, new ByteArrayPropertyEditor());
	this.defaultEditors.put(char[].class, new CharArrayPropertyEditor());

	// The JDK does not contain a default editor for char!
	this.defaultEditors.put(char.class, new CharacterEditor(false));
	this.defaultEditors.put(Character.class, new CharacterEditor(true));

	// Spring's CustomBooleanEditor accepts more flag values than the JDK's default editor.
	this.defaultEditors.put(boolean.class, new CustomBooleanEditor(false));
	this.defaultEditors.put(Boolean.class, new CustomBooleanEditor(true));

	// The JDK does not contain default editors for number wrapper types!
	// Override JDK primitive number editors with our own CustomNumberEditor.
	this.defaultEditors.put(byte.class, new CustomNumberEditor(Byte.class, false));
	this.defaultEditors.put(Byte.class, new CustomNumberEditor(Byte.class, true));
	this.defaultEditors.put(short.class, new CustomNumberEditor(Short.class, false));
	this.defaultEditors.put(Short.class, new CustomNumberEditor(Short.class, true));
	this.defaultEditors.put(int.class, new CustomNumberEditor(Integer.class, false));
	this.defaultEditors.put(Integer.class, new CustomNumberEditor(Integer.class, true));
	this.defaultEditors.put(long.class, new CustomNumberEditor(Long.class, false));
	this.defaultEditors.put(Long.class, new CustomNumberEditor(Long.class, true));
	this.defaultEditors.put(float.class, new CustomNumberEditor(Float.class, false));
	this.defaultEditors.put(Float.class, new CustomNumberEditor(Float.class, true));
	this.defaultEditors.put(double.class, new CustomNumberEditor(Double.class, false));
	this.defaultEditors.put(Double.class, new CustomNumberEditor(Double.class, true));
	this.defaultEditors.put(BigDecimal.class, new CustomNumberEditor(BigDecimal.class, true));
	this.defaultEditors.put(BigInteger.class, new CustomNumberEditor(BigInteger.class, true));

	// Only register config value editors if explicitly requested.
	if (this.configValueEditorsActive) {
		StringArrayPropertyEditor sae = new StringArrayPropertyEditor();
		this.defaultEditors.put(String[].class, sae);
		this.defaultEditors.put(short[].class, sae);
		this.defaultEditors.put(int[].class, sae);
		this.defaultEditors.put(long[].class, sae);
	}
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:71,代码来源:PropertyEditorRegistrySupport.java


示例17: setVisibleColumns

import org.springframework.beans.propertyeditors.StringArrayPropertyEditor; //导入依赖的package包/类
/**
 * Set visible columns as CSV String 
 * @param value the CSV String
 */
public void setVisibleColumns(String value) {
	StringArrayPropertyEditor pe = new StringArrayPropertyEditor();
	pe.setAsText(value);
	visibleColumns = Arrays.asList(( String[]) pe.getValue());
}
 
开发者ID:chelu,项目名称:jdal,代码行数:10,代码来源:TableState.java


示例18: initBinder

import org.springframework.beans.propertyeditors.StringArrayPropertyEditor; //导入依赖的package包/类
/**
 * Initializes data bindings for various HTTP request handler method parameter Java class types.
 * 
 * @param dataBinder the DataBinder implementation used for Web transactions.
 * @see org.springframework.web.bind.WebDataBinder
 * @see org.springframework.web.bind.annotation.InitBinder
 */
@InitBinder
public void initBinder(final WebDataBinder dataBinder) {
  dataBinder.registerCustomEditor(String[].class,
      new StringArrayPropertyEditor(StringArrayPropertyEditor.DEFAULT_SEPARATOR, false));
}
 
开发者ID:ampool,项目名称:monarch,代码行数:13,代码来源:AbstractCommandsController.java


示例19: initBinder

import org.springframework.beans.propertyeditors.StringArrayPropertyEditor; //导入依赖的package包/类
/**
 * Initializes data bindings for various HTTP request handler method parameter Java class types.
 * <p/>
 * @param dataBinder the DataBinder implementation used for Web transactions.
 * @see org.springframework.web.bind.WebDataBinder
 * @see org.springframework.web.bind.annotation.InitBinder
 */
@InitBinder
public void initBinder(final WebDataBinder dataBinder) {
  dataBinder.registerCustomEditor(String[].class, new StringArrayPropertyEditor(
    StringArrayPropertyEditor.DEFAULT_SEPARATOR, false));
}
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:13,代码来源:AbstractCommandsController.java



注:本文中的org.springframework.beans.propertyeditors.StringArrayPropertyEditor类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java BytesRefArrayWritable类代码示例发布时间:2022-05-22
下一篇:
Java Session类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap