]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.databoard/src/org/simantics/databoard/binding/factory/BindingScheme.java
Improved Bindings.getBinding(Class) caching for Datatype.class
[simantics/platform.git] / bundles / org.simantics.databoard / src / org / simantics / databoard / binding / factory / BindingScheme.java
1 /*******************************************************************************
2  *  Copyright (c) 2010 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.factory;
13
14 import org.simantics.databoard.binding.Binding;
15 import org.simantics.databoard.binding.error.BindingConstructionException;
16 import org.simantics.databoard.binding.error.RuntimeBindingConstructionException;
17 import org.simantics.databoard.type.Datatype;
18
19 public interface BindingScheme {
20
21         /**
22          * Get binding of a data type
23          * 
24          * @param type data type
25          * @return binding 
26          * @throws BindingConstructionException if data type is not supported
27          */
28         Binding getBinding(Datatype type) throws BindingConstructionException;
29
30         /**
31          * Get binding of a data type
32          * 
33          * @param type data type
34          * @return binding 
35          * @throws RuntimeBindingConstructionException if data type is not supported
36          */
37         Binding getBindingUnchecked(Datatype type) throws RuntimeBindingConstructionException;
38         
39         /**
40          * Tests if the scheme supports a type
41          * 
42          * @param type
43          * @return true if the type is supported by the scheme
44          */
45         boolean supportsType(Datatype type);
46         
47 }
48