Package org.springframework.beans.propertyeditors

Examples of org.springframework.beans.propertyeditors.ClassEditor


            Class type;
            if (entry.getValue() instanceof Class) {
                type = (Class) entry.getValue();
            }
            else {
                ClassEditor editor = new ClassEditor();
                editor.setAsText(String.valueOf(entry.getValue()));
                type = (Class) editor.getValue();
            }
            xstream.alias((String) entry.getKey(), type);
        }
    } 
View Full Code Here


    registry.registerCustomEditor(InputStream.class, new InputStreamEditor(baseEditor));
    registry.registerCustomEditor(File.class, new FileEditor(baseEditor));
    registry.registerCustomEditor(URL.class, new URLEditor(baseEditor));

    ClassLoader classLoader = this.resourceLoader.getClassLoader();
    registry.registerCustomEditor(Class.class, new ClassEditor(classLoader));
    registry.registerCustomEditor(URI.class, new URIEditor(classLoader));

    if (this.resourceLoader instanceof ResourcePatternResolver) {
      registry.registerCustomEditor(Resource[].class,
          new ResourceArrayPropertyEditor((ResourcePatternResolver) this.resourceLoader));
View Full Code Here

     *
     * @param properties
     *            the properties
     */
    public void setPropertyEditor(Properties properties) {
        ClassEditor classEditor = new ClassEditor();
       
        Class objectClass = null;
        String propertyName = null;
        Class propertyEditorClass = null;
               
        if (properties.get("objectClass") != null) {
            classEditor.setAsText((String) properties.get("objectClass"));
            objectClass = (Class) classEditor.getValue();
        }
        propertyName = (String) properties.get("propertyName");
        if (properties.get("propertyEditorClass") != null) {
            classEditor.setAsText((String) properties.get("propertyEditorClass"));
            propertyEditorClass = (Class) classEditor.getValue();
        } else {
            throw new IllegalArgumentException("propertyEditorClass is required");
        }
       
        if (propertyName != null) {
View Full Code Here

    doRegisterEditor(registry, File.class, new FileEditor(baseEditor));
    doRegisterEditor(registry, URL.class, new URLEditor(baseEditor));

    ClassLoader classLoader = this.resourceLoader.getClassLoader();
    doRegisterEditor(registry, URI.class, new URIEditor(classLoader));
    doRegisterEditor(registry, Class.class, new ClassEditor(classLoader));
    doRegisterEditor(registry, Class[].class, new ClassArrayEditor(classLoader));

    if (this.resourceLoader instanceof ResourcePatternResolver) {
      doRegisterEditor(registry, Resource[].class,
          new ResourceArrayPropertyEditor((ResourcePatternResolver) this.resourceLoader, this.propertyResolver));
View Full Code Here

    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());
View Full Code Here

  private void doRegisterDefaultEditors() {
    this.defaultEditors = new HashMap(64);

    // Simple editors, without parameterization capabilities.
    // The JDK does not contain a default editor for any of these target types.
    this.defaultEditors.put(Class.class, new ClassEditor());
    this.defaultEditors.put(Class[].class, new ClassArrayEditor());
    this.defaultEditors.put(File.class, new FileEditor());
    this.defaultEditors.put(InputStream.class, new InputStreamEditor());
    this.defaultEditors.put(Locale.class, new LocaleEditor());
    this.defaultEditors.put(Pattern.class, new PatternEditor());
View Full Code Here

    doRegisterEditor(registry, File.class, new FileEditor(baseEditor));
    doRegisterEditor(registry, URL.class, new URLEditor(baseEditor));

    ClassLoader classLoader = this.resourceLoader.getClassLoader();
    doRegisterEditor(registry, URI.class, new URIEditor(classLoader));
    doRegisterEditor(registry, Class.class, new ClassEditor(classLoader));
    doRegisterEditor(registry, Class[].class, new ClassArrayEditor(classLoader));

    if (this.resourceLoader instanceof ResourcePatternResolver) {
      doRegisterEditor(registry, Resource[].class,
          new ResourceArrayPropertyEditor((ResourcePatternResolver) this.resourceLoader, this.propertyResolver));
View Full Code Here

    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(Locale.class, new LocaleEditor());
View Full Code Here

    registry.registerCustomEditor(InputStream.class, new InputStreamEditor(baseEditor));
    registry.registerCustomEditor(File.class, new FileEditor(baseEditor));
    registry.registerCustomEditor(URL.class, new URLEditor(baseEditor));

    ClassLoader classLoader = this.resourceLoader.getClassLoader();
    registry.registerCustomEditor(Class.class, new ClassEditor(classLoader));
    if (JdkVersion.isAtLeastJava14()) {
      registry.registerCustomEditor(URI.class, new URIEditor(classLoader));
    }

    if (this.resourceLoader instanceof ResourcePatternResolver) {
View Full Code Here

  private void doRegisterDefaultEditors() {
    this.defaultEditors = new HashMap(64);

    // Simple editors, without parameterization capabilities.
    // The JDK does not contain a default editor for any of these target types.
    this.defaultEditors.put(Class.class, new ClassEditor());
    this.defaultEditors.put(Class[].class, new ClassArrayEditor());
    this.defaultEditors.put(File.class, new FileEditor());
    this.defaultEditors.put(InputStream.class, new InputStreamEditor());
    this.defaultEditors.put(Locale.class, new LocaleEditor());
    this.defaultEditors.put(Properties.class, new PropertiesEditor());
View Full Code Here

TOP

Related Classes of org.springframework.beans.propertyeditors.ClassEditor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.