Examples of BindingException


Examples of com.atlassian.xmlrpc.BindingException

    public <T> T bind( Class<T> bindClass, URL url, ConnectionInfo connectionInfo )
        throws BindingException
    {
        if ( !bindClass.isInterface() )
        {
            throw new BindingException( "Class " + bindClass.getName() + "is not an interface" );
        }
        ServiceObject serviceObject = bindClass.getAnnotation( ServiceObject.class );
        if ( serviceObject == null )
        {
            throw new BindingException( "Could not find ServiceObject annotation on " + bindClass.getName() );
        }
        final XmlRpcClient client = getXmlRpcClient( url, connectionInfo );

        XmlRpcInvocationHandler handler = new XmlRpcInvocationHandler( new XmlRpcClientProvider()
        {
            public Object execute( String serviceName, String methodName, Vector arguments )
                throws BindingException
            {
                try
                {
                    return client.execute( serviceName + "." + methodName, arguments );
                }
                catch ( XmlRpcException e )
                {
                    throw new BindingException( e );
                }
            }
        } );

        return (T) Proxy.newProxyInstance( getClass().getClassLoader(), new Class[]{bindClass}, handler );
View Full Code Here

Examples of com.palantir.ptoss.cinch.core.BindingException

                        }
                    };
                    model.bind(binding);
                    bindings.add(binding);
                } else {
                    throw new BindingException("Can only log a BindableModel.");
                }
            }
            return bindings;
        }
View Full Code Here

Examples of com.palantir.ptoss.cinch.core.BindingException

                final String to = action.to();
                final boolean invert = (action.type() == Type.INVERTED);
                try {
                    bindings.addAll(wire(to, field, context, invert));
                } catch (final Exception e) {
                    throw new BindingException("could not wire up @VisibleIf on " + field.getName(), e);
                }
            }
            return bindings;
        }
View Full Code Here

Examples of com.palantir.ptoss.cinch.core.BindingException

        private static Collection<Binding> wire(final String to, final Field field, final BindingContext context, final boolean invert)
            throws SecurityException, NoSuchMethodException, IllegalArgumentException, IntrospectionException {
            final Method setVisibleMethod = field.getType().getMethod("setVisible", boolean.class);
            if (setVisibleMethod == null) {
                throw new BindingException("no setVisible call on VisibleIf field: " + field);
            }
            final Object setVisibleObject = context.getFieldObject(field, Object.class);
            final ObjectFieldMethod getter = context.findGetter(to);
            if (getter == null) {
                throw new BindingException("could not find bindable property: " + to);
            }
            if (getter.getMethod().getReturnType() != boolean.class) {
                throw new BindingException("VisibleIf binding must return boolean: " + to);
            }
            final Binding binding = new Binding() {
                public <T extends Enum<?> & ModelUpdate> void update(final T... changed) {
                    try {
                        getter.getMethod().setAccessible(true);
View Full Code Here

Examples of com.palantir.ptoss.cinch.core.BindingException

                Action action = field.getAnnotation(Action.class);
                String call = action.call();
                try {
                    wire(call, field, context);
                } catch (Exception e) {
                    throw new BindingException("could not wire up @Action on " +
                            field.getName(), e);
                }
            }
            return ImmutableList.of();
        }
View Full Code Here

Examples of com.palantir.ptoss.cinch.core.BindingException

                        IllegalAccessException, InvocationTargetException {
            Method aalMethod = field.getType().getMethod("addActionListener", ActionListener.class);
            Object actionObject = context.getFieldObject(field, Object.class);
            final ObjectFieldMethod ofm = context.getBindableMethod(call);
            if (ofm == null) {
                throw new BindingException("could not find bindable method: " + call);
            }
            ActionListener actionListener = new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    try {
                        boolean accessible = ofm.getMethod().isAccessible();
View Full Code Here

Examples of com.palantir.ptoss.cinch.core.BindingException

            for (Field field : actions) {
                OnChange change = field.getAnnotation(OnChange.class);
                try {
                    wire(change, field, context);
                } catch (Exception e) {
                    throw new BindingException("could not wire up @OnChange on " + field.getName(), e);
                }
            }
            return ImmutableList.of();
        }
View Full Code Here

Examples of com.palantir.ptoss.cinch.core.BindingException

        private static void wire(final OnChange change, Field field, BindingContext context)
            throws SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException {

            String call = change.call();
            if (call == null) {
                throw new BindingException("call on @OnChange on " + field.getName() + " must be specified");
            }
            Method _adjustMethod = null;
            try {
                _adjustMethod = field.getType().getMethod("getValueIsAdjusting");
            } catch(NoSuchMethodException nsme) {
                // not a problem, leave value as null;
            }

            final Method adjustMethod = _adjustMethod;
            final Method addChangeMethod = field.getType().getMethod("addChangeListener", ChangeListener.class);
            if (addChangeMethod != null) {
                final Object changeObject = context.getFieldObject(field, Object.class);
                final ObjectFieldMethod ofm = context.getBindableMethod(call);
                if (ofm == null) {
                    throw new BindingException("could not find bindable method: " + call);
                }
                final ChangeListener changeListener = new ChangeListener() {
                    public void stateChanged(ChangeEvent e) {
                        try {
                            if (adjustMethod != null && !change.onAdjust()) {
View Full Code Here

Examples of com.palantir.ptoss.cinch.core.BindingException

                        throw Throwables.throwUncheckedException(e);
                    }
                }
            });
            if (!didBind.booleanValue()) {
                throw new BindingException("don't know how to wire up @Bound field: " + field.getName());
            }
            return bindings;
        }
View Full Code Here

Examples of com.palantir.ptoss.cinch.core.BindingException

                return ImmutableList.of(AbstractButtonWiringHarness.bindAbstractButton(mutator, toggle));
            } else {
                return ImmutableList.of(bindJToggleButtonToBoolean(bound.value(), mutator, toggle));
            }
        } else {
            throw new BindingException("can only bind JToggleButtons to enums or booleans"); //$NON-NLS-1$
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.