]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.databoard/src/org/simantics/databoard/binding/reflection/BindingProvider.java
Fixing several binding-related bugs
[simantics/platform.git] / bundles / org.simantics.databoard / src / org / simantics / databoard / binding / reflection / BindingProvider.java
1 /*******************************************************************************
2  * Copyright (c) 2007, 2011 Association for Decentralized Information Management in
3  * Industry THTH ry.
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
8  *
9  * Contributors:
10  *     VTT Technical Research Centre of Finland - initial API and implementation
11  *******************************************************************************/
12 package org.simantics.databoard.binding.reflection;
13
14 import org.simantics.databoard.binding.Binding;
15 import org.simantics.databoard.binding.error.BindingConstructionException;
16
17 /**
18  * Binding provider is an interface for providers that provide context-specific
19  * or hand-written bindings for the whole binding construction mechanism.
20  *
21  * @author toni.kalajainen@semantum.fi
22  */
23 public interface BindingProvider {
24
25         /**
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.
29          *  
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.  
33          * 
34          * @param request
35          * @param mainFactory master factory
36          * @return binding or <code>null</code> 
37          * @throws BindingConstructionException
38          */
39         Binding provideBinding(ClassBindingFactory mainFactory, BindingRequest request) throws BindingConstructionException;
40         
41 }