1 /*******************************************************************************
2 * Copyright (c) 2007, 2011 Association for Decentralized Information Management in
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 *******************************************************************************/
12 package org.simantics.databoard.binding.reflection;
14 import org.simantics.databoard.binding.Binding;
15 import org.simantics.databoard.binding.error.BindingConstructionException;
18 * Binding provider is an interface for providers that provide context-specific
19 * or hand-written bindings for the whole binding construction mechanism.
21 * @author toni.kalajainen@semantum.fi
23 public interface BindingProvider {
26 * Construct a binding for a request. This method returns null if a binding
27 * cannot be provided by this factory. Exception is thrown if construction
28 * is expected to success but fails for a reason.
30 * If this class constructs a compositive type: Array, Map, Optional,
31 * Record or Union, the composite types/fields need not be filled, and
32 * should be left null. They are filled by the caller.
35 * @param mainFactory master factory
36 * @return binding or <code>null</code>
37 * @throws BindingConstructionException
39 Binding provideBinding(ClassBindingFactory mainFactory, BindingRequest request) throws BindingConstructionException;