X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.databoard%2Fsrc%2Forg%2Fsimantics%2Fdataboard%2Fbinding%2Ffactory%2FTypeRepository.java;h=b21d3c422f79b7dcdcb473638cc6930d0d97a99c;hp=dc1d3936068a8a5615de2dbeae62a9608cecff25;hb=refs%2Fchanges%2F38%2F238%2F2;hpb=24e2b34260f219f0d1644ca7a138894980e25b14 diff --git a/bundles/org.simantics.databoard/src/org/simantics/databoard/binding/factory/TypeRepository.java b/bundles/org.simantics.databoard/src/org/simantics/databoard/binding/factory/TypeRepository.java index dc1d39360..b21d3c422 100644 --- a/bundles/org.simantics.databoard/src/org/simantics/databoard/binding/factory/TypeRepository.java +++ b/bundles/org.simantics.databoard/src/org/simantics/databoard/binding/factory/TypeRepository.java @@ -1,43 +1,43 @@ -/******************************************************************************* - * Copyright (c) 2007, 2011 Association for Decentralized Information Management in - * Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.databoard.binding.factory; - -import java.util.HashMap; -import java.util.Map; - -import org.simantics.databoard.binding.reflection.BindingRequest; -import org.simantics.databoard.type.Datatype; - -public class TypeRepository { - - Map typeMap = new HashMap(); - Map classMap = new HashMap(); - - public synchronized void put(Datatype type, BindingRequest br) { - typeMap.put(type, br); - classMap.put(br.className.replace('$', '.'), br); - } - - public synchronized boolean containsType( Datatype type ) { - return typeMap.containsKey( type ); - } - - public synchronized BindingRequest getRequestForType(Datatype type) { - return typeMap.get(type); - } - - public synchronized BindingRequest getRequest(String className) { - if (className.indexOf('$')>=0) className = className.replace('$', '.'); - return classMap.get(className); - } - -} +/******************************************************************************* + * Copyright (c) 2007, 2011 Association for Decentralized Information Management in + * Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.databoard.binding.factory; + +import java.util.HashMap; +import java.util.Map; + +import org.simantics.databoard.binding.reflection.BindingRequest; +import org.simantics.databoard.type.Datatype; + +public class TypeRepository { + + Map typeMap = new HashMap(); + Map classMap = new HashMap(); + + public synchronized void put(Datatype type, BindingRequest br) { + typeMap.put(type, br); + classMap.put(br.className.replace('$', '.'), br); + } + + public synchronized boolean containsType( Datatype type ) { + return typeMap.containsKey( type ); + } + + public synchronized BindingRequest getRequestForType(Datatype type) { + return typeMap.get(type); + } + + public synchronized BindingRequest getRequest(String className) { + if (className.indexOf('$')>=0) className = className.replace('$', '.'); + return classMap.get(className); + } + +}