1 /*******************************************************************************
2 * Copyright (c) 2010 Association for Decentralized Information Management in
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
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 *******************************************************************************/
12 package org.simantics.databoard.binding.impl;
14 import org.simantics.databoard.binding.BooleanBinding;
15 import org.simantics.databoard.binding.error.BindingException;
16 import org.simantics.databoard.binding.error.UnsupportedOperationException;
17 import org.simantics.databoard.type.BooleanType;
20 * Binds Boolean Type to java.lang.Boolean-class.
22 * @author Toni Kalajainen <toni.kalajainen@vtt.fi>
24 public class BooleanBindingDefault extends BooleanBinding {
26 public BooleanBindingDefault(BooleanType type) {
30 public Object create(boolean value)
35 public Object create(Boolean value)
40 public void setValue(Object obj, Boolean newValue)
41 throws BindingException
43 throw new UnsupportedOperationException("Cannot change the value of immutable java.lang.Boolean");
46 public void setValue(Object obj, boolean newValue)
47 throws BindingException
49 if (((Boolean)obj).booleanValue() == newValue) return;
50 throw new UnsupportedOperationException("Cannot change the value of immutable java.lang.Boolean");
54 public Boolean getValue(Object o)
55 throws BindingException
61 public boolean getValue_(Object o)
62 throws BindingException
68 public boolean isInstance(Object obj) {
69 return obj instanceof Boolean;
73 public boolean isImmutable() {