protected synchronized void setProperty()

in src/main/java/org/ini4j/spi/AbstractBeanInvocationHandler.java [184:206]


    protected synchronized void setProperty(String property, Object value, Class<?> clazz) throws PropertyVetoException
    {
        boolean pc = (_pcSupport != null) && _pcSupport.hasListeners(property);
        boolean vc = (_vcSupport != null) && _vcSupport.hasListeners(property);
        Object oldVal = null;
        Object newVal = ((value != null) && clazz.equals(String.class) && !(value instanceof String)) ? value.toString() : value;

        if (pc || vc)
        {
            oldVal = getProperty(property, clazz);
        }

        if (vc)
        {
            fireVetoableChange(property, oldVal, value);
        }

        setPropertySpi(property, newVal, clazz);
        if (pc)
        {
            firePropertyChange(property, oldVal, value);
        }
    }