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