]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.databoard/src/org/simantics/databoard/adapter/AbstractAdapter.java
Improved Bindings.getBinding(Class) caching for Datatype.class
[simantics/platform.git] / bundles / org.simantics.databoard / src / org / simantics / databoard / adapter / AbstractAdapter.java
1 package org.simantics.databoard.adapter;
2
3
4 public abstract class AbstractAdapter implements Adapter {
5         
6         /** True if this adapter has to make type conversion (incl. sub-adapters) */
7         boolean typeAdapter = false;            
8         /** True if the adapter clones or creates a new instance (incl. all sub-adapters) */
9         boolean clones = true;
10         
11         /**
12          * A back-reference to the adapter request for keeping adapters that are currently used
13          * from being unnecessarily purged from the cache.
14          */
15         AdapterRequest request;
16                         
17     public Object adaptUnchecked(Object obj) throws RuntimeAdaptException {
18                 try {
19                         return adapt(obj);
20                 } catch (AdaptException e) {
21                         throw new RuntimeAdaptException( e ); 
22                 }
23     }
24     
25     public void finalizeConstruction() {}
26     
27 }