public void registerProperty(Object instance, String propertyName, boolean override) {
        if (registeredProperties == null) {
            registeredProperties = new HashMap<>();
        }

        if (instance == null) {
            registeredProperties.remove(propertyName);
        } else {
            Object oldInstance = registeredProperties.get(propertyName);
            PropertyProxy proxy = oldInstance instanceof PropertyProxy ? (PropertyProxy) oldInstance : null;

            if (!override && oldInstance != null && proxy == null) {
                return;
            }

            registeredProperties.put(propertyName, instance);

            // If previous registrant was a property proxy, transfer its value to new registrant.
            if (proxy != null) {
                try {
                    proxy.getPropertyInfo().setPropertyValue(instance, proxy.getValue());
                } catch (Exception e) {
                    throw createChainedException("Register Property", e, null);
                }
            }
        }
    }
public void registerProperty ( Object instance , String propertyName , boolean override ) { if ( registeredProperties == null ) { registeredProperties = new HashMap < > ( ) ; } if ( instance == null ) { registeredProperties . remove ( propertyName ) ; } else { Object oldInstance = registeredProperties . get ( propertyName ) ; PropertyProxy proxy = oldInstance instanceof PropertyProxy ? ( PropertyProxy ) oldInstance : null ; if ( ! override && oldInstance != null && proxy == null ) { return ; } registeredProperties . put ( propertyName , instance ) ; if ( proxy != null ) { try { proxy . getPropertyInfo ( ) . setPropertyValue ( instance , proxy . getValue ( ) ) ; } catch ( Exception e ) { throw createChainedException ( "Register Property" , e , null ) ; } } } }
Registers a named property to the container. Using this, a plugin can expose a property for
serialization and deserialization.

@param instance The object instance holding the property accessors. If null, any existing
registration will be removed.
@param propertyName Name of property to register.
@param override If the property is already registered to a non-proxy, the previous
registration will be replaced if this is true; otherwise the request is ignored.