static

in json/src/main/java/org/netbeans/html/json/spi/PropertyBinding.java [41:87]


    static {
        new PropertyBindingAccessor() {
            @Override
            protected JSONCall newCall(BrwsrCtx ctx, RcvrJSON callback, String headers, String urlBefore, String urlAfter, String method, Object data) {
                return new JSONCall(ctx, callback, headers, urlBefore, urlAfter, method, data);
            }

            @Override
            protected Bindings bindings(Proto proto, boolean initialize, Object copyFrom) {
                return initialize ? proto.initBindings(copyFrom) : proto.getBindings();
            }

            @Override
            protected void notifyChange(Proto proto, int propIndex) {
                proto.onChange(propIndex);
            }

            @Override
            protected Proto findProto(Proto.Type<?> type, Object object) {
                return type.protoFor(object);
            }

            @Override
            protected <Model> Model cloneTo(Proto.Type<Model> type, Model model, BrwsrCtx c) {
                return type.cloneTo(model, c);
            }

            @Override
            protected Object read(Proto.Type<?> from, BrwsrCtx c, Object data) {
                return from.read(c, data);
            }

            @Override
            protected <M> PropertyBinding newBinding(
                Proto.Type<M> access, Bindings<?> bindings, String name, int index, M model, byte propertyType) {
                return new Impl(model, bindings, name, index, access, propertyType);
            }
        };
        boolean weakOK;
        try {
            Class<?> weakRefClass = Class.forName("java.lang.ref.WeakReference"); // NOI18N
            weakOK = weakRefClass != null;
        } catch (ClassNotFoundException ex) {
            weakOK = false;
        }
        weakSupported = weakOK;
    }